-package Gitalist::Controller::Fragment::Commit;
+package Gitalist::Controller::Fragment::Ref;
use Moose;
use namespace::autoclean;
BEGIN { extends 'Gitalist::Controller' }
-with 'Gitalist::URIStructure::Commit';
+with 'Gitalist::URIStructure::Ref';
sub base : Chained('/fragment/repository/find') PathPart('') CaptureArgs(0) {}
-package Gitalist::Controller::Commit;
+package Gitalist::Controller::Ref;
use Moose;
use namespace::autoclean;
BEGIN { extends 'Gitalist::Controller' }
-with 'Gitalist::URIStructure::Commit';
+with 'Gitalist::URIStructure::Ref';
sub base : Chained('/repository/find') PathPart('') CaptureArgs(0) {}
-package Gitalist::URIStructure::Commit;
+package Gitalist::URIStructure::Ref;
use MooseX::MethodAttributes::Role;
use Moose::Autobox;
use namespace::autoclean;
[% FOREACH item IN diff %]
<div class='diff-head'>
diff --git [%# FIXME %]
- <a href='[% c.uri_for_action("/commit/blob", [Repository.name, Commit.sha1], item.file) %]'>[% item.a %][% item %]</a>
- <a href='[% c.uri_for_action("/commit/blob", [Repository.name, Commit.sha1], item.file) %]'>[% item.b %]</a>
+ <a href='[% c.uri_for_action("//ref/blob", [Repository.name, Commit.sha1], item.file) %]'>[% item.a %][% item %]</a>
+ <a href='[% c.uri_for_action("//ref/blob", [Repository.name, Commit.sha1], item.file) %]'>[% item.b %]</a>
</div>
<div class='diff-index'>
[% item.index %]
%]
</td>
<td class='action-list'>
- [% IF !line.is_new %]<a href="[% c.uri_for_action("/commit/diff", [Repository.name, Commit.sha1], line.file.to_path) %]">diff</a>[% END %]
- <a href="[% c.uri_for_action("/commit/blob", [Repository.name, Commit.sha1], line.file.to_path) %]">blob</a>
- [% IF !line.is_new %]<a href="[% c.uri_for("/commit/shortlog", [Repository.name, Commit.sha1], line.file.to_path) %]">history</a>[% END %]
+ [% IF !line.is_new %]<a href="[% c.uri_for_action("//ref/diff", [Repository.name, Commit.sha1], line.file.to_path) %]">diff</a>[% END %]
+ <a href="[% c.uri_for_action("//ref/blob", [Repository.name, Commit.sha1], line.file.to_path) %]">blob</a>
+ [% IF !line.is_new %]<a href="[% c.uri_for("//ref/shortlog", [Repository.name, Commit.sha1], line.file.to_path) %]">history</a>[% END %]
</td>
</tr>
[% END %]
+++ /dev/null
-<pre>
-[% subinclude('/fragment/commit/diff_plain', c.req.captures) %]
-</pre>
+++ /dev/null
-[% INCLUDE 'nav/actions.tt2' object = commit %]
-
-[% subinclude('/fragment/commit/history', c.req.captures, c.req.args.to_path) %]
<td class="link"><a href="[% repos_link %]">summary</a>
| <a href="[% c.uri_for_action('/repository/shortlog', [p.name]) %]">shortlog</a>
| <a href="[% c.uri_for_action('/repository/longlog', [p.name]) %]">log</a>
- | <a href="[% c.uri_for_action('/commit/tree', [p.name, 'HEAD']) %]">tree</a></td>
+ | <a href="[% c.uri_for_action('/ref/tree', [p.name, 'HEAD']) %]">tree</a></td>
</tr>
[% END %]
</tbody>
styleinfo = " style='border-top: solid 3px #" _ linecolour _ ";'"; -%]
<td nowrap class='author'[% styleinfo %]>[% info.commit.author %]</td>
<td nowrap class='date'[% styleinfo %]>[% info.commit.author_dt.ymd %]</td>
- <td nowrap class='commit-info chroma-hash'[% styleinfo %]><a title="[% info.commit.author %] on [% info.commit.author_dt %]" href='[% c.uri_for_action('/commit/commit', [Repository.name, info.commit.sha1]) %]'>[% linecolour %]</td>
+ <td nowrap class='commit-info chroma-hash'[% styleinfo %]><a title="[% info.commit.author %] on [% info.commit.author_dt %]" href='[% c.uri_for_action('/ref/commit', [Repository.name, info.commit.sha1]) %]'>[% linecolour %]</td>
[%- ELSE -%]
<td nowrap class='author'></td>
<td nowrap class='date'></td>
<td nowrap class='commit-info'></td>
[%- END -%]
- <td nowrap class='lineno' id='l[% info.meta.lineno %]' style='border-right: solid 3px #[% linecolour %]; border-left: solid 3px #[% linecolour %];'><tt><a href='[% c.uri_for_action('/commit/blame', [Repository.name, info.commit.sha1], filename.to_path ) %]#l[% info.meta.orig_lineno %]'>[% info.meta.lineno %]</a></tt></td>
+ <td nowrap class='lineno' id='l[% info.meta.lineno %]' style='border-right: solid 3px #[% linecolour %]; border-left: solid 3px #[% linecolour %];'><tt><a href='[% c.uri_for_action('/ref/blame', [Repository.name, info.commit.sha1], filename.to_path ) %]#l[% info.meta.orig_lineno %]'>[% info.meta.lineno %]</a></tt></td>
<td nowrap class='data'><pre>[% blame_lines.${loop.index} %]</pre></td>
[% lastsha1 = info.commit.sha1 %]
</tr>
<dd>[% Commit.sha1 %]</dd>
<dt>tree</dt>
<dd>[% Commit.tree_sha1 %]
- <span class='action-list'><a href="[% c.uri_for_action("/commit/tree", c.req.captures) %]">tree</a></span>
+ <span class='action-list'><a href="[% c.uri_for_action("/ref/tree", c.req.captures) %]">tree</a></span>
</dd>
[% FOREACH parent IN Commit.parents %]
<dt>parent</dt>
<dd>[% parent.sha1 %]
<span class='action-list'>
- <a href="[% c.uri_for_action('/commit/commit', [Repository.name, parent.sha1]) %]">commit</a>
- <a href="[% c.uri_for_action('/commit/diff_fancy', [Repository.name, parent.sha1]) %]">diff</a>
+ <a href="[% c.uri_for_action('/ref/commit', [Repository.name, parent.sha1]) %]">commit</a>
+ <a href="[% c.uri_for_action('/ref/diff_fancy', [Repository.name, parent.sha1]) %]">diff</a>
</span>
</dd>
[% END %]
<td class='file-mode'>[% item.modestr %]</td>
[%-
action_type = item.type == 'tree' ? 'tree' : 'blob';
- action_for_link = item.type == 'tree' ? '/commit/tree' : '/commit/blob';
+ action_for_link = item.type == 'tree' ? '/ref/tree' : '/ref/blob';
blob_or_tree_link = c.uri_for_action(action_for_link, c.req.captures, c.req.args.to_path(item.file))
-%]
<td class='file-name'>
<td class='action-list'>
<a href="[% blob_or_tree_link %]">[% theact %]</a>
[% IF item.type == 'blob' %]
- <a href="[% c.uri_for_action('/commit/blob', c.req.captures, c.req.args.to_path(item.file)) %]">blob</a>
- <a href="[% c.uri_for_action('/commit/blame', c.req.captures, c.req.args.to_path(item.file)) %]">blame</a>
+ <a href="[% c.uri_for_action('/ref/blob', c.req.captures, c.req.args.to_path(item.file)) %]">blob</a>
+ <a href="[% c.uri_for_action('/ref/blame', c.req.captures, c.req.args.to_path(item.file)) %]">blame</a>
[% END %]
- <a href="[% c.uri_for_action('/commit/history', c.req.captures, c.req.args.to_path(item.file)) %]">history</a>
+ <a href="[% c.uri_for_action('/ref/history', c.req.captures, c.req.args.to_path(item.file)) %]">history</a>
[% IF item.type == 'blob' %]
- <a href="[% c.uri_for_action('/commit/raw', c.req.captures, c.req.args.to_path(item.file)) %]">raw</a>
+ <a href="[% c.uri_for_action('/ref/raw', c.req.captures, c.req.args.to_path(item.file)) %]">raw</a>
[% END %]
</td>
</tr>
<td class='time-since' title='[% head.last_change %]'>[% time_since(head.last_change) %]</td>
<td class='head[% head.sha1 == HEAD ? ' current' : '' %]'>[% head.name %]</td>
<td class='action-list'>[%# FIXME %]
- <a href="[% c.uri_for_action('/commit/shortlog', [Repository.name, head.name]) %]">shortlog</a>
- <a href="[% c.uri_for_action('/commit/longlog', [Repository.name, head.name]) %]">log</a>
- <a href="[% c.uri_for_action('/commit/tree', [Repository.name, head.name]) %]">tree</a>
+ <a href="[% c.uri_for_action('/ref/shortlog', [Repository.name, head.name]) %]">shortlog</a>
+ <a href="[% c.uri_for_action('/ref/longlog', [Repository.name, head.name]) %]">log</a>
+ <a href="[% c.uri_for_action('/ref/tree', [Repository.name, head.name]) %]">tree</a>
</td>
</tr>
[% END %]
</table>
<span class="time-since">[% time_since(line.authored_time) %]</span>
<div class="action-list">
- <a href="[% c.uri_for_action("/commit/commit", [Repository.name, line.sha1]) %]">commit</a>
- | <a href="[% c.uri_for_action("/commit/diff_fancy", [Repository.name, line.sha1]) %]">commitdiff</a>
- | <a href="[% c.uri_for_action("/commit/tree", [Repository.name, line.sha1]) %]">tree</a>
+ <a href="[% c.uri_for_action("/ref/commit", [Repository.name, line.sha1]) %]">commit</a>
+ | <a href="[% c.uri_for_action("/ref/diff_fancy", [Repository.name, line.sha1]) %]">commitdiff</a>
+ | <a href="[% c.uri_for_action("/ref/tree", [Repository.name, line.sha1]) %]">tree</a>
</div>
</div>
</div>
[%# INCLUDE '_refs.tt2' object = line %]
</td>
<td class='action-list'>
- <a href="[% c.uri_for_action("/commit/commit", [Repository.name, line.sha1]) %]">commit</a>
- <a href="[% c.uri_for_action("/commit/diff_fancy", [Repository.name, line.sha1]) %]">commitdiff</a>
- <a href="[% c.uri_for_action("/commit/tree", [Repository.name, line.sha1]) %]">tree</a>
+ <a href="[% c.uri_for_action("/ref/commit", [Repository.name, line.sha1]) %]">commit</a>
+ <a href="[% c.uri_for_action("/ref/diff_fancy", [Repository.name, line.sha1]) %]">commitdiff</a>
+ <a href="[% c.uri_for_action("/ref/tree", [Repository.name, line.sha1]) %]">tree</a>
</td>
</tr>
[% END %]
<a href="[% c.uri_for_action('/repository/log', [c.req.captures.0]) %]">log</a>
[% IF Commit %]
§
- <a href="[% c.uri_for_action('/commit/commit', [c.req.captures.0, Commit.sha1]) %]">commit</a> •
- <a href="[% c.uri_for_action('/commit/diff_fancy', [c.req.captures.0, Commit.sha1]) %]">commitdiff</a> •
- <a href="[% c.uri_for_action('/commit/tree', [c.req.captures.0, Commit.sha1]) %]">tree</a>
+ <a href="[% c.uri_for_action('/ref/commit', [c.req.captures.0, Commit.sha1]) %]">commit</a> •
+ <a href="[% c.uri_for_action('/ref/diff_fancy', [c.req.captures.0, Commit.sha1]) %]">commitdiff</a> •
+ <a href="[% c.uri_for_action('/ref/tree', [c.req.captures.0, Commit.sha1]) %]">tree</a>
[% END %]
[% IF filename %]
§
- <a href="[% c.uri_for_action('/commit/blob', [c.req.captures.0, Commit.sha1], filename) %]">blob</a> •
- <a href="[% c.uri_for_action('/commit/raw', [c.req.captures.0, Commit.sha1], filename) %]">raw</a> •
- <a href="[% c.uri_for_action('/commit/blame', [c.req.captures.0, Commit.sha1], filename) %]">blame</a> •
- <a href="[% c.uri_for_action('/commit/shortlog', [c.req.captures.0, Commit.sha1], filename) %]">history</a> •
+ <a href="[% c.uri_for_action('/ref/blob', [c.req.captures.0, Commit.sha1], filename) %]">blob</a> •
+ <a href="[% c.uri_for_action('/ref/raw', [c.req.captures.0, Commit.sha1], filename) %]">raw</a> •
+ <a href="[% c.uri_for_action('/ref/blame', [c.req.captures.0, Commit.sha1], filename) %]">blame</a> •
+ <a href="[% c.uri_for_action('/ref/shortlog', [c.req.captures.0, Commit.sha1], filename) %]">history</a> •
<a href="[% c.uri_for(c.controller.action_for('commit'), [c.req.captures.0, Repository.head_hash]) %]">HEAD</a>
[% END %]
<div class='chroma-hash'>[% INCLUDE 'inc/chroma_hash.tt2' sha1 = object.sha1 %]</div>
<div class='path'>
- <a href="[% c.uri_for_action("/commit/tree", [Repository.name, Commit.sha1]) %]">[% Repository.name %]</a>
+ <a href="[% c.uri_for_action("/ref/tree", [Repository.name, Commit.sha1]) %]">[% Repository.name %]</a>
[% FOREACH part IN filename.split('/') %]
[% path = loop.first ? part : path _ '/' _ part %]
- / <a href="[% action_name = loop.last ? '/commit/blob' : '/commit/tree'; c.uri_for_action(action_name, [Repository.name,Commit.sha1], path.to_path ) %]">[% part %]</a>
+ / <a href="[% action_name = loop.last ? '/ref/blob' : '/commit/tree'; c.uri_for_action(action_name, [Repository.name,Commit.sha1], path.to_path ) %]">[% part %]</a>
[% END %]
</div>
<span title="Extended regular expression"><label><input type="checkbox" name="regexp" value="1">re</label></span>
</form>
</div>
-[% END %]
\ No newline at end of file
+[% END %]
</tfoot>
<tbody>
- [% subinclude('/fragment/commit/blame', c.req.captures, c.req.arguments.to_path ) %]
+ [% subinclude('/fragment/ref/blame', c.req.captures, c.req.arguments.to_path ) %]
</tbody>
</table>
</div>
[% END %]
[% INCLUDE 'nav/path.tt2' %]
<div>
- <pre class='blob'>[% subinclude('/fragment/commit/blob', c.req.captures, c.req.args.to_path) %]</pre>
+ <pre class='blob'>[% subinclude('/fragment/ref/blob', c.req.captures, c.req.args.to_path) %]</pre>
</div>
</div>
[% INCLUDE 'nav/actions.tt2' object = commit %]
<div class='content'>
- [% subinclude('/fragment/commit/commit', c.req.captures) %]
+ [% subinclude('/fragment/ref/commit', c.req.captures) %]
</div>
</div>
- [% subinclude('/fragment/commit/diff_fancy', c.req.captures c.req.args.to_path) %]
+ [% subinclude('/fragment/ref/diff_fancy', c.req.captures c.req.args.to_path) %]
</div>
--- /dev/null
+<pre>
+[% subinclude('/fragment/ref/diff_plain', c.req.captures) %]
+</pre>
--- /dev/null
+[% INCLUDE 'nav/actions.tt2' object = commit %]
+
+[% subinclude('/fragment/ref/history', c.req.captures, c.req.args.to_path) %]
INCLUDE 'nav/path.tt2' filename = path;
END;
- subinclude('/fragment/commit/tree', c.req.captures);
+ subinclude('/fragment/ref/tree', c.req.captures);
%]
</div>
[%# XXX Nabbed the HTML below from gitweb's log action. %]
[% FOREACH result IN results %]
<div class="header">
- <a class="title" href="[% c.uri_for_action('/commit/commit', [ Repository.name, result.sha1 ]) %]">
+ <a class="title" href="[% c.uri_for_action('/ref/commit', [ Repository.name, result.sha1 ]) %]">
<span class="age">[% result.authored_time %]</span>
[% short_cmt(result.comment) | html %]
</a>
<div class="title_text">
<div class="log_link">
- <a href="[% c.uri_for_action('/commit/commit', [Repository.name, result.sha1]) %]">commit</a>
- | <a href="[% c.uri_for_action('/commit/diff_fancy', [Repository.name, result.sha1]) %]">commitdiff</a>
- | <a href="[% c.uri_for_action('/commit/tree', [Repository.name, result.tree_sha1]); %][%# hb=line.sha1 %]">tree</a>
+ <a href="[% c.uri_for_action('/ref/commit', [Repository.name, result.sha1]) %]">commit</a>
+ | <a href="[% c.uri_for_action('/ref/diff_fancy', [Repository.name, result.sha1]) %]">commitdiff</a>
+ | <a href="[% c.uri_for_action('/ref/tree', [Repository.name, result.tree_sha1]); %][%# hb=line.sha1 %]">tree</a>
</div>
<i>[% result.author.name | html %] [% line.authored_time %]</i>
</div>
-search
\ No newline at end of file
+search