From 00d2b596b0018d114daa97c9db237c376ffd11db Mon Sep 17 00:00:00 2001
From: Ryan Lerch <rlerch@redhat.com>
Date: Sep 10 2018 03:59:24 +0000
Subject: [PATCH 1/3] add milestone to metadata shown on issue listing


Fixes #3620

---

diff --git a/pagure/templates/_render_issues.html b/pagure/templates/_render_issues.html
index a44a90a..e24dcda 100644
--- a/pagure/templates/_render_issues.html
+++ b/pagure/templates/_render_issues.html
@@ -27,19 +27,24 @@
                 </div>
                 <div class="ml-auto nowrap">
                     <span class="font-weight-bold text-muted ml-auto">
+                    
+                    {% if issue.milestone %}
+                    <span title="milestone {{issue.milestone}}" class="ml-2" data-toggle="tooltip"><i class="fa fa-fw fa-map-signs pr-2"></i>{{ issue.milestone }}</span>
+                    {% endif %}
+                    
                     {% if issue.priority is not none  %}
-                    <span title="Priority" class="mr-3" data-toggle="tooltip"><i class="fa fa-fw fa-bolt"></i>{{ repo.priorities[issue.priority | string] }}</span>
+                    <span title="Priority" class="ml-2" data-toggle="tooltip"><i class="fa fa-fw fa-bolt pr-2"></i>{{ repo.priorities[issue.priority | string] }}</span>
                     {% endif %}
 
                     {% if issue.assignee %}
-                    <span class="mr-3" title="Assigned to {{ issue.assignee.username}}" data-toggle="tooltip">
+                    <span class="ml-2" title="Assigned to {{ issue.assignee.username}}" data-toggle="tooltip">
                         <i class="fa fa-fw fa-user-plus pr-2"></i>
                         {{ issue.assignee.username | avatar(size=20) | safe}}
                     </span>
                     {% endif %}
 
                     {% if issue.user_comments|count > 0 %}
-                    <span title="{{issue.user_comments|count}} comments" class="text-muted" data-toggle="tooltip">
+                    <span title="{{issue.user_comments|count}} comments" class="text-muted ml-2" data-toggle="tooltip">
                     <span class="fa fa-fw fa-comment pr-2"></span>
                         {{issue.user_comments|count}}
                     </span>

From 1439b534681a9f698a79aea4c739b76fcde60fc2 Mon Sep 17 00:00:00 2001
From: Ryan Lerch <rlerch@redhat.com>
Date: Sep 10 2018 04:53:05 +0000
Subject: [PATCH 2/3] add quicklinks to metadata on issues list to filter on that item


Fixes #3624

---

diff --git a/pagure/templates/_render_issues.html b/pagure/templates/_render_issues.html
index e24dcda..109660d 100644
--- a/pagure/templates/_render_issues.html
+++ b/pagure/templates/_render_issues.html
@@ -1,4 +1,4 @@
-{% macro render_issue_row(issue, repo, username, subtitle=True, class="", showproject=False) %}
+{% macro render_issue_row(issue, repo, username, subtitle=True, class="", showproject=False, filterstatus=None) %}
     {% if issue.status == 'Open' %}
         {% set status_color = "success" %}
     {% else %}
@@ -29,17 +29,56 @@
                     <span class="font-weight-bold text-muted ml-auto">
                     
                     {% if issue.milestone %}
-                    <span title="milestone {{issue.milestone}}" class="ml-2" data-toggle="tooltip"><i class="fa fa-fw fa-map-signs pr-2"></i>{{ issue.milestone }}</span>
+                    <span title="milestone {{issue.milestone}}" class="ml-2" data-toggle="tooltip">
+                        <i class="fa fa-fw fa-map-signs pr-2"></i>
+                        {% if filterstatus %}
+                        <a href="{{ url_for('ui_ns.view_issues',
+                          repo=repo.name,
+                          username=username,
+                          namespace=repo.namespace,
+                          status=filterstatus,
+                          milestone=issue.milestone) }}" class="notblue">
+                        {% endif %}
+                        {{ issue.milestone }}
+                        {% if filterstatus %}
+                        </a>
+                        {% endif %}
+                    </span>
                     {% endif %}
                     
                     {% if issue.priority is not none  %}
-                    <span title="Priority" class="ml-2" data-toggle="tooltip"><i class="fa fa-fw fa-bolt pr-2"></i>{{ repo.priorities[issue.priority | string] }}</span>
+                    <span title="Priority" class="ml-2" data-toggle="tooltip">
+                        <i class="fa fa-fw fa-bolt"></i>
+                        {% if filterstatus %}
+                        <a href="{{ url_for('ui_ns.view_issues',
+                          repo=repo.name,
+                          username=username,
+                          namespace=repo.namespace,
+                          status=filterstatus,
+                          priority=issue.priority) }}" class="notblue">
+                        {% endif %}
+                        {{ repo.priorities[issue.priority | string] }}
+                        {% if filterstatus %}
+                        </a>
+                        {% endif %}
+                    </span>
                     {% endif %}
 
                     {% if issue.assignee %}
                     <span class="ml-2" title="Assigned to {{ issue.assignee.username}}" data-toggle="tooltip">
                         <i class="fa fa-fw fa-user-plus pr-2"></i>
