From e49d1295acb0ec3b6e3cd124ff3ba526351fc839 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rajmund=20Hru=C5=A1ka?= <rajmund.hruska@cesnet.cz>
Date: Wed, 11 May 2022 20:06:07 +0200
Subject: [PATCH] Fix: Allow group managers to create new reporting filters.
 (Redmine issue: #7582)

---
 .../blueprints/groups/templates/groups/show.html   | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lib/hawat/blueprints/groups/templates/groups/show.html b/lib/hawat/blueprints/groups/templates/groups/show.html
index 67c390a86..350e01b8d 100644
--- a/lib/hawat/blueprints/groups/templates/groups/show.html
+++ b/lib/hawat/blueprints/groups/templates/groups/show.html
@@ -240,6 +240,20 @@
                             {{ _('This group does not have any reporting filters defined at the moment.') }}
                             {%- endcall %}
                             {%- endif %}
+
+                            {%- if can_access_endpoint('filters.createfor', item) %}
+                            <br>
+                            <div class="pull-right">
+                                <div class="btn-toolbar" role="toolbar" aria-label="Action toolbar">
+                                    <div class="btn-group btn-group-sm" role="group" aria-label="Action buttons">
+                                        <a role="button" class="btn btn-default btn-sm" href="{{ url_for('filters.createfor', parent_id = item.id ) }}" data-toggle="tooltip" title="{{ _('Create reporting filter') }}">
+                                            <i class="fas fa-fw fa-plus-circle"></i><span class="hidden-xs hidden-sm hidden-md"> {{ _('Create reporting filter') }}</span>
+                                        </a>
+                                    </div>
+                                </div>
+                            </div>
+                            {%- endif %}
+
                         </div>
 
                         {%- if can_access_endpoint('groups.update', item) %}
-- 
GitLab