Showing 4 changed files with 102 additions and 8 deletions
+3
lib/Gitprep.pm
... ...
@@ -434,6 +434,9 @@ sub startup {
434 434
             # New issue
435 435
             $r->any('/issues/new' => sub { shift->render_maybe('/issues/new') })->to(tab => 'issues');
436 436
             $r->any('/issues/:number' => sub { shift->render_maybe('/issue') })->to(tab => 'issues');
437
+
438
+            # Labels
439
+            $r->get('/labels' => sub { shift->render_maybe('/labels') })->to(tab => 'issues');
437 440
             
438 441
             # Pull requests
439 442
             $r->get('/pulls' => sub { shift->render_maybe('/pulls') })->to(tab => 'pulls');
+68
public/css/common.css
... ...
@@ -35,6 +35,74 @@
35 35
   box-sizing: border-box;
36 36
 }
37 37
 
38
+.issues-title a {
39
+  color:black;
40
+}
41
+.issues-title a:hover {
42
+  color:blue;
43
+}
44
+
45
+.issues-button-container {
46
+  margin-bottom:10px;
47
+  overflow:hidden;
48
+}
49
+.issues-button-container-left {
50
+  float:left;
51
+  width:50%;
52
+}
53
+.issues-button-container-right {
54
+  text-align:right;
55
+  float:left;
56
+  width:50%;
57
+}
58
+.issues-labels {
59
+  border:1px solid #d8d8d8;
60
+  border-radius:3px;
61
+  display:inline-block;
62
+}
63
+.issues-labels a {
64
+  padding:5px 10px;
65
+  display:inline-block;
66
+  width:100%;
67
+}
68
+.issues-labels a {
69
+  color:inherit;
70
+}
71
+.issues-labels a:hover {
72
+  color:inherit;
73
+  text-decoration:none;
74
+  background:#eeeeee
75
+}
76
+
77
+.issues-header {
78
+  border:1px solid #d8d8d8;
79
+  background:#fafafa;
80
+  padding:10px;
81
+}
82
+.issues-body {
83
+  border:1px solid #d8d8d8;
84
+  border-top:none;
85
+  background:#fafafa;
86
+  background:white;
87
+}
88
+.issues-body li {
89
+  padding:10px;
90
+  border-top: 1px solid #d8d8d8;
91
+}
92
+.issues-body li:first-child {
93
+  border-top:none;
94
+}
95
+.issues-no-request {
96
+  padding:30px;
97
+  margin:1px auto;
98
+  width:600px;
99
+  text-align:center;
100
+}
101
+
102
+.issues-description {
103
+  color:#767676;
104
+}
105
+
38 106
 .issue-add-comment-title {
39 107
   margin-bottom:5px;
40 108
 }
+13 -8
templates/issues.html.ep
... ...
@@ -49,11 +49,16 @@
49 49
   %= include '/include/header';
50 50
   
51 51
   <div class="container">
52
-    <div class="pulls-button-container">
53
-      <a href="<%= url_for("/$user_id/$project_id/issues/new") %>" class="btn btn-success">New issue</a>
52
+    <div class="issues-button-container">
53
+      <div class="issues-button-container-left">
54
+        <div class="issues-labels"><a href="<%= url_for("/$user_id/$project_id/labels") %>">Labels</a></div>
55
+      </div>
56
+      <div class="issues-button-container-right">
57
+        <a href="<%= url_for("/$user_id/$project_id/issues/new") %>" class="btn btn-success">New issue</a>
58
+      </div>
54 59
     </div>
55
-    <div class="pulls">
56
-      <div class="pulls-header">
60
+    <div class="issues">
61
+      <div class="issues-header">
57 62
         % if ($open) {
58 63
           <b><%= $open_count %> Open</b>
59 64
           <a href="<%= url_with->query([is => 'closed']) %>" style="margin-left:5px;color:#767676"><%= "\x{2714}" %><%= $close_count %> Closed</a>
... ...
@@ -64,7 +69,7 @@
64 69
           </b>
65 70
         % }
66 71
       </div>
67
-      <div class="pulls-body">
72
+      <div class="issues-body">
68 73
         % if (@$issues) {
69 74
           <ul>
70 75
             % for my $issue (@$issues) {
... ...
@@ -74,12 +79,12 @@
74 79
                 my $open_time_age_string = $self->app->git->_age_string($open_time_age);
75 80
               %>
76 81
               <li>
77
-                <div class="pulls-title">
82
+                <div class="issues-title">
78 83
                   <a href="<%= "/$user_id/$project_id/issues/$issue->{number}" %>">
79 84
                     <b><%= $issue->{title} %></b>
80 85
                   </a>
81 86
                 </div>
82
-                <div class="pulls-description">
87
+                <div class="issues-description">
83 88
                   #<%= $issue->{number} %> <%= $issue->{open} ? 'opened' : 'closed' %>
84 89
                   <%= $open_time_age_string %>
85 90
                   by <%= $issue->{'open_user.id'} %>
... ...
@@ -88,7 +93,7 @@
88 93
             % }
89 94
           </ul>
90 95
         % } else {
91
-          <div class="pulls-no-request">
96
+          <div class="issues-no-request">
92 97
             <div style="font-size:18px"><b>There aren’t any issues.</b></div>
93 98
           </div>
94 99
         % }
+18
templates/labels.html.ep
... ...
@@ -0,0 +1,18 @@
1
+<%
2
+  # API
3
+  my $api = gitprep_api;
4
+  
5
+  # Parameters
6
+  my $user_id = param('user');
7
+  my $project_id = param('project');
8
+  
9
+  layout 'common', title => "Labels - $user_id/$project_id";
10
+%>
11
+
12
+%= include '/include/header';
13
+
14
+<div class="container">
15
+  Labels
16
+</div>
17
+
18
+%= include '/include/footer';