+                        {% if filterstatus %}
+                        <a href="{{ url_for('ui_ns.view_issues',
+                          repo=repo.name,
+                          username=username,
+                          namespace=repo.namespace,
+                          status=filterstatus,
+                          assignee=issue.assignee.username) }}" class="notblue">
+                        {% endif %}
                         {{ issue.assignee.username | avatar(size=20) | safe}}
+                        {% if filterstatus %}
+                        </a>
+                        {% endif %}
                     </span>
                     {% endif %}
 
@@ -99,6 +138,7 @@
                 </div>
                 <div>
                         {% for tag in issue.tags %}
+                            {% if filterstatus %}
                             <a id="tag-{{ tag.tag }}" title="{{ tag.tag_description }}"
                                   style="background-color:{{ tag.tag_color}}; font-size:90%"
                                   class="badge badge-secondary"
@@ -106,9 +146,17 @@
                                       repo=repo.name,
                                       username=repo.username if repo.is_fork else None,
                                       namespace=repo.namespace,
-                                      tags=tag.tag) }}">
+                                      tags=tag.tag,
+                                      status=filterstatus) }}">
                                 {{ tag.tag }}
                             </a>
+                            {% else %}
+                            <span id="tag-{{ tag.tag }}" title="{{ tag.tag_description }}"
+                                  style="background-color:{{ tag.tag_color}}; font-size:90%"
+                                  class="badge badge-secondary">
+                                {{ tag.tag }}
+                            </span>
+                            {% endif %}
                         {% endfor %}
                 </div>
                 {% endif %}
diff --git a/pagure/templates/issues.html b/pagure/templates/issues.html
index a6c207d..7a720ca 100644
--- a/pagure/templates/issues.html
+++ b/pagure/templates/issues.html
@@ -451,7 +451,7 @@
 
           {% if issues %}
             {% for issue in issues %}
-              {{render_issue_row(issue, repo, username)}}
+              {{render_issue_row(issue, repo, username, filterstatus=status)}}
             {% endfor %}
           {% else %}
           <div class="list-group-item">

From a56157517070149f5d846aa27dd082caa9a874ed Mon Sep 17 00:00:00 2001
From: Ryan Lerch <rlerch@redhat.com>
Date: Sep 10 2018 07:45:46 +0000
Subject: [PATCH 3/3] add filtering link for assignee on PR list


fixes: #3624

---

diff --git a/pagure/templates/_render_pullrequests.html b/pagure/templates/_render_pullrequests.html
index e229e22..417dc89 100644
--- a/pagure/templates/_render_pullrequests.html
+++ b/pagure/templates/_render_pullrequests.html
@@ -1,4 +1,4 @@
-{% macro render_pullrequest_row(request, repo, username, subtitle=True, class="", showproject=False) %}
+{% macro render_pullrequest_row(request, repo, username, subtitle=True, class="", showproject=False, filterstatus=None) %}
     {% if request.status|lower == 'open' %}
         {% set status_color = "success" %}
     {% elif request.status|lower == 'merged' %}
@@ -30,7 +30,18 @@
                         {% if request.assignee %}
                         <span title="Assigned to {{ request.assignee.username}}" class="ml-3" data-toggle="tooltip">
                             <i class="fa fa-fw fa-user-plus pr-2"></i>
+                            {% if filterstatus %}
+                            <a href="{{ url_for('ui_ns.request_pulls',
+                                repo=repo.name,
+                                username=username,
+                                namespace=repo.namespace,
+                                status=filterstatus,
+                                assignee=request.assignee.username) }}" class="notblue">
+                            {% endif %}
                             {{ request.assignee.username | avatar(size=20) | safe}}
+                            {% if filterstatus %}
+                            </a>
+                            {% endif %}
                         </span>
                         {% endif %}
             
diff --git a/pagure/templates/requests.html b/pagure/templates/requests.html
index b88abb3..81a714a 100644
--- a/pagure/templates/requests.html
+++ b/pagure/templates/requests.html
@@ -230,7 +230,7 @@
 
         {% if requests %}
           {% for request in requests %}
-            {{render_pullrequest_row(request, repo, username)}}
+            {{render_pullrequest_row(request, repo, username, filterstatus=status)}}
           {% endfor %}
         {% else %}
         <div class="list-group-item">

