Respect paging.log config settings.
Dan Brook [Sun, 6 Mar 2011 20:15:36 +0000 (20:15 +0000)]
Also try to render commit messages faithfully.

gitalist.conf
lib/Gitalist/URIStructure/Fragment/WithLog.pm
root/fragment/ref/commit.tt2
root/fragment/repository/shortlog.tt2
root/inc/log_pager.tt2
root/repository/search.tt2
root/static/css/core.css

index a238ab0..3b70911 100644 (file)
@@ -9,7 +9,7 @@ name Gitalist
 sitename "A Gitalist"
 
 <paging>
-  log = 50
+  log = 20
   summary = 17
 </paging>
 
index ea3ae2a..9d6d4ad 100644 (file)
@@ -10,7 +10,7 @@ after log => sub {
 
     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;
index 9719b1b..29cae88 100755 (executable)
 <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>
index 70ca25e..4394d76 100755 (executable)
        <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>
index e58aaab..bc2af4b 100755 (executable)
@@ -1,11 +1,9 @@
 <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>
index 901d4d6..318d5a1 100755 (executable)
@@ -16,7 +16,7 @@
  <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(
index 033f614..e34a12b 100755 (executable)
@@ -536,6 +536,14 @@ div.blob {
 
 /* /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;