diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/blob.html | 50 | ||||
-rw-r--r-- | views/branch.html | 42 | ||||
-rw-r--r-- | views/commit-list.html | 47 | ||||
-rw-r--r-- | views/commit.html | 72 | ||||
-rw-r--r-- | views/index.html | 29 | ||||
-rw-r--r-- | views/paginate.html | 15 | ||||
-rw-r--r-- | views/summary.html | 81 | ||||
-rw-r--r-- | views/tree.html | 54 |
8 files changed, 390 insertions, 0 deletions
diff --git a/views/blob.html b/views/blob.html new file mode 100644 index 0000000..4d5f7d0 --- /dev/null +++ b/views/blob.html @@ -0,0 +1,50 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + +% if not dirname.raw: +% relroot = './' +% else: +% relroot = '../' * (len(dirname.split('/')) - 1) +% end + +<title>git » {{repo.name}} » + {{repo.branch}} » {{dirname.unicode}}/{{fname.unicode}}</title> +<link rel="stylesheet" type="text/css" + href="{{relroot}}../../../../../static/git-arr.css"/> +<link rel="stylesheet" type="text/css" + href="{{relroot}}../../../../../static/syntax.css"/> +<meta http-equiv="content-type" content="text/html; charset=utf-8"/> +</head> + +<body class="tree"> +<h1><a href="{{relroot}}../../../../../">git</a> » + <a href="{{relroot}}../../../">{{repo.name}}</a> » + <a href="{{relroot}}../">{{repo.branch}}</a> » + <a href="{{relroot}}">tree</a> +</h1> + +<h3> + <a href="{{relroot}}">[{{repo.branch}}]</a> / +% base = smstr(relroot) +% for c in dirname.split('/'): +% if not c.raw: continue + <a href="{{base.url}}{{c.url}}/">{{c.unicode}}</a> / +% base += c + '/' +% end + <a href="">{{!fname.html}}</a> +</h3> + +% if has_colorizer(): +{{!colorize_blob(fname.unicode, blob)}} +% else: +<pre class="blob-body"> +{{blob}} +</pre> +% end + +<hr/> + +</body> +</html> diff --git a/views/branch.html b/views/branch.html new file mode 100644 index 0000000..79ea880 --- /dev/null +++ b/views/branch.html @@ -0,0 +1,42 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>git » {{repo.name}} » {{repo.branch}}</title> +<link rel="stylesheet" type="text/css" href="../../../../static/git-arr.css"/> +<meta http-equiv="content-type" content="text/html; charset=utf-8"/> +</head> + +<body class="branch"> +<h1><a href="../../../../">git</a> » + <a href="../../">{{repo.name}}</a> » + <a href="./">{{repo.branch}}</a> +</h1> + +<p> +<a class="explicit" href="t/">Browse current source tree</a> +</p> + +% commits = repo.commits("refs/heads/" + repo.branch, +% limit = repo.info.commits_per_page, +% offset = repo.info.commits_per_page * offset) +% commits = list(commits) + +% if len(commits) == 0: +% abort(404, "No more commits") +% end + + +% include paginate nelem = len(commits), max_per_page = repo.info.commits_per_page, offset = offset + +% kwargs = dict(repo=repo, commits=commits, +% shorten=shorten, repo_root="../..") +% include commit-list **kwargs + +<p/> + +% include paginate nelem = len(commits), max_per_page = repo.info.commits_per_page, offset = offset + +</body> +</html> + diff --git a/views/commit-list.html b/views/commit-list.html new file mode 100644 index 0000000..3af9838 --- /dev/null +++ b/views/commit-list.html @@ -0,0 +1,47 @@ + +% def refs_to_html(refs): +% for ref in refs: +% c = ref.split('/', 2) +% if len(c) != 3: +% return +% end +% if c[1] == 'heads': +<span class="refs head">{{c[2]}}</span> +% elif c[1] == 'tags': +% if c[2].endswith('^{}'): +% c[2] = c[2][:-3] +% end +<span class="refs tag">{{c[2]}}</span> +% end +% end +% end + +<table class="nice commits"> + +% refs = repo.refs() +% if not defined("commits"): +% commits = repo.commits(start_ref, limit = limit, offset = offset) +% end + +% for c in commits: +<tr> + <td class="date"> + <span title="{{c.author_date.str}}">{{c.author_date.utc.date()}}</span> + </td> + <td class="subject"> + <a href="{{repo_root}}/c/{{c.id}}/" + title="{{c.subject}}"> + {{shorten(c.subject)}}</a> + </td> + <td class="author"> + <span title="{{c.author_name}}">{{shorten(c.author_name, 26)}}</span> + </td> + % if c.id in refs: + <td> + % refs_to_html(refs[c.id]) + </td> + % end +</tr> +% end +</table> + diff --git a/views/commit.html b/views/commit.html new file mode 100644 index 0000000..9a9e99d --- /dev/null +++ b/views/commit.html @@ -0,0 +1,72 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>git » {{repo.name}} » commit {{c.id[:7]}}</title> +<link rel="stylesheet" type="text/css" href="../../../../static/git-arr.css"/> +<link rel="stylesheet" type="text/css" href="../../../../static/syntax.css"/> +<meta http-equiv="content-type" content="text/html; charset=utf-8"/> +</head> + +<body class="commit"> +<h1><a href="../../../../">git</a> » + <a href="../../">{{repo.name}}</a> » commit {{c.id[:7]}} +</h1> + +<h2>{{c.subject}}</h2> + +<table class="nice commit-info"> + <tr><td>author</td> + <td><span class="name">{{c.author_name}}</span> + <span class="email"><{{c.author_email}}></span><br/> + <span class="date" title="{{c.author_date}}"> + {{c.author_date.utc}} UTC</span></td></tr> + <tr><td>committer</td> + <td><span class="name">{{c.author_name}}</span> + <span class="email"><{{c.author_email}}></span><br/> + <span class="date" title="{{c.author_date}}"> + {{c.author_date.utc}} UTC</span></td></tr> + +% for p in c.parents: + <tr><td>parent</td> + <td><a href="../{{p}}/">{{p}}</a></td></tr> +% end +</table> + +<hr/> + +<pre class="commit-message"> +{{c.message.strip()}} +</pre> + +<hr/> + +% if c.diff.changes: + +<table class="nice changed-files"> +% for added, deleted, fname in c.diff.changes: + <tr> + <td class="main">{{!fname.html}}</td> + <td><span class="lines-added">+{{added}}</span></td> + <td><span class="lines-deleted">-{{deleted}}</span></td> + </tr> +% end +</table> + +<hr/> + +% if has_colorizer(): +{{!colorize_diff(c.diff.body)}} +% else: +<pre class="diff-body"> +{{c.diff.body}} +</pre> +% end + +<hr/> + +% end + +</body> +</html> + diff --git a/views/index.html b/views/index.html new file mode 100644 index 0000000..b218b8b --- /dev/null +++ b/views/index.html @@ -0,0 +1,29 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>git</title> +<link rel="stylesheet" type="text/css" href="static/git-arr.css"/> +<meta http-equiv="content-type" content="text/html; charset=utf-8"/> +</head> + +<body class="index"> +<h1>git</h1> + +<table class="nice"> + <tr> + <th>project</th> + <th>description</th> + </tr> + + % for repo in sorted(repos.values(), key = lambda r: r.name): + <tr> + <td><a href="r/{{repo.name}}/">{{repo.name}}</a></td> + <td><a href="r/{{repo.name}}/">{{repo.info.desc}}</a></td> + </tr> + %end +</table> + +</body> +</html> + diff --git a/views/paginate.html b/views/paginate.html new file mode 100644 index 0000000..72f3156 --- /dev/null +++ b/views/paginate.html @@ -0,0 +1,15 @@ + +<div class="paginate"> +% if offset > 0: +<a href="{{offset - 1}}.html">← prev</a> +% else: +<span class="inactive">← prev</span> +% end +<span class="sep">|</span> +% if nelem >= max_per_page: +<a href="{{offset + 1}}.html">next →</a> +% else: +<span class="inactive">next →</span> +% end +</div> + diff --git a/views/summary.html b/views/summary.html new file mode 100644 index 0000000..ce92a60 --- /dev/null +++ b/views/summary.html @@ -0,0 +1,81 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>git » {{repo.name}}</title> +<link rel="stylesheet" type="text/css" href="../../static/git-arr.css"/> +<meta http-equiv="content-type" content="text/html; charset=utf-8"/> +</head> + +<body class="summary"> +<h1><a href="../../">git</a> » <a href="./">{{repo.name}}</a></h1> + +<h2>{{repo.info.desc}}</h2> + + +% if repo.info.web_url or repo.info.git_url: +<table class="nice repo_info"> + +% if repo.info.web_url: + <tr> + <td class="category">website</td> + <td><a class="explicit" href="{{repo.info.web_url}}"> + {{repo.info.web_url}}</a></td> + </tr> +% end +% if repo.info.git_url: + <tr> + <td class="category">repository</td> + <td>{{! '<br/>'.join(repo.info.git_url.split())}}</td> + </tr> +% end + +</table> +<hr/> +% end + +% if "master" in repo.branch_names(): +% kwargs = dict(repo = repo, start_ref = "refs/heads/master", +% limit = repo.info.commits_in_summary, +% shorten = shorten, repo_root = ".", offset = 0) +% include commit-list **kwargs +% end + +<hr/> + +<table class="nice"> + <tr> + <th>branches</th> + </tr> + + % for b in repo.branch_names(): + <tr> + <td class="main"><a href="b/{{b}}/">{{b}}</a></td> + <td class="links"> + <a class="explicit" href="b/{{b}}/">commits</a></td> + <td class="links"> + <a class="explicit" href="b/{{b}}/t/">tree</a></td> + </tr> + %end +</table> + +<hr/> + +% tags = list(repo.tags()) +% if tags: +<table class="nice"> + <tr> + <th>tags</th> + </tr> + + % for name, obj_id in tags: + <tr> + <td><a href="c/{{obj_id}}/">{{name}}</a></td> + </tr> + %end +</table> +% end + +</body> +</html> + diff --git a/views/tree.html b/views/tree.html new file mode 100644 index 0000000..9682065 --- /dev/null +++ b/views/tree.html @@ -0,0 +1,54 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + +% if not dirname.raw: +% relroot = './' +% else: +% relroot = '../' * (len(dirname.split('/')) - 1) +% end + +<title>git » {{repo.name}} » + {{repo.branch}} » {{dirname.unicode}}</title> +<link rel="stylesheet" type="text/css" + href="{{relroot}}../../../../../static/git-arr.css"/> +<meta http-equiv="content-type" content="text/html; charset=utf-8"/> +</head> + +<body class="tree"> +<h1><a href="{{relroot}}../../../../../">git</a> » + <a href="{{relroot}}../../../">{{repo.name}}</a> » + <a href="{{relroot}}../">{{repo.branch}}</a> » + <a href="{{relroot}}">tree</a> +</h1> + +<h3> + <a href="{{relroot}}">[{{repo.branch}}]</a> / +% base = smstr(relroot) +% for c in dirname.split('/'): +% if not c.raw: continue + <a href="{{base.url}}{{c.url}}/">{{c.unicode}}</a> / +% base += c + '/' +% end +</h3> + +<table class="nice ls"> +% key_func = lambda (t, n, s): (0 if t == 'tree' else 1, n.raw) +% for type, name, size in sorted(tree.ls(dirname.raw), key = key_func): + <tr class="{{type}}"> +% if type == "blob": + <td class="name"><a href="./f={{name.url}}.html"> + {{!name.html}}</a></td> + <td class="size">{{size}}</td> +% elif type == "tree": + <td class="name"> + <a class="explicit" href="./{{name.url}}/"> + {{!name.html}}/</a></td> +% end + </tr> +% end +</table> + +</body> +</html> |