Bug 24093: Sorting indicators broken on list contents view
This patch updates the table markup for the lists contents view so that the table sort state is correctly indicated by arrows in the table headers. The markup changes allow the standard DataTables CSS to apply to this table even though it is not a DataTable. To test, apply the patch, go to Lists, and view any list with multiple titles attached. - The list should be sorted by default according to the list's settings, and the arrow in the header row should correctly reflect the sorting column and direction. - Test re-sorting the table by each of the different sortable columns, confirming each time that the sorting arrows are correct. Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
770f24d4f7
commit
e9163adf3f
1 changed files with 25 additions and 27 deletions
|
@ -159,44 +159,42 @@
|
|||
</div>
|
||||
[% END %]
|
||||
|
||||
<table id="searchresults">
|
||||
<table id="searchresults" class="dataTable">
|
||||
<thead>
|
||||
<tr>
|
||||
[% IF ( itemsloop ) %]<th class="checkall"> </th>[% END %]
|
||||
|
||||
[% UNLESS ( item_level_itypes ) %]<th>Item type</th>[% END %]
|
||||
<th>
|
||||
[% IF sortfield == 'title' %]
|
||||
<th class="sorting_[% direction | html %]">
|
||||
[% ELSE %]
|
||||
<th class="sorting">
|
||||
[% END %]
|
||||
<a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]&sortfield=title&direction=[% IF sortfield != 'title' %]asc[% ELSE %][% new_direction | uri %][% END %]">Title</a>
|
||||
[% IF sortfield == 'title' %]
|
||||
<img src="[% interface | html %]/[% theme | html %]/img/[% direction | html %].gif" alt="[% direction | html %] sort" />
|
||||
[% ELSE %]
|
||||
<img src="[% interface | html %]/[% theme | html %]/img/ascdesc.gif" alt="" />
|
||||
[% END %]
|
||||
</th>
|
||||
<th>
|
||||
[% IF sortfield == 'author' %]
|
||||
<th class="sorting_[% direction | html %]">
|
||||
[% ELSE %]
|
||||
<th class="sorting">
|
||||
[% END %]
|
||||
<a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]&sortfield=author&direction=[% IF sortfield != 'author' %]asc[% ELSE %][% new_direction | uri %][% END %]">Author</a>
|
||||
[% IF sortfield == 'author' %]
|
||||
<img src="[% interface | html %]/[% theme | html %]/img/[% direction | html %].gif" alt="[% direction | html %] sort" />
|
||||
[% ELSE %]
|
||||
<img src="[% interface | html %]/[% theme | html %]/img/ascdesc.gif" alt="" />
|
||||
[% END %]
|
||||
</th>
|
||||
<th>
|
||||
<a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]&sortfield=dateadded&direction=[% IF sortfield != 'dateadded' %]asc[% ELSE %][% new_direction | uri %][% END %]">Date added</a>
|
||||
[% IF sortfield == 'dateadded' %]
|
||||
<img src="[% interface | html %]/[% theme | html %]/img/[% direction | html %].gif" alt="[% direction | html %] sort" />
|
||||
[% ELSE %]
|
||||
<img src="[% interface | html %]/[% theme | html %]/img/ascdesc.gif" alt="" />
|
||||
[% END %]
|
||||
</th>
|
||||
<th>
|
||||
[% IF sortfield == 'dateadded' %]
|
||||
<th class="sorting_[% direction | html %]">
|
||||
[% ELSE %]
|
||||
<th class="sorting">
|
||||
[% END %]
|
||||
<a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]&sortfield=dateadded&direction=[% IF sortfield != 'dateadded' %]asc[% ELSE %][% new_direction | uri %][% END %]">Date added</a>
|
||||
</th>
|
||||
[% IF sortfield == 'itemcallnumber' %]
|
||||
<th class="sorting_[% direction | html %]">
|
||||
[% ELSE %]
|
||||
<th class="sorting">
|
||||
[% END %]
|
||||
<a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]&sortfield=itemcallnumber&direction=[% IF sortfield != 'itemcallnumber' %]asc[% ELSE %][% new_direction | uri %][% END %]">Call number</a>
|
||||
[% IF sortfield == 'itemcallnumber' %]
|
||||
<img src="[% interface | html %]/[% theme | html %]/img/[% direction | html %].gif" alt="[% direction | html %] sort" />
|
||||
[% ELSE %]
|
||||
<img src="[% interface | html %]/[% theme | html %]/img/ascdesc.gif" alt="" />
|
||||
[% END %]
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
[% FOREACH itemsloo IN itemsloop %]
|
||||
<tr>
|
||||
[% IF itemsloop %]
|
||||
|
|
Loading…
Reference in a new issue