diff --git a/pagure/templates/_render_issues.html b/pagure/templates/_render_issues.html index 1b431bd..a7ae946 100644 --- a/pagure/templates/_render_issues.html +++ b/pagure/templates/_render_issues.html @@ -1,14 +1,15 @@ -{% macro render_issue_row(issue, repo, username, subtitle=True) %} +{% macro render_issue_row(issue, repo, username, subtitle=True, class="", showproject=False) %} {% if issue.status == 'Open' %} {% set status_color = "success" %} {% else %} {% set status_color = "danger" %} {% endif %} -
+
-
+
+
#{{issue.id}} @@ -24,8 +25,30 @@ {% endif %}
+
+ + {% if issue.priority is not none %} + {{ repo.priorities[issue.priority | string] }} + {% endif %} + + {% if issue.assignee %} + + + {{ issue.assignee.username | avatar(size=20) | safe}} + + {% endif %} + + {% if issue.user_comments|count > 0 %} + + + {{issue.user_comments|count}} + + {% endif %} + +
+
{% if subtitle %} -
+
Opened {{ issue.date_created | humanize}} by {{ issue.last_updated | humanize}} + {% if showproject %} + + {% if repo.is_fork -%} +   + {%- else -%} +   + {%- endif -%} + {% if repo.is_fork %} + {{ repo.user.user }} / + {% endif %} + {% if repo.namespace %} + {{ repo.namespace }}/ + {% endif %} + {% if repo.is_fork %} + + {% else %} + + {% endif %} + + {{ repo.name }} + + {% endif %}
{% for tag in issue.tags %} @@ -50,26 +107,7 @@ {% endfor %}
{% endif %} -
- - {% if issue.priority is not none %} - {{ repo.priorities[issue.priority | string] }} - {% endif %} - - {% if issue.assignee %} - - - {{ issue.assignee.username | avatar(size=20) | safe}} - - {% endif %} - - {% if issue.user_comments|count > 0 %} - - - {{issue.user_comments|count}} - - {% endif %} - +
{% endmacro%} diff --git a/pagure/templates/user_issues.html b/pagure/templates/user_issues.html deleted file mode 100644 index a8a29f0..0000000 --- a/pagure/templates/user_issues.html +++ /dev/null @@ -1,145 +0,0 @@ -{% extends "master.html" %} - -{% block title %}Issues for {{ username }}{% endblock %} - - -{% block content %} -
-
-

- Issues for {{ username | avatar(20) | safe }} {{ username }} -

-
- - Open - Closed - All - -
-
- - {% for issues in (user.assigned_issues, user.issues) %} - {% set outer_loop = loop %} - {% if outer_loop.index == 1 %} - Assigned Issues - {% else %} - Opened Issues - {% endif %} - - - - - - - - - - - - - - - - - - {% for issue in issues if issue.project.settings.get('issue_tracker', True) %} - - - - - - - - - - - - {% else %} - - - - {% endfor %} - -
#StatusTitleOpenedModifiedPriorityProjectCreated byAssigned to
No issues found
-
- {% endfor %} -
-
- -{% endblock %} - -{% block jscripts %} - {{ super() }} - -{% endblock %} diff --git a/pagure/templates/userprofile_issues.html b/pagure/templates/userprofile_issues.html new file mode 100644 index 0000000..028aa69 --- /dev/null +++ b/pagure/templates/userprofile_issues.html @@ -0,0 +1,87 @@ +{% extends "userprofile_master.html" %} + +{% block title %}Issues for {{ username }}{% endblock %} + +{% from "_render_issues.html" import render_issue_row %} + + +{% block userprofile_content %} +
+
+
+

+ Issues for {{ username | avatar(20) | safe }} {{ username }} +

+
+ + Open + Closed + All + +
+
+
+
Issues Created
+ + issues + +
+ {% for issue in user.issues if issue.project.settings.get('issue_tracker', True) %} + {% if issue.status|lower != "open" %} + {% set hidden = "hidden "%} + {% else %} + {% set hidden = "" %} + {% endif %} + {% set htmlclass = hidden+"loop-index-2 issue-status issue-status-"+issue.status|lower%} + {{render_issue_row(issue, issue.project, username, class=htmlclass, showproject=True)}} + {% endfor %} + +
+
Assigned Issues
+ + issues + +
+ {% for issue in user.assigned_issues if issue.project.settings.get('issue_tracker', True) %} + {% if issue.status|lower != "open" %} + {% set hidden = "hidden "%} + {% else %} + {% set hidden = "" %} + {% endif %} + {% set htmlclass = hidden+"loop-index-1 issue-status issue-status-"+issue.status|lower%} + {{render_issue_row(issue, issue.project, username, class=htmlclass, showproject=True)}} + {% endfor %} +
+
+ +{% endblock %} + +{% block jscripts %} + {{ super() }} + +{% endblock %} diff --git a/pagure/templates/userprofile_master.html b/pagure/templates/userprofile_master.html index 64921f9..a254b56 100644 --- a/pagure/templates/userprofile_master.html +++ b/pagure/templates/userprofile_master.html @@ -95,6 +95,15 @@
+
diff --git a/pagure/ui/app.py b/pagure/ui/app.py index 81a0a70..96ba9f0 100644 --- a/pagure/ui/app.py +++ b/pagure/ui/app.py @@ -910,9 +910,15 @@ def view_user_issues(username): flask.abort(404, "Tickets have been disabled on this pagure instance") user = _get_user(username=username) + userprofile_common = get_userprofile_common(user) return flask.render_template( - "user_issues.html", username=username, user=user + "userprofile_issues.html", + username=username, + user=user, + repos_length=userprofile_common["repos_length"], + forks_length=userprofile_common["forks_length"], + select='issues', )