Bug 31767: Add 'page-section' to tags page

This patch updates tags templates so that the main content of
the page is wrapped with a "page-section" div. This ensures that content
has sufficient contrast. See Bug 31757.

Note: This patch contains indentation changes, so use diff accordingly.

To test, apply the patch and go to Tools -> Tags.

- Confirm that the content area of the page looks correct.
- Click one of the tag terms to view the list of titles tagged with that
  term. Confirm that this page looks correct too.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Owen Leonard 2022-10-13 18:07:07 +00:00 committed by Tomas Cohen Arazi
parent 48cc24f68c
commit 51b74d050b
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 112 additions and 108 deletions

View file

@ -45,45 +45,47 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
[% IF ( titles ) %]
<h3>Titles tagged with the term <em>[% tag | html %]</em></h3>
<table id="itemst">
<thead><tr>
<th>Title</th>
<th>Location</th>
<th>&nbsp;</th>
</tr></thead>
<div class="page-section">
<table id="itemst">
<thead><tr>
<th>Title</th>
<th>Location</th>
<th>&nbsp;</th>
</tr></thead>
[% FOREACH title IN titles %]
<tr>
<td>[% INCLUDE 'biblio-title.inc' biblio=title link = 1 %]
[% title.author | html %]
<p>[% IF ( title.publishercode ) %]- [% title.publishercode | html %]
[% IF ( title.place ) %] [% title.place | html %][% END %][% END %]
[% IF ( title.pages ) %] - [% title.pages | html %][% IF ( title.size ) %] [% title.size | html %]
[% END %]
[% END %]</p>
[% IF ( title.notes ) %]
<p>[% title.notes | html %]</p>[% END %]
[% IF ( title.TagLoop ) %]<p style="font-size:90%"><strong>Tagged with:</strong> [% FOREACH TagLoo IN title.TagLoop %]
<a href="/cgi-bin/koha/tags/list.pl?tag=[% TagLoo.term | uri %]">[% TagLoo.term | html %]</a> <span class="weight">([% TagLoo.weight_total | html %])</span>[% IF ( loop.last ) %][% ELSE %], [% END %]
[% END %]</p>
[% END %]
</td>
<td>[% IF ( title.items.count ) %]<ul style="font-size:80%">[% FOREACH item IN title.items %]
<li>
[% Branches.GetName(item.holdingbranch) | html %]
<span class="shelvingloc">
[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]
</span>
[% IF ( item.itemcallnumber ) %]
([% item.itemcallnumber | html %])
[% FOREACH title IN titles %]
<tr>
<td>[% INCLUDE 'biblio-title.inc' biblio=title link = 1 %]
[% title.author | html %]
<p>[% IF ( title.publishercode ) %]- [% title.publishercode | html %]
[% IF ( title.place ) %] [% title.place | html %][% END %][% END %]
[% IF ( title.pages ) %] - [% title.pages | html %][% IF ( title.size ) %] [% title.size | html %]
[% END %]
</li>
[% END %]</ul>[% ELSE %]This record has no items.[% END %]
</td>
<td><form method="post" action="/cgi-bin/koha/tags/list.pl"><input type="hidden" name="op" value="del" /><input type="hidden" name="tag" value="[% tag | html %]" /><input type="hidden" name="tag_id" value="[% title.tag_id | html %]" /><button type="submit" class="delete btn btn-default btn-sm"><i class="fa fa-trash"></i> Remove tag</button></form></td>
</tr>
[% END %]
</table>
[% END %]</p>
[% IF ( title.notes ) %]
<p>[% title.notes | html %]</p>[% END %]
[% IF ( title.TagLoop ) %]<p style="font-size:90%"><strong>Tagged with:</strong> [% FOREACH TagLoo IN title.TagLoop %]
<a href="/cgi-bin/koha/tags/list.pl?tag=[% TagLoo.term | uri %]">[% TagLoo.term | html %]</a> <span class="weight">([% TagLoo.weight_total | html %])</span>[% IF ( loop.last ) %][% ELSE %], [% END %]
[% END %]</p>
[% END %]
</td>
<td>[% IF ( title.items.count ) %]<ul style="font-size:80%">[% FOREACH item IN title.items %]
<li>
[% Branches.GetName(item.holdingbranch) | html %]
<span class="shelvingloc">
[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]
</span>
[% IF ( item.itemcallnumber ) %]
([% item.itemcallnumber | html %])
[% END %]
</li>
[% END %]</ul>[% ELSE %]This record has no items.[% END %]
</td>
<td><form method="post" action="/cgi-bin/koha/tags/list.pl"><input type="hidden" name="op" value="del" /><input type="hidden" name="tag" value="[% tag | html %]" /><input type="hidden" name="tag_id" value="[% title.tag_id | html %]" /><button type="submit" class="delete btn btn-default btn-sm"><i class="fa fa-trash"></i> Remove tag</button></form></td>
</tr>
[% END %]
</table>
</div> <!-- /.page-section -->
[% ELSE %]
<div class="dialog message">There are no titles tagged with the term <em>[% tag | html %]</em></div>
[% END %]

