Bug 21132: Highlight active filters on saved report page
authorOwen Leonard <oleonard@myacpl.org>
Mon, 30 Jul 2018 17:33:29 +0000 (17:33 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 9 Aug 2018 11:41:53 +0000 (11:41 +0000)
This patch adds a more obvious way of see which search terms have been
submitted to filter the table of saved reports.

The patch also moves embedded CSS into a separate file.

To test you should have multiple saved reports.

- Apply the patch and go to Reports -> Use saved.
- Filter the table of reports by submitting one or more terms in the
  sidebar "Filter" form.
- Confirm that the terms you submit are shown at the top of the table of
  results.
- Confirm that clicking the "Clear" link clears the search filter.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/css/reports.css [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt

diff --git a/koha-tmpl/intranet-tmpl/prog/css/reports.css b/koha-tmpl/intranet-tmpl/prog/css/reports.css
new file mode 100644 (file)
index 0000000..4ccee11
--- /dev/null
@@ -0,0 +1,75 @@
+#sql {
+    height: 9em;
+    width: 90%;
+}
+
+#update_sql .modal-dialog {
+    width: 80%;
+}
+
+ins {
+    background-color: #e6ffe6;
+}
+
+del {
+    background-color: #ffe6e6;
+}
+
+#col1,
+#col2 {
+    float: left;
+    width: 45%;
+}
+
+#col1 ins,
+#col2 del {
+    display: none;
+}
+
+.show_sql {
+    font-family: monospace;
+}
+
+.send_to_item_mod {
+    background-color: #EBF3FF;
+    border: 1px solid #88b0e8;
+    border-radius: 5px;
+    display: inline-block;
+    font-size: 75%;
+    margin: 3px 5px;
+    padding: 3px 5px;
+    white-space: nowrap;
+}
+
+.filter {
+    background-color: #EBF3FF;
+    border-radius: 5px;
+    display: inline-block;
+    font-size: 85%;
+    margin: 3px;
+    padding: 0 1em;
+    white-space: nowrap;
+}
+
+.filter span,
+.filter a {
+    padding: .5em 0;
+}
+
+.filter span {
+    border-right: 1px solid #A4BEDD;
+    display: inline-block;
+    margin-right: .5em;
+    padding-right: .5em;
+}
+
+.clear_filter {
+    display: inline-block;
+    font-weight: bold;
+    margin-left: .5em;
+    padding-left: 1em;
+}
+
+.clear_filter i {
+    color: #C00;
+}
\ No newline at end of file
index 9dde026..5d0546b 100644 (file)
 [%- END -%]</title>
 
 [% INCLUDE 'doc-head-close.inc' %]
-<style type="text/css">
-    #sql { width: 90%; height: 9em;}
-    #update_sql .modal-dialog { width: 80%; }
-    ins { background-color: #e6ffe6; }
-    del { background-color: #ffe6e6; }
-    #col1, #col2 { width:45%; float:left; }
-    #col1 ins, #col2 del { display: none; }
-    .show_sql { font-family: monospace; }
-    .send_to_item_mod {
-        background-color: #EBF3FF;
-        border: 1px solid #88b0e8;
-        border-radius: 5px;
-        display: inline-block;
-        font-size: 75%;
-        margin: 3px 5px;
-        padding: 3px 5px;
-        white-space: nowrap;
-    }
-</style>
 [% IF ( saved1 ) %]
+    [% Asset.css("css/reports.css") %]
     [% Asset.css("css/datatables.css") %]
 [% END %]
 </head>
@@ -145,6 +127,23 @@ canned reports and writing custom SQL reports.</p>
 [% IF ( saved1 ) %]
 [% IF ( savedreports ) %]<h1>Saved reports</h1>
 
+[% IF ( filters.date || filters.author || filters.keyword ) %]
+    <p>Filtered by:
+        <span class="filter">
+            [% IF ( filters.date ) %]
+                <span class="filter_date"><strong>Date:</strong> [% filters.date %]</span>
+            [% END %]
+            [% IF ( filters.author ) %]
+                <span class="filter_author"><strong>Author:</strong> [% filters.author %]</span>
+            [% END %]
+            [% IF ( filters.keyword ) %]
+                <span class="filter_keyword"><strong>Keyword:</strong> [% filters.keyword %]</span>
+            [% END %]
+            <a class="clear_filter" href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved&clear_filters=1"><i class="fa fa-remove"></i> Clear</a>
+        </span>
+    </p>
+[% END %]
+
 <div id="tabs" class="toptabs">
     <ul>
         <li><a href="#reports">All</a></li>