=cut
sub auto : Private {
- my($self, $c) = @_;
+ my($self, $c) = @_;
- # Yes, this is hideous.
- $self->header($c);
- $self->footer($c);
+ # XXX Move these to a plugin!
+ $c->stash(
+ time_since => sub {
+ return age_string(time - $_[0]->epoch);
+ },
+ short_cmt => sub {
+ my $cmt = shift;
+ my($line) = split /\n/, $cmt;
+ $line =~ s/^(.{70,80}\b).*/$1 …/;
+ return $line;
+ },
+ );
+
+ # Yes, this is hideous.
+ $self->header($c);
+ $self->footer($c);
}
# XXX This could probably be dropped altogether.
if ($c->stash->{project}) {
$c->stash->{HEAD} = $c->model()->head_hash;
}
-
- # XXX Move these to a plugin!
- $c->stash->{time_since} = sub {
- return age_string(time - $_[0]->epoch);
- };
- $c->stash->{short_cmt} = sub {
- my $cmt = shift;
- print STDERR "got [$cmt]\n";
- my($line) = split /\n/, $cmt;
- $line =~ s/^(.{70,80}\b).*/$1 …/;
- return $line;
- };
}
sub age_string {
},
);
- $hl->highlightText($blob);
+ my $hltxt = $hl->highlightText($blob);
+ $hltxt =~ s/([^[:ascii:]])/encode_entities($1)/eg;
+ $hltxt;
};
warn $@ if $@;
}
<table class='heads'>
<thead>
<tr>
+ <th>HEAD</th>
<th>age</th>
<th>branch</th>
<th>actions</th>
</thead>
<tfoot>
<tr>
+ <td>HEAD</td>
<td>age</td>
<td>branch</td>
<td>actions</td>
<tbody>
[% FOREACH head IN heads %]
<tr>
- <td>[% time_since(head.last_change) %]</td>
+ <td>[% INCLUDE '_chroma_hash.tt2' sha1 = head.sha1.substr(0,7) %]</td>
+ <td class='time-since'>[% time_since(head.last_change) %]</td>
<td class='head[% head.sha1 == HEAD ? ' current' : '' %]'>[% head.name %]</td>
<td class='action-list'>
- <a href="[% c.uri_for("shortlog", {h=head.sha1}) %]">shortlog</a>
- <a href="[% c.uri_for("log", {h=head.sha1}) %]">log</a>
- <a href="[% c.uri_for("tree", {h=head.sha1, hb=head.name}) %]">tree</a>
+ <a href="[% c.uri_for("shortlog", {h='refs/head/' _ head.name}) %]">shortlog</a>
+ <a href="[% c.uri_for("log", {h='refs/head/' _ head.name}) %]">log</a>
+ <a href="[% c.uri_for("tree", {h='refs/head/' _ head.name}) %]">tree</a>
</td>
</tr>
[% END %]
[% END %]
</dl>
-<pre class='commit-message'>[% commit.comment %]</pre>
+<pre class='commit-message'>[% commit.comment | html%]</pre>
[%
-# In the case of merge commits there will be no diff tree.
-IF diff_tree.size > 0;
- INCLUDE '_diff_tree.tt2';
-END;
+ # In the case of merge commits there will be no diff tree.
+ IF diff_tree.size > 0;
+ INCLUDE '_diff_tree.tt2';
+ END;
%]
<td><a class="list" href="[% c.uri_for('/summary', {p=p.name}) %]">[% p.name %]</a></td>
<td><a class="list" title="[% p.description %]" href="[% c.uri_for('/summary', {p=p.name} ) %]">[% p.description.split(' ').slice(0, 10).join(' ') %]</a></td>
<td>[% p.owner %]</td>
- <td class="age2">[% time_since(p.last_change) %]</td>
+ <td class="time-since">[% time_since(p.last_change) %]</td>
<td class="link"><a href="[% c.uri_for("summary", {p=p.name}) %]">summary</a>
| <a href="[% c.uri_for("shortlog", {p=p.name}) %]">shortlog</a>
| <a href="[% c.uri_for("log", {p=p.name}) %]">log</a>
<tr><td>committered time</td><td>[% line.committed_time %]</td></tr>
[% END %]
</table>
- <span class="age">[% time_since(line.authored_time) %]</span>
+ <span class="time-since">[% time_since(line.authored_time) %]</span>
<div class="action-list">
<a href="[% c.uri_for("commit", {h=line.sha}) %]">commit</a>
| <a href="[% c.uri_for("commitdiff", {h=line.sha1}) %]">commitdiff</a>
margin-bottom: 10px;
}
pre.commit-message {
- border-top: solid 2px green;
- border-bottom: solid 2px red;
+ border-top: solid 2px red;
+ border-bottom: solid 2px green;
padding: 5px;
}
.commit-info dt {
text-decoration: underline;
}
table.heads {
- width: 50%;
+ width: 75%;
}
/* /blob */