Also try to render commit messages faithfully.
sitename "A Gitalist"
<paging>
- log = 50
+ log = 20
summary = 17
</paging>
my %logargs = (
sha1 => $c->stash->{Commit}->sha1, # $commit->sha1
- count => 25, #Gitalist->config->{paging}{log} || 25,
+ count => Gitalist->config->{paging}{log} || 25,
);
my $page = $c->req->param('pg') || 0;
<tr class="invert">
<td class='sha1' title='[% Commit.sha1 %]'>[% INCLUDE 'inc/chroma_hash.tt2' sha1 = Commit.sha1.substr(0, 7) %]</td>
<td class='time-since'>[% time_since(Commit.authored_time) %]</td>
- <td rowspan="2">[%
- message = Commit.comment | html; message.replace("\n", "<br/>");
- INCLUDE '_refs.tt2' object = commit;
- %]</td>
+ <td rowspan="2">
+ <p class='commit-message'>[% Commit.comment | html %]</p>
+ [% INCLUDE '_refs.tt2' object = commit %]
+ </td>
<td class='author'><a href="mailto:[% Commit.author.email %]" title="Email"><img style="float: left; padding-right: 10px" src="[% uri_for_gravatar(Commit.committer.email, 21) %]">[% Commit.author.name | html %]</a></td>
<td class='action-list'>Author</td>
</tr>
<td><input type="radio" name="sha1_b" value="[% line.sha1 %]" [% "checked" IF loop.count == 2 %]/></td>
<td class='sha1' title='[% line.sha1 %]'>[% INCLUDE 'inc/chroma_hash.tt2' sha1 = line.sha1.substr(0, 7) %]</td>
<td class='time-since' title='[% line.authored_time %]'>[% time_since(line.authored_time) %]</td>
- <td>
- [% IF longlogformat %]
- [% message = line.comment | html; message.replace("\n", "<br/>") %]
- [% ELSE %]
- [% short_cmt(line.comment) | html %]
- [% INCLUDE '_refs.tt2' object = line %]
- [% END %]
- </td>
+ <td><p class='commit-message'>[%-
+ IF longlogformat;
+ line.comment | html;
+ ELSE;
+ short_cmt(line.comment) | html;
+
+ END;
+ -%]</p>[% INCLUDE '_refs.tt2' object = line %]</td>
<td class='author'><img src="[% uri_for_gravatar(line.author.email, 21) %]" />[% line.author.name | html %]</td>
<td class='action-list'>
<a href="[% c.uri_for_action("/ref/commit", [Repository.name, line.sha1]) %]" title="Commit details" class="button commit">commit</a>
<ul class="pager">
- [% IF log_lines.first.sha1 != Commit.sha1 || (log_lines.size != 25 && page) %]
+ [% IF log_lines.first.sha1 != Commit.sha1 || (log_lines.size != c.config.paging.log && page) %]
<li class="pager_prev"><a href='[% c.uri_with(pg => (page||0) + 1) %]'>Newer commits</a></li>
[% END %]
- [% IF log_lines.first.sha1 != Commit.sha1 && log_lines.size == 25 %] [% END %]
-
- [% IF log_lines.size == 25 %]
+ [% IF log_lines.size == c.config.paging.log %]
<li class="pager_next"><a href='[% c.uri_with(pg => (page||0) - 1) %]'>Older commits</a></li>
[% END %]
</ul>
<tr [% "class='invert'" IF loop.count % 2 %]>
<td class='sha1' title='[% result.sha1 %]'>[% INCLUDE 'inc/chroma_hash.tt2' sha1 = result.sha1.substr(0, 7) %]</td>
<td class='time-since' title='[% result.authored_time %]'>[% time_since(result.authored_time) %]</td>
- <td>[%
+ <td class='commit-message'>[%
# XXX This is fragile at best.
html_comment = result.comment | html;
html_comment.replace(
/* /blobdiff etc */
+.commit-message {
+ white-space: pre-wrap;
+ width: 400px;
+}
+p.commit-message {
+ margin: 0;
+}
+
/* Hidden spans that contain bits of data to be used by JS */
.js-data {
display: none;