Showing 1 changed files with 38 additions and 4 deletions
+38 -4
templates/compare.html.ep
... ...
@@ -51,6 +51,10 @@
51 51
     $difftrees
52 52
   );
53 53
   
54
+  # Branches
55
+  my $branches = $git->branches($user, $project);
56
+  @$branches = sort { $a->{commit}{age} <=> $b->{commit}{age} } @$branches;
57
+  
54 58
   # Global variable
55 59
   stash(user => $user, project => $project);
56 60
 %>
... ...
@@ -75,17 +79,47 @@
75 79
     <div class="well" style="padding:9px 10px 9px 10px;margin-bottom:5px">
76 80
       <div class="row">
77 81
         <div class="span3">
78
-          <div class="radius" style="display:inline-block;background:#add8e6;padding:2px 12px;margin-right:5px"><%= $rev1 %></div>
82
+          <button class="btn" style="padding:2px 10px">
83
+            <%= $rev1 %>
84
+          </button>
79 85
           ...
80
-          <div class="radius" style="display:inline-block;background:#add8e6;padding:2px 12px;margin-left:5px"><%= $rev2 %></div>
86
+          <button class="btn" style="padding:2px 10px">
87
+            <%= $rev2 %>
88
+          </button>
81 89
         </div>
82
-        <!--
83 90
         <div class="text-right">
84 91
           <button class="btn" style="padding:2px 10px">Edit</button>
85 92
         </div>
86
-        -->
87 93
       </div>
88 94
     </div>
95
+    <div id="base-branch-select" style="width:330px">
96
+      <div class="radius-top border-gray" style="background:#E6E6FA;padding:10px">
97
+        <div class="row">
98
+          <div class="span3">
99
+            <b>Choose a base branch</b>
100
+          </div>
101
+          <div class="text-right">
102
+            <i class="icon-remove-circle"></i>
103
+          </div>
104
+        </div>
105
+      </div>
106
+      <div class="border-gray" style="background:#F5F5F5;border-top:none;border-bottom:none;text-align:center;padding:10px 0">
107
+        %= text_field 'base-branch', style => 'margin-bottom:0;width:270px', placeholder => 'Branch, tag, commit, or history marker';
108
+      </div>
109
+      <div style="max-height:500px;overflow:auto;">
110
+      <ul class="nav nav-tabs nav-stacked">
111
+        % for (my $i = 0; $i < @$branches; $i++) {
112
+          % my $branch = $branches->[$i];
113
+            <li>
114
+              <a style="border-top-left-radius:0px;border-top-right-radius:0px;" href="<%= url_for("/$user/$project/compare/$branch->{name}...$rev2") %>">
115
+                <%= $branch->{name} %>
116
+              </a>
117
+            </li>
118
+        % }
119
+      </ul>
120
+      </div>
121
+    </div>
122
+    
89 123
     <div style="margin-bottom:20px">From here you can compare two points in history. You can even compare tag names and commits.</div>
90 124
     
91 125
     <hr style="margin-top:5px">