Tweak /blame layout.
sitename "Gitalist presently"
-# URI and label (title) of GIT logo link
-logo_url http://git-scm.org
-logo_label "git homepage"
-logo_img /git-logo.png
-
-home_link /
-home_link_str "A Gitalist"
-
-# show repository only if this file exists
-# (only effective if this variable evaluates to true)
-# export_ok
-
-# XXX Code in config FAIL
-# show repository only if this subroutine returns true
-# when given the path to the project, for example:
-# sub { return -e "$_[0]/git-daemon-export-ok"; }
-# export_auth_hook
-
-# stylesheet path/to/your/stylesheet.css
-logo /git-logo.png
-favicon /git-favicon.png
-
# $feature{'blame'}{'default'} = [1];
<feature>
<blame>
$c->stash(
commit => $commit,
diff => $patch,
+ filename => $filename,
# XXX Hack hack hack, see View::SyntaxHighlight
blobs => [$patch->[0]->{diff}],
language => 'Diff',
sub shortlog : Local {
my ( $self, $c ) = @_;
- my $project = $c->stash->{Project};
- my $commit = $self->_get_object($c);
+
+ my $project = $c->stash->{Project};
+ my $commit = $self->_get_object($c);
+ my $filename = $c->req->param('f') || '';
+
my %logargs = (
sha1 => $commit->sha1,
count => Gitalist->config->{paging}{log} || 25,
- ($c->req->param('f') ? (file => $c->req->param('f')) : ())
+ ($filename ? (file => $filename) : ())
);
my $page = $c->req->param('pg') || 0;
commit => $commit,
log_lines => [$project->list_revs(%logargs)],
refs => $project->references,
- action => 'shortlog',
page => $page,
+ filename => $filename,
+ action => 'shortlog',
);
}
-[% sha1 = sha1 || HEAD %]
-<span class='chroma-hash'>
- [%
+[%- sha1 = sha1 || HEAD -%]
+<span class='chroma-hash'>[%-
hptr = 0;
WHILE hptr < sha1.length - 6;
sha1part = sha1.substr(hptr, 6);
"<span style='border-bottom: solid 4px #" _ sha1part _ ";'>" _ sha1part _ "</span>";
hptr = hptr + 6;
END;
- %]
-</span>
+-%]</span>
<h3>BLOB PATH</h3>
-<div class='blame'>
+<div id='blame'>
<table>
-[% FOR info IN blame %]
-<tr>
- <td><a title="[% info.commit.author %] on [% info.commit.author_dt %]" href='[% c.uri_for('commit', {h=info.commit.sha1}) %]'>[% info.commit.sha1.substr(0,6) %]</a></td>
- <td>[% info.meta.lineno %]</td>
- <td><pre class='blame-line'>[% info.line | html %]</pre></td>
-</tr>
-[% END %]
+ <thead>
+ <tr>
+ <th>sha1</th>
+ <th>line</th>
+ <th>data</th>
+ </tr>
+ </thead>
+
+ <tfoot>
+ <tr>
+ <td>sha1</td>
+ <td>line</td>
+ <td>data</td>
+ </tr>
+ </tfoot>
+
+ <tbody>
+ [% FOR info IN blame %]
+ <tr class=''>
+ <td class='commit-info'><a title="[% info.commit.author %] on [% info.commit.author_dt %]" href='[% c.uri_for('commit', {h=info.commit.sha1}) %]'>[% INCLUDE '_chroma_hash.tt2' sha1 = info.commit.sha1.substr(0,7) -%]</a></td>
+ <td class='lineno'><tt>[% info.meta.lineno %]</tt></td>
+ <td><pre>[% info.line | html %]</pre></td>
+ </tr>
+ [% END %]
+ </tbody>
</table>
</div>
[% IF object.type == 'commit' %] •
<a href="[% c.uri_for('tree', {h=object.tree_sha1, hb=object.sha1}) %]">tree</a>
[% END %]
+ [% IF filename %]
+ §
+ <a href="[% c.uri_for('blob', {h=object.sha1,f=filename}) %]">blob</a> •
+ <a href="[% c.uri_for('blame', {h=object.sha1,f=filename}) %]">blame</a> •
+ <a href="[% c.uri_for('shortlog', {h=object.sha1,f=filename}) %]">history</a> •
+ <a href="[% c.uri_for(action, {f=filename}) %]">HEAD</a>
+ [% END %]
<div class='chroma-hash'>[% INCLUDE '_chroma_hash.tt2' sha1 = object.sha1 %]</div>
</div>
}
/* /blame */
-pre.blame-line {
+#blame pre, #blame tt {
margin: 0;
+ font-size: 0.9em;
+}
+#blame .commit-info {
+}
+#blame .lineno {
+ text-align: right;
+ padding: 0 8px;
+}
+#blame a {
+ text-decoration: none;
+}
+#blame tr.alt {
+ background-color: #f7f7f7;
+}
+#blame tbody tr:hover {
+ background-color: #fefeaa;
}
/* /blob */