diff --git a/pagure/templates/issue.html b/pagure/templates/issue.html
index 0505dea..f6d2f90 100644
--- a/pagure/templates/issue.html
+++ b/pagure/templates/issue.html
@@ -147,8 +147,12 @@
{% else %}
unassigned
{% endif %}
- {% if authenticated and repo_admin %}
-
+ {% if authenticated and repo_admin
+ and (not issue.assignee or issue.assignee.username != g.fas_user.username) %}
+
{% endif %}
@@ -615,6 +619,25 @@ $( document ).ready(function() {
}
);
+ {% if authenticated and repo_admin %}
+ $("#take-btn").click(function(){
+ var _url = "{{ url_for(
+ 'api_ns.api_assign_issue', repo=repo.name, username=username, issueid=issueid
+ ) }}";
+ var _data = {assignee: "{{ g.fas_user.username }}"};
+ $.post( _url, _data ).done(
+ function(data) {
+ var _user_url = '\n'
+ + '{{ g.fas_user.username }}';
+ $('#assignee_plain').html(_user_url);
+ $('#assignee').val("{{ g.fas_user.username }}");
+ }
+ )
+ return false;
+ });
+ {% endif %}
+
});
{% endblock %}