Learn more about these different git repos.
Other Git URLs
I would like to add a button to assign PRs to myself in pagure however I am having an issue getting the javascript to work correctly using the repo_pull_request.html template.
Here is a diff of the changes I've made so far.
--- repo_pull_request.html.orig 2018-11-29 11:05:35.383051006 -0500 +++ repo_pull_request.html.new 2018-11-28 11:25:29.175634791 -0500 @@ -484,7 +484,14 @@ {% if pull_request.assignee.username %} <div class="mt-1">{{pull_request.assignee.username| avatar(size=24) | safe}} {{ pull_request.assignee.username }}</div> {% else %} - <span class="text-muted">None</span> + <div class="text-muted"> + <span class="text-muted">None</span> + {% if g.authenticated and (g.repo_user or g.fas_user.username == pull_request.user.user or open_access) and pull_request.status|lower == 'open' + and (not pull_request.assignee or pull_request.assignee.username != g.fas_user.username) + and not repo.settings.get('pull_request_tracker_read_only', False) %} + — <a href="javascript:void(0)" id="take-btn" title="assign this pull_request to you"> Take </a> + {% endif %} + </div> {% endif %} </div> </fieldset>
After making these changes I see the link in pagure but clicking on it does nothing. Attached is a screenshot for reference.
<img alt="Screenshot_from_2018-11-29_11-25-14.png" src="/pagure/issue/raw/files/221d96f2bfbaf03d4f754ed85233697f74b3b4baa400924bf799a8c5736d6e44-Screenshot_from_2018-11-29_11-25-14.png" />
Metadata Update from @pingou: - Issue tagged with: RFE
You'll also need the piece of javascript code that execute the action (calls the API endpoint to assign the PR to yourself)
Metadata Update from @pingou: - Issue set to the milestone: 5.4
Metadata Update from @pingou: - Issue assigned to pingou
Commit 627fb17 fixes this issue
Log in to comment on this ticket.