View file

@ -88,78 +88,80 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; }
</div>
[% END %]
[% IF ( tagloop ) %]
<p class="check"></p>
<table id="tagst">
<thead>
<tr>
<th class="NoSort">&nbsp;</th>
<th>Status</th>
<th>Term</th>
<th>Weight</th>
<th class="NoSort noExport">Actions</th>
[% UNLESS ( filter_approved_pending ) %]<th>Reviewer</th>[% END %]
<th>Date</th>
</tr>
</thead>
<tbody>
[% FOREACH tagloo IN tagloop %]
<tr>
<td>
[% IF ( tagloo.approved == 0 ) %]
<input id="checkbox[% offset + loop.count | html %]" type="checkbox" value="[% tagloo.term | html %]" name="tags" class="pending" />
[% ELSIF ( tagloo.approved == 1 ) %]
<input id="checkbox[% offset + loop.count | html %]" type="checkbox" value="[% tagloo.term | html %]" name="tags" class="approved" />
[% ELSE %]
<input id="checkbox[% offset + loop.count | html %]" type="checkbox" value="[% tagloo.term | html %]" name="tags" class="rejected" />
[% END %]
</td>
<td>
[% IF ( tagloo.approved == -1 ) %]
<label for="checkbox[% offset + loop.count | html %]">
<span class="rejected status[% offset + loop.count | html %]">Rejected</span>
</label>
[% ELSIF ( tagloo.approved == 1 ) %]
<label for="checkbox[% offset + loop.count | html %]">
<span class="approved status[% offset + loop.count | html %]">Approved</span>
</label>
[% ELSE %]
<label for="checkbox[% offset + loop.count | html %]">
<span class="pending status[% offset + loop.count | html %]">Pending</span>
</label>
[% END %]
</td>
<td><a href="/cgi-bin/koha/tags/list.pl?tag=[% tagloo.term|uri %]">[% tagloo.term | html %]</a>
</td>
<td>[% tagloo.weight_total | html %]
</td>
[% IF ( tagloo.approved ) %]
<td class="actions"><span class="ajax_buttons" style="visibility:hidden">
[% IF ( tagloo.approved == -1 ) %]
<button data-num="[% offset + loop.count | html %]" class="approval_btn ok btn btn-default btn-xs" type="submit" title="[% tagloo.term | html %]" value="Approve" name="approve"><i class="fa fa-check"></i> Approve</button>
<button data-num="[% offset + loop.count | html %]" class="approval_btn rej btn btn-default btn-xs" disabled="disabled" type="submit" title="[% tagloo.term | html %]" value="Rejected" name="reject"><i class="fa fa-remove"></i> Rejected</button>
[% ELSE %]
<button data-num="[% offset + loop.count | html %]" class="approval_btn ok btn btn-default btn-xs" disabled="disabled" type="submit" title="[% tagloo.term | html %]" value="Approved" name="approve"><i class="fa fa-check"></i> Approved</button>
<button data-num="[% offset + loop.count | html %]" class="approval_btn rej btn btn-default btn-xs" type="submit" title="[% tagloo.term | html %]" value="Reject" name="reject"><i class="fa fa-remove"></i> Reject</button>
[% END %]
</span>
</td>
<td>[% IF ( tagloo.approved_by_name ) %]<a href="/cgi-bin/koha/tags/review.pl?approved_by=[% tagloo.approved_by | uri %]&amp;approved=all">[% tagloo.approved_by_name | html %]</a>[% ELSE %]&nbsp;[% END %]
</td>
[% ELSE %]
<td class="actions"><span class="ajax_buttons" style="visibility:hidden">
<button data-num="[% offset + loop.count | html %]" class="approval_btn ok btn btn-default btn-xs" type="submit" title="[% tagloo.term | html %]" value="Approve" name="approve"><i class="fa fa-check"></i> Approve</button>
<button data-num="[% offset + loop.count | html %]" class="approval_btn rej btn btn-default btn-xs" type="submit" title="[% tagloo.term | html %]" value="Reject" name="reject"><i class="fa fa-remove"></i> Reject</button>
</span>
</td>
[% UNLESS ( filter_approved_pending ) %]<td>&nbsp;</td>[% END %]
<div class="page-section">
<p class="check"></p>
<table id="tagst">
<thead>
<tr>
<th class="NoSort">&nbsp;</th>
<th>Status</th>
<th>Term</th>
<th>Weight</th>
<th class="NoSort noExport">Actions</th>
[% UNLESS ( filter_approved_pending ) %]<th>Reviewer</th>[% END %]
<th>Date</th>
</tr>
</thead>
<tbody>
[% FOREACH tagloo IN tagloop %]
<tr>
<td>
[% IF ( tagloo.approved == 0 ) %]
<input id="checkbox[% offset + loop.count | html %]" type="checkbox" value="[% tagloo.term | html %]" name="tags" class="pending" />
[% ELSIF ( tagloo.approved == 1 ) %]
<input id="checkbox[% offset + loop.count | html %]" type="checkbox" value="[% tagloo.term | html %]" name="tags" class="approved" />
[% ELSE %]
<input id="checkbox[% offset + loop.count | html %]" type="checkbox" value="[% tagloo.term | html %]" name="tags" class="rejected" />
[% END %]
</td>
<td>
[% IF ( tagloo.approved == -1 ) %]
<label for="checkbox[% offset + loop.count | html %]">
<span class="rejected status[% offset + loop.count | html %]">Rejected</span>
</label>
[% ELSIF ( tagloo.approved == 1 ) %]
<label for="checkbox[% offset + loop.count | html %]">
<span class="approved status[% offset + loop.count | html %]">Approved</span>
</label>
[% ELSE %]
<label for="checkbox[% offset + loop.count | html %]">
<span class="pending status[% offset + loop.count | html %]">Pending</span>
</label>
[% END %]
</td>
<td><a href="/cgi-bin/koha/tags/list.pl?tag=[% tagloo.term|uri %]">[% tagloo.term | html %]</a>
</td>
<td>[% tagloo.weight_total | html %]
</td>
[% IF ( tagloo.approved ) %]
<td class="actions"><span class="ajax_buttons" style="visibility:hidden">
[% IF ( tagloo.approved == -1 ) %]
<button data-num="[% offset + loop.count | html %]" class="approval_btn ok btn btn-default btn-xs" type="submit" title="[% tagloo.term | html %]" value="Approve" name="approve"><i class="fa fa-check"></i> Approve</button>
<button data-num="[% offset + loop.count | html %]" class="approval_btn rej btn btn-default btn-xs" disabled="disabled" type="submit" title="[% tagloo.term | html %]" value="Rejected" name="reject"><i class="fa fa-remove"></i> Rejected</button>
[% ELSE %]
<button data-num="[% offset + loop.count | html %]" class="approval_btn ok btn btn-default btn-xs" disabled="disabled" type="submit" title="[% tagloo.term | html %]" value="Approved" name="approve"><i class="fa fa-check"></i> Approved</button>
<button data-num="[% offset + loop.count | html %]" class="approval_btn rej btn btn-default btn-xs" type="submit" title="[% tagloo.term | html %]" value="Reject" name="reject"><i class="fa fa-remove"></i> Reject</button>
[% END %]
</span>
</td>
<td>[% IF ( tagloo.approved_by_name ) %]<a href="/cgi-bin/koha/tags/review.pl?approved_by=[% tagloo.approved_by | uri %]&amp;approved=all">[% tagloo.approved_by_name | html %]</a>[% ELSE %]&nbsp;[% END %]
</td>
[% ELSE %]
<td class="actions"><span class="ajax_buttons" style="visibility:hidden">
<button data-num="[% offset + loop.count | html %]" class="approval_btn ok btn btn-default btn-xs" type="submit" title="[% tagloo.term | html %]" value="Approve" name="approve"><i class="fa fa-check"></i> Approve</button>
<button data-num="[% offset + loop.count | html %]" class="approval_btn rej btn btn-default btn-xs" type="submit" title="[% tagloo.term | html %]" value="Reject" name="reject"><i class="fa fa-remove"></i> Reject</button>
</span>
</td>
[% UNLESS ( filter_approved_pending ) %]<td>&nbsp;</td>[% END %]
[% END %]
<td data-order="[% tagloo.date_approved | html %]">
[% tagloo.date_approved | $KohaDates %]
</td>
</tr>
[% END %]
<td data-order="[% tagloo.date_approved | html %]">
[% tagloo.date_approved | $KohaDates %]
</td>
</tr>
[% END %]
</tbody>
</table>
</tbody>
</table>
</div> <!-- /.page-section -->
[% END %]
[% IF ( tagloop ) %]<fieldset class="action">
<button type="submit" value="Approve" class="btn btn-default" id="approve_button" name="op-approve"><i class="fa fa-check"></i> Approve</button>