Bug 21132: Highlight active filters on saved report page

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>
This commit is contained in:
Owen Leonard 2018-07-30 17:33:29 +00:00 committed by Nick Clemens
parent ac0f3b880a
commit 1b43cab3dd
2 changed files with 93 additions and 19 deletions

View file

@ -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;
}

View file

@ -31,26 +31,8 @@
[%- 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>