Showing 1 changed files with 17 additions and 2 deletions
+17 -2
templates/branches.html.ep
... ...
@@ -80,6 +80,21 @@
80 80
     $max = $branch->{status}{ahead} if $max < $branch->{status}{ahead};
81 81
     $max = $branch->{status}{behind} if $max < $branch->{status}{behind};
82 82
     
83
+    if ($branch->{status}{ahead} > 100) {
84
+      $branch->{status}{ahead_bar} = 100;
85
+    }
86
+    else {
87
+      $branch->{status}{ahead_bar} = $branch->{status}{ahead};
88
+    }
89
+    if ($branch->{status}{behind} > 100) {
90
+      $branch->{status}{behind_bar} = 100;
91
+    }
92
+    else {
93
+      $branch->{status}{behind_bar} = $branch->{status}{behind};
94
+    }
95
+    
96
+    $max = 100 if $max > 100;
97
+    
83 98
     my $branch_type;
84 99
     if ($branch->{name} eq $default_branch_name) {
85 100
       $branch_type = 'default';
... ...
@@ -235,12 +250,12 @@
235 250
                           </tr>
236 251
                           <tr>
237 252
                             <td style="width:100px">
238
-                              <div style="margin-left:auto;margin-right:0;background:#dcdcdc;width:<%= $max != 0 ? 100 * ($branch->{status}{behind} / $max) : 0 %>%;height:4px"></div>
253
+                              <div style="margin-left:auto;margin-right:0;background:#dcdcdc;width:<%= $branch->{status}{behind_bar} %>%;height:4px"></div>
239 254
                             </td>
240 255
                             <td class="ahead-behind-separate">
241 256
                             </td>
242 257
                             <td style="width:100px">
243
-                              <div style="background:#dcdcdc;width:<%= $max != 0 ? 100 * ($branch->{status}{ahead} / $max) : 0 %>%;height:4px"></div>
258
+                              <div style="background:#dcdcdc;width:<%= $branch->{status}{ahead_bar} %>%;height:4px"></div>
244 259
                             </td>
245 260
                           </tr>
246 261
                         </table>