Showing 1 changed files with 45 additions and 62 deletions
+45 -62
templates/main/commits.html.ep
... ...
@@ -23,17 +23,16 @@
23 23
   my $commit = $git->parse_commit($project, $id);
24 24
   
25 25
   # Commits
26
-  my $page_count = 20;
26
+  my $page_count = 30;
27 27
   my $commits = $git->parse_commits(
28
-    $project, $commit->{id},$page_count, $page_count * $page);
28
+    $project, $commit->{id}, $page_count, $page_count * $page);
29
+  my $commits_date = {};
29 30
   for my $commit (@$commits) {
30
-    my $author_date
31
-      = $git->parse_date($commit->{author_epoch}, $commit->{author_tz});
32
-    $commit->{author_date} = $git->timestamp($author_date);
31
+    my $date = $commit->{age_string_date};
32
+    $commits_date->{$date} ||= [];
33
+    push @{$commits_date->{$date}}, $commit;
33 34
   }
34 35
   
35
-  use D;d $commits;
36
-  
37 36
   # References
38 37
   my $refs = $git->references($project);
39 38
   
... ...
@@ -58,11 +57,15 @@
58 57
       font-weight:bold;
59 58
       margin: 1em 0;
60 59
     }
60
+    .commit_history a {
61
+      color:#4183C4;
62
+    }
61 63
     
62 64
     /* Commit */
63 65
     .commit {
64 66
       border:1px solid gray;
65 67
       border-bottom:none;
68
+      margin-bottom:15px;
66 69
     }
67 70
     .commit_date {
68 71
       border-bottom:1px solid gray;
... ...
@@ -117,63 +120,43 @@
117 120
     
118 121
     %= include '/include/code_menu';
119 122
     
120
-    <div class="commit_history"><a>DBIx-Custom</a> / Commit History</div>
123
+    <div class="commit_history">
124
+      <a class="ubar" href="<%= url_for("/$user/$repository") %>">
125
+        <%= $repository %>
126
+      </a>
127
+      /
128
+      Commit History
129
+    </div>
121 130
     
122
-    <div class="commit">
123
-      <div class="commit_date">Nov 23, 2012</div>
124
-      <div class="commit_content">
125
-        <div class="commit_first">
126
-          <div class="commit_first_left">
127
-            <a class="ubar" href="<%= url_for("/$user/$repository/commit/$commit->{id}") %>">
128
-              improved documents
129
-            </a>
130
-          </div>
131
-          <div class="commit_first_right a_dec_on a_blue">
132
-            <a class="ubar" href="<%= url_for("/$user/$repository/commit/$commit->{id}") %>">
133
-              29ecfa4141
134
-            </a>
135
-          </div>
136
-        </div>
137
-        <div class="commit_second">
138
-          <div class="commit_second_left">yuki-kimoto authored 7 days ago</div>
139
-          <div class="commit_second_right">
140
-            <a class="ubar" href="<%= url_for("/$user/$repository/commit/$commit->{id}") %>">
141
-              Browse code
142
-            </a>
131
+    % for my $date (sort keys %$commits_date) {
132
+      <div class="commit">
133
+        % my $commits = $commits_date->{$date};
134
+        
135
+        <div class="commit_date"><%= $date %></div>
136
+        % for my $commit (sort {$a->{author_epoch} <=> $b->{author_epoch}} @$commits) {
137
+          <div class="commit_content">
138
+            <div class="commit_first">
139
+              <div class="commit_first_left">
140
+                <a class="ubar" href="<%= url_for("/$user/$repository/commit/$commit->{id}") %>">
141
+                  <%= $commit->{title_short} %>
142
+                </a>
143
+              </div>
144
+              <div class="commit_first_right a_dec_on a_blue">
145
+                <a class="ubar" href="<%= url_for("/$user/$repository/commit/$commit->{id}") %>">
146
+                  <%= substr($commit->{id}, 0, 10) %>
147
+                </a>
148
+              </div>
149
+            </div>
150
+            <div class="commit_second">
151
+              <div class="commit_second_left">yuki-kimoto authored 7 days ago</div>
152
+              <div class="commit_second_right">
153
+                <a class="ubar" href="<%= url_for("/$user/$repository/commit/$commit->{id}") %>">
154
+                  Browse code
155
+                </a>
156
+              </div>
157
+            </div>
143 158
           </div>
144
-        </div>
145
-      </div>
146
-    </div>
147
-
148
-    % for my $commit (@$commits) {
149
-      <div class="header">
150
-        <a class="title" href="<%= url_for('commit', project => $project_ns, id => $commit->{id}) %>">
151
-          <span class="age" style="font-size:70%">
152
-            <%= $commit->{age_string} %>
153
-          </span>
154
-          &nbsp;
155
-          <%= $commit->{title} %>
156
-        </a>
157
-      </div>
158
-      <div class="title_text">
159
-        <div class="log_link">
160
-          <a href="<%= url_for('commit', project => $project_ns, id => $commit->{id}) %>">commit</a> |
161
-          <a href="<%= url_for('commitdiff', project => $project_ns, diff => $commit->{id}) %>">
162
-            commitdiff
163
-          </a>
164
-          |
165
-          <a href="<%= url_for('tree', project => $project_ns,
166
-              id_dir => $commit->{id}) %>">
167
-            tree
168
-          </a><br/>
169
-        </div>
170
-        <span class="author_date"><%= $commit->{author_name} %> [<%= $commit->{author_date} %>]</span>
171
-        <br/>
172
-      </div>
173
-      <div class="log_body">
174
-        %= include 'include/refs', project_ns => $project_ns, commit => $commit, refs => $refs;
175
-        <%= $commit->{title} %><br/>
176
-      <br/>
159
+        % }
177 160
       </div>
178 161
     % }
179 162