Berker Peksag added the comment:

I'm not sure I explained myself clearly so here is a quick and dirty patch, 
including a screenshot: https://dl.dropboxusercontent.com/u/166024/gh-pr.png 
Since I don't have meaningful data I chose Django as an example.

_______________________________________________________
PSF Meta Tracker <metatrac...@psf.upfronthosting.co.za>
<http://psf.upfronthosting.co.za/roundup/meta/issue586>
_______________________________________________________
diff --git a/html/issue.item.html b/html/issue.item.html
--- a/html/issue.item.html
+++ b/html/issue.item.html
@@ -10,16 +10,35 @@
 /></tal:block>
 </title>
 
 <metal:slot fill-slot="more-javascript">
 <script type="text/javascript" 
src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js";></script>
 <script type="text/javascript" 
src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.js";></script>
 <script type="text/javascript" src="@@file/issue.item.js"></script>
 <link rel="stylesheet" type="text/css"  
href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/smoothness/jquery-ui.css";
 />
+<script type="text/javascript">
+    $(function() {
+        var issueId = 'Fixed #' + $('#list-pull-requests').data('issue-id');
+        var baseURL = 'https://api.github.com/repos/django/django/pulls';
+        function getPullRequests() {
+            $.getJSON(baseURL, function(rawdata) {
+                var pullRequests = [];
+                $.each(rawdata, function(index, names) {
+                    // TODO: this should use a proper regex
+                    if (names.title.search(issueId) !== -1) {
+                        pullRequests.push('<a href="' + names.html_url + '" 
title="' + names.title + '">#' + names.number + '</a>');
+                    }
+                });
+                $("#list-pull-requests").html(pullRequests.join(", "));
+            });
+        }
+        getPullRequests();
+    });
+</script>
 </metal:slot>
 
 <tal:block metal:fill-slot="body_title">
  <span tal:condition="python: not (context.id or context.is_edit_ok())"
   tal:omit-tag="python:1" i18n:translate="">New Issue</span>
  <span tal:condition="python: not context.id and context.is_edit_ok()"
   tal:omit-tag="python:1" i18n:translate="">New Issue Editing</span>
  <span tal:condition="python: context.id and not context.is_edit_ok()"
@@ -215,16 +234,25 @@
  <th><a 
href="http://docs.python.org/devguide/triaging.html#mercurial-repository";
       target="_blank" i18n:translate="">Remote hg repo</a>:</th>
  <td colspan="3">
   <input type="hidden" name="@link@hgrepos" value="hgrepo-1">
    <input name="hgrepo-1@url" size="50">
  </td>
 </tr>
 
+<tr>
+ <th>
+     <a href="http://docs.python.org/devguide/patch.html"; target="_blank">Pull 
requests</a>:
+ </th>
+ <td colspan="3">
+     <span id="list-pull-requests" tal:attributes="data-issue-id 
context/id"></span>
+ </td>
+</tr>
+
 </table>
 </fieldset>
 <table class="form">
 <tr tal:condition="context/is_edit_ok">
  <td>
   &nbsp;
   <input type="hidden" name="@template" value="item">
   <input type="hidden" name="@required" value="title">
_______________________________________________
Tracker-discuss mailing list
Tracker-discuss@python.org
https://mail.python.org/mailman/listinfo/tracker-discuss
Code of Conduct: https://www.python.org/psf/codeofconduct/

Reply via email to