Showing 3 changed files with 91 additions and 45 deletions
+58
public/css/bootstrap.css
... ...
@@ -2320,3 +2320,61 @@ button.close {
2320 2320
   border-top-right-radius:4px;
2321 2321
   border-bottom-right-radius:4px;
2322 2322
 }
2323
+
2324
+/* Branches */
2325
+.branches {
2326
+  overflow:hidden;
2327
+  margin-bottom:15px;
2328
+}
2329
+.branches > li {
2330
+  border:1px solid #d8d8d8;
2331
+  border-top:none;
2332
+  padding:5px 8px;
2333
+}
2334
+.branches > li:first-child {
2335
+  border-radius: 3px 3px 0 0;
2336
+  border-top:1px solid #d8d8d8;
2337
+  background: #f5f5f5;
2338
+  text-shadow: 0 1px 0 #fff;
2339
+}
2340
+.branches > li:last-child {
2341
+  border-radius: 0 0 3px 3px;
2342
+}
2343
+.branches > li > ul {
2344
+  overflow:hidden;
2345
+}
2346
+.branches > li > ul > li:first-child {
2347
+  float:left;
2348
+  width:50%;
2349
+  overflow:hidden;
2350
+  padding-top:16px;
2351
+}
2352
+.branches > li > ul > li.second-child{
2353
+  float:left;
2354
+  width:25%;
2355
+}
2356
+.branches > li > ul > li.last-child {
2357
+  float:left;
2358
+  width:25%;
2359
+  text-align:right;
2360
+  padding-top:13px;
2361
+}
2362
+
2363
+.branches-name {
2364
+  display:inline-block;
2365
+}
2366
+.branches-name a {
2367
+  color: #4078c0;
2368
+  border-radius:3px;
2369
+  background:rgba(209,227,237,0.5);
2370
+  padding:2px 6px;
2371
+}
2372
+
2373
+.branches-age {
2374
+  display:inline-block;
2375
+}
2376
+
2377
+.branches-author {
2378
+  display:inline-block;
2379
+}
2380
+
+32 -44
templates/branches.html.ep
... ...
@@ -131,44 +131,41 @@
131 131
     % for my $branch_type (@$branch_types) {
132 132
       % my $branches = $branches_h->{$branch_type};
133 133
       % if (@$branches) {
134
-        <div>
135
-          % if ($branch_type eq 'default') {
136
-            Default branch
137
-          % } elsif ($branch_type eq 'active') {
138
-            Active branch
139
-          % } elsif ($branch_type eq 'stale') {
140
-            Stale branch
141
-          % } elsif ($branch_type eq 'all') {
142
-            All branches
143
-          % }
144
-        </div>
145
-        <ul>
134
+        <ul class="branches">
135
+          <li>
136
+            % if ($branch_type eq 'default') {
137
+              Default branch
138
+            % } elsif ($branch_type eq 'active') {
139
+              Active branch
140
+            % } elsif ($branch_type eq 'stale') {
141
+              Stale branch
142
+            % } elsif ($branch_type eq 'all') {
143
+              All branches
144
+            % }
145
+          </li>
146 146
           % for (my $i = 0; $i < @$branches; $i++) {
147 147
             % my $branch = $branches->[$i];
148 148
             % my $bname = $branch->{name};
149 149
             <li>
150
-              <div class="row">
151
-                <div class="span5" style="line-height:1.2em">
152
-                  <div style="font-size:16px;">
150
+              <ul>
151
+                <li>
152
+                  <div class="branches-name">
153 153
                     <a href="<%= url_for("/$user/$project/tree/$bname") %>">
154
-                      <b><%= $bname %></b>
154
+                      <%= $bname %>
155 155
                     </a>
156 156
                   </div>
157
-                  <div style="font-size:12px">
158
-                    Updated
159
-                    <span title="<%= $branch->{commit}{age_string_datetime_local} %>">
160
-                      <%= $branch->{commit}{age_string} %>
161
-                    </span>
162
-                    by
163
-                    <span title="<%= $branch->{commit}{author_email} %>">
164
-                      <%= $branch->{commit}{author_name} %>
165
-                    </span>
157
+                  <div class="branches-age" title="<%= $branch->{commit}{age_string_datetime_local} %>">
158
+                    Updated <%= $branch->{commit}{age_string} %> by
159
+                  </div>
160
+                  <div class="branches-author"  title="<%= $branch->{commit}{author_email} %>">
161
+                    <%= $branch->{commit}{author_name} %>
166 162
                   </div>
167
-                </div>
168
-                <div class="span3 muted" style="line-height:1em;font-size:11px">
163
+                </li>
164
+                <li class="second-child">
169 165
                   <table>
170 166
                     <tr>
171 167
                       <td>
168
+                        <%= $branch->{status}{behind} %> behind
172 169
                       </td>
173 170
                       <td style="background:#333">
174 171
                       </td>
... ...
@@ -186,34 +183,25 @@
186 183
                         <div style="background:#b2d0dd;width:<%= $max != 0 ? 100 * ($branch->{status}{ahead} / $max) : 0 %>%;height:8px"></div>
187 184
                       </td>
188 185
                     </tr>
189
-                    <tr>
190
-                      <td>
191
-                        <%= $branch->{status}{behind} %> behind
192
-                      </td>
193
-                      <td style="background:#333">
194
-                      </td>
195
-                      <td>
196
-                      </td>
197
-                    </tr>
198 186
                   </table>
199
-                </div>
200
-                <div class="span4 text-right" style="padding-top:0px">
187
+                </li>
188
+                <li class="last-child">
189
+                  <a class="btn btn-small" href="<%= url_for("/$user/$project/compare/$default_branch->{name}...$bname") %>">
190
+                    Compare
191
+                  </a>
201 192
                   % if ($api->logined($user)) {
202 193
                     <form action="<%= url_for->query(op => 'delete') %>" method="post" style="display:inline-block">
203
-                      <input type="submit" class="btn delete-branch" style="color:#900;" value="Delete branch">
194
+                      <input type="submit" class="btn btn-small delete-branch" style="color:#900;" value="Delete">
204 195
                       %= hidden_field branch => $bname;
205 196
                     </form>
206 197
                   % }
207
-                  <a class="btn" href="<%= url_for("/$user/$project/compare/$default_branch->{name}...$bname") %>">
208
-                    Compare
209
-                  </a>
210 198
                   % if (app->config->{basic}{show_ignore_space_change_link}) {
211 199
                     (<a style="font-size:90%;color:#9999FF" href="<%= url_for("/$user/$project/compare/$default_branch->{name}...$bname?w=") %>">
212 200
                       ignore space
213 201
                     </a>)
214 202
                   % }
215
-                </div>
216
-              </div>
203
+                </li>
204
+              </ul>
217 205
             </li>
218 206
           % }
219 207
         </ul>
+1 -1
xt/user.t
... ...
@@ -452,7 +452,7 @@ note 'Delete branch';
452 452
   my $cmd = "git --git-dir=$rep_home/kimoto1/t2.git branch tmp_branch";
453 453
   system($cmd) == 0 or die "Can't execute git branch";
454 454
   $t->get_ok("/kimoto1/t2/branches");
455
-  $t->content_like(qr/Delete branch/);
455
+  $t->content_like(qr/Delete/);
456 456
   $t->content_like(qr/tmp_branch/);
457 457
   
458 458
   # Delete branch