Showing 5 changed files with 80 additions and 4 deletions
+4
lib/Gitprep.pm
... ...
@@ -318,6 +318,9 @@ sub startup {
318 318
             
319 319
             # Home
320 320
             $r->get('/' => sub { shift->render_maybe('/tree') });
321
+
322
+            # Tags
323
+            $r->get('/pulls' => sub { shift->render_maybe('/pulls') })->to(tab => 'pulls');
321 324
             
322 325
             # Commit
323 326
             $r->get('/commit/*diff' => sub { shift->render_maybe('/commit') });
... ...
@@ -352,6 +355,7 @@ sub startup {
352 355
             $r->get('/archive/(*rev).zip' => sub { shift->render_maybe('/archive') })->to(archive_type => 'zip' );
353 356
             
354 357
             # Compare
358
+            $r->get('/compare' => sub { shift->render_maybe('/compare') });
355 359
             $r->get('/compare/(*rev1)...(*rev2)' => sub { shift->render_maybe('/compare') });
356 360
             
357 361
             # Settings
+23 -3
public/css/common.css
... ...
@@ -35,6 +35,27 @@
35 35
   box-sizing: border-box;
36 36
 }
37 37
 
38
+.pulls-button-container {
39
+  text-align:right;
40
+  margin-bottom:10px;
41
+}
42
+.pulls-header {
43
+  border:1px solid #d8d8d8;
44
+  background:#fafafa;
45
+  padding:10px;
46
+}
47
+.pulls-body {
48
+  border:1px solid #d8d8d8;
49
+  border-top:none;
50
+  background:#fafafa;
51
+  text-align:center;
52
+}
53
+.pulls-no-request {
54
+  padding:30px;
55
+  margin:1px auto;
56
+  width:600px;
57
+}
58
+
38 59
 .text-gray { color:#767676 }
39 60
 
40 61
 input[type=text], input[type=password] {
... ...
@@ -83,7 +104,6 @@ input[type=text], input[type=password] {
83 104
 .project-tabs li {
84 105
   display:block;
85 106
   float:left;
86
-  width:90px;
87 107
   margin-bottom:0px;
88 108
 }
89 109
 
... ...
@@ -99,13 +119,13 @@ input[type=text], input[type=password] {
99 119
   display:block;
100 120
   width:100%;
101 121
   text-decoration:none;
102
-  padding:8px 0px 7px 0px;
122
+  padding:8px 11px 7px 11px;
103 123
   text-align:center;
104 124
   color:#565656;
105 125
 }
106 126
 
107 127
 .project-tabs li.active a {
108
-  padding:5px 0px 7px 0px;
128
+  padding:5px 11px 7px 11px;
109 129
 }
110 130
 
111 131
 .admin-users {
+1 -1
templates/compare.html.ep
... ...
@@ -46,7 +46,7 @@
46 46
   stash rev => $end_commit->{id};
47 47
   stash from_rev => $start_commit->{id};
48 48
 
49
-  layout 'common', title => "Comparing $rev1...$rev2 \x{30fb} $user/$project";
49
+  layout 'common', title => "Comparing $from_rev...$rev \x{30fb} $user/$project";
50 50
 %>
51 51
 
52 52
 
+6
templates/include/header.html.ep
... ...
@@ -113,6 +113,12 @@
113 113
                   Code
114 114
                 </a>
115 115
               </li>
116
+              <li class="<%= $tab eq 'pulls' ? 'active' :  '' %>">
117
+                <a href="<%= url_for("/$user/$project/pulls") %>">
118
+                  <i class="icon-retweet"></i>
119
+                  Pull request
120
+                </a>
121
+              </li>
116 122
               <li class="<%= $tab eq 'graph' ? 'active' :  '' %>">
117 123
                 <a href="<%= url_for("/$user/$project/network") %>" >
118 124
                   <i class="icon-align-center"></i>
+46
templates/pulls.html.ep
... ...
@@ -0,0 +1,46 @@
1
+<%
2
+  # API
3
+  my $api = Gitprep::API->new($self);
4
+
5
+  # Parameters
6
+  my $user = param('user');
7
+  my $project = param('project');
8
+  my $page = param('page') || 1;
9
+  
10
+  # Git
11
+  my $git = $self->app->git;
12
+  
13
+  # Ref names
14
+  my $limit = app->config->{basic}{tags_limit};
15
+  my $page_count = 20;
16
+  my $tags = $git->tags(
17
+    $user,
18
+    $project,
19
+    $limit,
20
+    $page_count,
21
+    $page_count * ($page - 1)
22
+  );
23
+  my $tags_count = $git->tags_count($user, $project);
24
+%>
25
+
26
+% layout 'common', title => "Tags \x{30fb} $user/$project";
27
+  
28
+  %= include '/include/header';
29
+  
30
+  <div class="container">
31
+    <div class="pulls-button-container">
32
+      <a href="<%= url_for("/$user/$project/compare") %>" class="btn btn-success">New pull request</a>
33
+    </div>
34
+    <div class="pulls">
35
+      <div class="pulls-header">
36
+        Open Close
37
+      </div>
38
+      <div class="pulls-body">
39
+        <div class="pulls-no-request">
40
+          <div style="font-size:18px"><b>There aren’t any open pull requests.</b></div>
41
+        </div>
42
+      </div>
43
+    </div>
44
+  </div>
45
+  
46
+  %= include '/include/footer';