Showing 1 changed files with 68 additions and 92 deletions
+68 -92
templates/main/compare.html.ep
... ...
@@ -168,115 +168,91 @@
168 168
   
169 169
   %= javascript begin
170 170
     $(document).ready(function () {
171
-      $('.compare_tabs .ccommits').click(function () {
172
-        $('.commits_panel').css('display', 'block');
173
-        $('.files_changed_panel').css('display', 'none');
174
-        $('.compare_tabs .ccommits')
175
-          .css('border', '1px solid #E5E5E5')
176
-          .css('border-bottom', 'none')
177
-          .css('background-color', 'white')
178
-          .css('font-weight', 'bold');
179
-        $('.compare_tabs .cchanged')
180
-          .css('border', 'none')
181
-          .css('border-bottom', '1px solid #E5E5E5')
182
-          .css('background-color', 'transparent')
183
-          .css('font-weight', 'normal');
184
-        
185
-        return false;
186
-      });
187
-      $('.compare_tabs .cchanged').click(function () {
188
-        $('.commits_panel').css('display', 'none');
189
-        $('.files_changed_panel').css('display', 'block');
190
-        $('.compare_tabs .ccommits')
191
-          .css('border', 'none')
192
-          .css('border-bottom', '1px solid #E5E5E5')
193
-          .css('background-color', 'transparent')
194
-          .css('font-weight', 'normal');
195
-        $('.compare_tabs .cchanged')
196
-          .css('border', '1px solid #E5E5E5')
197
-          .css('border-bottom', 'none')
198
-          .css('background-color', 'white')
199
-          .css('font-weight', 'bold');
200
-        
201
-        return false;
171
+      $('#compare-tab a').on('click', function () {
172
+        $(this).tab('show');
202 173
       });
203 174
     });
204 175
   % end
205 176
 
206 177
   %= include '/include/header';
207 178
 
208
-  <div class="main_panel">
209
-    %= include '/include/sub_header';
179
+  <div class="container">
180
+    %= include '/include/project_header';
210 181
     %= include '/include/code_menu', display => 'files';
211 182
     
212 183
     <h2>Compare View</h2>
213
-    <div class="compare_header">
214
-      <div class="cdate">Last commit <%= $commits->[0]{age_string_age} %></div>
215
-      <div class="ctarget"><%= $rev1 %> ... <%= $rev2 %></div>
216
-    </div>
217
-
218
-    <div class="compare_tabs">
219
-      <ul class="ctop">
220
-        <li class="ccommits"><a href="#">Commits</a></li>
221
-        <li class="cchanged"><a href="#files_bucket">Files Changed</a></li>
222
-      </ul>
223
-      <div class="cbottom"></div>
184
+    <div class="row">
185
+      <div class="span8 muted" style="padding-top:9px">
186
+        Last commit <%= $commits->[0]{age_string_age} %>
187
+      </div>
188
+      <div class="span4 text-right">
189
+        <button class="btn"><%= $rev1 %></button>
190
+        ...
191
+        <button class="btn"><%= $rev2 %></button>
192
+      </div>
224 193
     </div>
225 194
     
226
-    <div class="commits_panel">
227
-      <div class="commits_number">
228
-        Showing <%= @$commits %> commits by <%= $authors_count %> author.
229
-      </div>
195
+    <hr style="margin-top:5px">
196
+
197
+    <ul class="nav nav-tabs" id="compare-tab">
198
+      <li class="active"><a href="#commits" data-toggle="tab">Commits</a></li>
199
+      <li><a href="#file-changed" data-toggle="tab">Files Changed</a></li>
200
+    </ul>
230 201
 
231
-      % for my $date (reverse sort keys %$commits_date) {
232
-        <div class="commits">
233
-          % my $commits = $commits_date->{$date};
234
-          
235
-          <div class="cdate"><%= $date %></div>
236
-          % for my $commit (sort {$a->{author_epoch} <=> $b->{author_epoch}} @$commits) {
237
-            <table class="cbody">
238
-              <tr class="crecord">
239
-                <td class="cauthor">
240
-                  <%= $commit->{author_name} %>
241
-                </td>
242
-                <td class="ccomment">
243
-                  <a class="ubar" href="<%= url_for("/$user/$project/commit/$commit->{id}") %>">
244
-                    <%= $commit->{title_short} %>
245
-                  </a>
246
-                </td>
247
-                <td class="cid">
248
-                  <a class="ubar" href="<%= url_for("/$user/$project/commit/$commit->{id}") %>">
249
-                    <%= substr($commit->{id}, 0, 7) %>
250
-                  </a>
251
-                </td>
252
-              </tr>
253
-            </table>
254
-          % }
202
+    <div class="tab-content">
203
+      <div class="tab-pane active" id="commits">
204
+        <div class="commits_number">
205
+          Showing <%= @$commits %> commits by <%= $authors_count %> author.
255 206
         </div>
256
-      % }
257
-    </div>
258 207
 
259
-    <div class="files_changed_panel">
260
-      <div style="margin-top:10px;margin-bottom:10px;">
261
-        <%= include '/include/difftree', id => $end_commit->{id}, from_id => $start_commit->{id},
262
-          difftrees => $difftrees, parents => [], project_ns => $project %>
208
+        % for my $date (reverse sort keys %$commits_date) {
209
+          <div class="commits">
210
+            % my $commits = $commits_date->{$date};
211
+            
212
+            <div class="cdate"><%= $date %></div>
213
+            % for my $commit (sort {$b->{author_epoch} <=> $a->{author_epoch}} @$commits) {
214
+              <table class="cbody">
215
+                <tr class="crecord">
216
+                  <td class="cauthor">
217
+                    <%= $commit->{author_name} %>
218
+                  </td>
219
+                  <td class="ccomment">
220
+                    <a class="ubar" href="<%= url_for("/$user/$project/commit/$commit->{id}") %>">
221
+                      <%= $commit->{title_short} %>
222
+                    </a>
223
+                  </td>
224
+                  <td class="cid">
225
+                    <a class="ubar" href="<%= url_for("/$user/$project/commit/$commit->{id}") %>">
226
+                      <%= substr($commit->{id}, 0, 7) %>
227
+                    </a>
228
+                  </td>
229
+                </tr>
230
+              </table>
231
+            % }
232
+          </div>
233
+        % }
263 234
       </div>
264
-      <div>
265
-        <div class="patchset">
266
-          % for (my $i = 0; $i < @$blobdiffs; $i++) {
267
-            % my $blobdiff = $blobdiffs->[$i];
268
-            <div class="patch" id="<%= $i + 1 %>">
269
-              % my $lines = $blobdiff->{lines};
270
-              % my $file = $blobdiff->{file};
271
-              % my $from_file = $blobdiff->{from_file};
272
-              % $from_file = $file unless defined $from_file;
273
-              % my $status = $blobdiff->{status};
274
-              %= include '/include/blobdiff_body', file => $file, from_file => $from_file, status => $status, lines => $blobdiff->{lines}, project_ns => $project, from_id => $start_commit->{id}, id => $end_commit->{id};
275
-            </div>
276
-          % }
235
+      <div class="tab-pane" id="file-changed">
236
+        <div style="margin-top:10px;margin-bottom:10px;">
237
+          <%= include '/include/difftree', id => $end_commit->{id}, from_id => $start_commit->{id},
238
+            difftrees => $difftrees, parents => [], project_ns => $project %>
239
+        </div>
240
+        <div>
241
+          <div>
242
+            % for (my $i = 0; $i < @$blobdiffs; $i++) {
243
+              % my $blobdiff = $blobdiffs->[$i];
244
+              <div class="patch" id="<%= $i + 1 %>">
245
+                % my $lines = $blobdiff->{lines};
246
+                % my $file = $blobdiff->{file};
247
+                % my $from_file = $blobdiff->{from_file};
248
+                % $from_file = $file unless defined $from_file;
249
+                % my $status = $blobdiff->{status};
250
+                %= include '/include/blobdiff_body', file => $file, from_file => $from_file, status => $status, lines => $blobdiff->{lines}, project_ns => $project, from_id => $start_commit->{id}, id => $end_commit->{id};
251
+              </div>
252
+            % }
253
+          </div>
277 254
         </div>
278 255
       </div>
279 256
     </div>
280 257
   </div>
281
-  
282 258
   %= include '/include/footer';