Showing 2 changed files with 18 additions and 6 deletions
+13 -5
templates/branches.html.ep
... ...
@@ -238,6 +238,14 @@
238 238
                     target_branch => $branch_name
239 239
                   }
240 240
                 )->one;
241
+                
242
+                my $issue;
243
+                if ($pull_request) {
244
+                  $issue = app->dbi->model('issue')->select(
245
+                    where => {pull_request => $pull_request->{row_id}}
246
+                  )->one;
247
+                }
248
+                
241 249
               %>
242 250
               % if ($display eq 'overview' && $i > 4) {
243 251
                 <li class="branches-overview-more">
... ...
@@ -307,13 +315,13 @@
307 315
                       % } else {
308 316
                         % if ($api->logined) {
309 317
                           % if ($pull_request) {
310
-                            % if ($pull_request->{open}) {
311
-                              #<%= $pull_request->{row_id} %>
312
-                              <a class="branches-open" href="<%= url_for("/$user/$project/pull/$pull_request->{row_id}") %>">
318
+                            % if ($issue->{open}) {
319
+                              #<%= $issue->{row_id} %>
320
+                              <a class="branches-open" href="<%= url_for("/$user/$project/pull/$issue->{row_id}") %>">
313 321
                                 open
314 322
                               </a>
315 323
                             % } else {
316
-                              <a class="branches-close" href="<%= url_for("/$user/$project/pull/$pull_request->{row_id}") %>">
324
+                              <a class="branches-close" href="<%= url_for("/$user/$project/pull/$issue->{row_id}") %>">
317 325
                                 closed
318 326
                               </a>
319 327
                             % }
... ...
@@ -350,7 +358,7 @@
350 358
                           </a>
351 359
                         % }
352 360
                         % if ($api->logined($user_id)) {
353
-                          % if ($pull_request && $pull_request->{open}) {
361
+                          % if ($pull_request && $issue->{open}) {
354 362
                             <button class="btn btn-small disabled delete-branch"value="Delete">Delete</button>
355 363
                           % } else {
356 364
                             <form action="<%= url_for->query(op => 'delete') %>" method="post" style="display:inline-block">
+5 -1
templates/compare.html.ep
... ...
@@ -86,8 +86,12 @@
86 86
           }
87 87
         )->one;
88 88
         
89
+        my $issue;
89 90
         if ($pull_request) {
90
-          $self->redirect_to("/$base_user_id/$base_project_id/pull/$pull_request->{row_id}");
91
+          $issue = app->dbi->model('issue')->select(
92
+            where => {pull_request => $pull_request->{row_id}}
93
+          )->one;
94
+          $self->redirect_to("/$base_user_id/$base_project_id/pull/$issue->{row_id}");
91 95
           return;
92 96
         }
93 97
         else {