From a906cd4a7370577ef00c09addeadca8a5b560f97 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 8 Sep 2022 15:32:27 +0000 Subject: [PATCH] Bug 30304: Reindent lists template in the staff interface This patch performs general template cleanup to the lists template: Make indentation consistent, replace tabs with spaces, and trim trailing whitespace. To test, apply the patch and test all aspects of the lists pages, including: - Viewing the list of public and private lists. - List of lists DataTable controls: Paging, filtering, sorting. - Add, edit and delete lists. - View list contents. - Remove titles from a list. - Place hold from a list. - Add items to a list. Use your preferred method for checking the differences between files while ignoring whitespace. I use diff with the "-w" flag. The only changes you see should be split lines. Signed-off-by: Katrin Fischer Signed-off-by: Lucas Gass Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/virtualshelves/shelves.tt | 797 ++++++++++-------- 1 file changed, 425 insertions(+), 372 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt index 6984b804df..4ad09c6c83 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -25,7 +25,11 @@ @@ -96,7 +107,7 @@ [% IF op == 'view' %]
  • - Contents of [% shelf.shelfname | html %] + Contents of [% shelf.shelfname | html %]
  • [% END %] @@ -118,378 +129,420 @@ [% END %] [% IF op == 'transfer' %] -
  • Transfer list [% shelf.shelfname | html %]
  • +
  • + Transfer list [% shelf.shelfname | html %] +
  • [% END %] -
    -
    -
    -
    - - [% IF op != 'transfer' %][% INCLUDE 'virtualshelves-toolbar.inc' %][% END %] - -[% FOR m IN messages %] -
    - [% SWITCH m.code %] - [% CASE 'error_on_update' %] - An error occurred when updating this list. - [% CASE 'error_on_insert' %] - An error occurred when creating this list. - [% CASE 'error_on_delete' %] - An error occurred when deleting this list. - [% CASE 'error_on_add_biblio' %] - [% IF m.item_barcode %] - The item ([% m.item_barcode | html %]) has not been added to the list. Please verify it is not already in the list. - [% ELSE %] - The record ([% m.bibnum | html %]) has not been added to the list. Please verify it is not already in the list. - [% END %] - [% CASE 'success_on_update' %] - List updated. - [% CASE 'success_on_insert' %] - List created. - [% CASE 'success_on_delete' %] - List deleted. - [% CASE 'success_on_add_biblio' %] - [% IF m.item_barcode %] - The item ([% m.item_barcode | html %]) has been added to the list. - [% ELSE %] - The record ([% m.bibnum | html %]) has been added to the list. - [% END %] - [% CASE 'success_on_remove_biblios' %] - The item has been removed from the list. - [% CASE 'does_not_exist' %] - This list does not exist. - [% CASE 'item_does_not_exist' %] - [% IF m.item_barcode %] - The item ([% m.item_barcode | html %]) does not exist. - [% ELSE %] - The record ([% m.bibnum | html %]) does not exist. +
    +
    +
    +
    + + [% IF op != 'transfer' %][% INCLUDE 'virtualshelves-toolbar.inc' %][% END %] + + [% FOR m IN messages %] +
    + [% SWITCH m.code %] + [% CASE 'error_on_update' %] + An error occurred when updating this list. + [% CASE 'error_on_insert' %] + An error occurred when creating this list. + [% CASE 'error_on_delete' %] + An error occurred when deleting this list. + [% CASE 'error_on_add_biblio' %] + [% IF m.item_barcode %] + The item ([% m.item_barcode | html %]) has not been added to the list. Please verify it is not already in the list. + [% ELSE %] + The record ([% m.bibnum | html %]) has not been added to the list. Please verify it is not already in the list. + [% END %] + [% CASE 'success_on_update' %] + List updated. + [% CASE 'success_on_insert' %] + List created. + [% CASE 'success_on_delete' %] + List deleted. + [% CASE 'success_on_add_biblio' %] + [% IF m.item_barcode %] + The item ([% m.item_barcode | html %]) has been added to the list. + [% ELSE %] + The record ([% m.bibnum | html %]) has been added to the list. + [% END %] + [% CASE 'success_on_remove_biblios' %] + The item has been removed from the list. + [% CASE 'does_not_exist' %] + This list does not exist. + [% CASE 'item_does_not_exist' %] + [% IF m.item_barcode %] + The item ([% m.item_barcode | html %]) does not exist. + [% ELSE %] + The record ([% m.bibnum | html %]) does not exist. + [% END %] + [% CASE 'unauthorized_on_view' %] + You do not have permission to view this list. + [% CASE 'unauthorized_on_update' %] + You do not have permission to update this list. + [% CASE 'unauthorized_on_delete' %] + You do not have permission to delete this list. + [% CASE 'unauthorized_on_add_biblio' %] + You do not have permission to add a record to this list. + [% CASE 'unauthorized_transfer' %] + You do not have permission to transfer ownership of this list. + [% CASE 'new_owner_not_found' %] + The new owner could not be found anymore. + [% CASE 'no_biblio_removed' %] + No record was removed. + + [% CASE 'Koha::Exceptions::Virtualshelf::DuplicateObject' %] + An error occurred when creating this list. The name [% shelfname | html %] already exists. + [% CASE 'Koha::Exceptions::Virtualshelf::UseDbAdminAccount' %] + List could not be created. (Do not use the database administrator account.) + [% CASE 'DBIx::Class::Exception' %] + [% m.msg | html %] + + [% CASE %] + [% m.code | html %] [% m.msg | html %] + [% END %] +
    [% END %] - [% CASE 'unauthorized_on_view' %] - You do not have permission to view this list. - [% CASE 'unauthorized_on_update' %] - You do not have permission to update this list. - [% CASE 'unauthorized_on_delete' %] - You do not have permission to delete this list. - [% CASE 'unauthorized_on_add_biblio' %] - You do not have permission to add a record to this list. - [% CASE 'unauthorized_transfer' %] - You do not have permission to transfer ownership of this list. - [% CASE 'new_owner_not_found' %] - The new owner could not be found anymore. - [% CASE 'no_biblio_removed' %] - No record was removed. - - [% CASE 'Koha::Exceptions::Virtualshelf::DuplicateObject' %] - An error occurred when creating this list. The name [% shelfname | html %] already exists. - [% CASE 'Koha::Exceptions::Virtualshelf::UseDbAdminAccount' %] - List could not be created. (Do not use the database administrator account.) - [% CASE 'DBIx::Class::Exception' %] - [% m.msg | html %] - - [% CASE %] - [% m.code | html %] [% m.msg | html %] - [% END %] -
    -[% END %] - -[% IF op == 'transfer' %] -

    Transfer ownership of public list [% shelf.shelfname | html %]

    - -
    -
    - - - - -
    - - -
    -
    -
    - - - -
    + [% IF op == 'transfer' %] +

    Transfer ownership of public list [% shelf.shelfname | html %]

    + + +
    + + + + +
    + + +
    + +
    +
    + + + +
    + +
    +
    + + Cancel +
    -
    -
    - - Cancel -
    +
    + + [% END %] -
    - -[% END %] + [% IF op == 'view' %] +

    Contents of [% shelf.shelfname | html %]

    + [% IF itemsloop %] +
    [% pagination_bar | $raw %]
    +
    + + + + + [% IF direction == 'asc' %] + [% SET new_direction = 'desc' %] + [% ELSE %] + [% SET direction = 'desc' %] + [% SET new_direction = 'asc' %] + [% END %] -[% IF op == 'view' %] -

    Contents of [% shelf.shelfname | html %]

    - [% IF itemsloop %] -
    [% pagination_bar | $raw %]
    - - - - - -[% IF direction == 'asc' %] - [% SET new_direction = 'desc' %] -[% ELSE %] - [% SET direction = 'desc' %] - [% SET new_direction = 'asc' %] -[% END %] + [% IF itemsloop %] +
    +
    + | + + + | +   + [% IF CAN_user_reserveforothers && Koha.Preference('DisplayMultiPlaceHold') %] +
    + [% END %] + [% IF can_remove_biblios %] +
    + [% END %] + [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] +
    + [% END %] +
    +
    + [% END %] -[% IF itemsloop %] -
    -
    | - + + + + [% IF ( itemsloop ) %] + + [% END %] + [% UNLESS ( item_level_itypes ) %] + + [% END %] + [% IF sortfield == 'title' %] + + [% IF sortfield == 'author' %] + + [% IF sortfield == 'dateadded' %] + + [% IF sortfield == 'itemcallnumber' %] + + + + [% FOREACH itemsloo IN itemsloop %] + + [% IF itemsloop %] + + [% END %] + [% UNLESS ( item_level_itypes ) %] + + [% END %] + + + + + + [% END %] +
     Item type + [% ELSE %] + + [% END %] + Title + + [% ELSE %] + + [% END %] + Author + + [% ELSE %] + + [% END %] + Date added + + [% ELSE %] + + [% END %] + Call number +
    + + + [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %] + [% itemsloo.description | html %] + [% END %] + [% itemsloo.description | html %] + + [% IF ( itemsloo.XSLTBloc ) %] + [% itemsloo.XSLTBloc | $raw %] + [% ELSE %] + [% INCLUDE 'biblio-title.inc' biblio=itemsloo link = 1 %] + + [% END %] +

    + [% IF ( itemsloo.notforloan ) %] + No holds allowed + [% ELSE %] + [% IF ( itemsloo.ITEM_RESULTS.count ) %] + Holds + [% IF ( holdfor ) %] + | Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 %] + [% END %] + [% ELSE %] + No holds allowed + [% END %] + [% END %] + [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] + | Edit record + [% END %] + [% IF ( CAN_user_editcatalogue_edit_items ) %] + | Edit items + [% END %] +

    +
    + [% itemsloo.author | html %] + + [% itemsloo.dateadded | $KohaDates%] + +
      + [% FOREACH item IN itemsloo.ITEM_RESULTS %] +
    • + [% Branches.GetName(item.holdingbranch) | html %] + [% IF ( item.location ) %] + + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %] + + [% END %] + [% IF ( item.itemcallnumber ) %] + [[% item.itemcallnumber | html %]] + [% END %] +
    • + [% END %] +
    +
    +
    [% pagination_bar | $raw %]
    + + [% END %] + [% END %] - | -   - [% IF CAN_user_reserveforothers && Koha.Preference('DisplayMultiPlaceHold') %] -
    - [% END %] - [% IF can_remove_biblios %] -
    - [% END %] - [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
    [% END %] -
    -
    -[% END %] + [% IF op == 'add_form' OR op == 'edit_form' %] - - - - [% IF ( itemsloop ) %][% END %] + +
    + [% IF op == 'add_form' %] +

    Create a new list

    + + [% ELSE %] +

    Edit list [% shelf.shelfname | html %]

    + + [% END %] + + +
      +
    1. + + Required +
    2. +
    3. + Owner: + [% IF op == 'add_form' %] + [% logged_in_user.userid | html %] + [% ELSE %] + [% IF owner %] + [% owner.firstname _ ' ' _ owner.surname | html %] + [% ELSE %] + [% logged_in_user.userid | html %] + [% END %] + [% END %] +
    4. +
    5. + + +
    6. +
    7. + + +
    8. + [% INCLUDE list_permissions %] +
    +
    - [% UNLESS ( item_level_itypes ) %][% END %] - [% IF sortfield == 'title' %] - - [% IF sortfield == 'author' %] - - [% IF sortfield == 'dateadded' %] - - [% IF sortfield == 'itemcallnumber' %] - - - - [% FOREACH itemsloo IN itemsloop %] - - [% IF itemsloop %] - - [% END %] - [% UNLESS ( item_level_itypes ) %][% END %] - - - - - - [% END %] -
     
    Item type - [% ELSE %] - - [% END %] - Title - - [% ELSE %] - - [% END %] - Author - - [% ELSE %] - - [% END %] - Date added - - [% ELSE %] - - [% END %] - Call number -
    - - - [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %][% itemsloo.description | html %][% END %][% itemsloo.description | html %] - - [% IF ( itemsloo.XSLTBloc ) %] - [% itemsloo.XSLTBloc | $raw %] - [% ELSE %] - [% INCLUDE 'biblio-title.inc' biblio=itemsloo link = 1 %] - - [% END %] -

    - [% IF ( itemsloo.notforloan ) %] - No holds allowed +

    + + [% IF referer == 'view' %] + Cancel [% ELSE %] - [% IF ( itemsloo.ITEM_RESULTS.count ) %] - Holds - [% IF ( holdfor ) %] | Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 %][% END %] + [% IF public %] + Cancel [% ELSE %] - No holds allowed + Cancel [% END %] [% END %] - [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] - | Edit record - [% END %] - [% IF ( CAN_user_editcatalogue_edit_items ) %] - | Edit items - [% END %] -

    -
    [% itemsloo.author | html %][% itemsloo.dateadded | $KohaDates%] -
      - [% FOREACH item IN itemsloo.ITEM_RESULTS %] -
    • - [% Branches.GetName(item.holdingbranch) | html %] - [% IF ( item.location ) %] - - [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %] - - [% END %] - [% IF ( item.itemcallnumber ) %] - [[% item.itemcallnumber | html %]] - [% END %] -
    • - [% END %] -
    -
    -
    [% pagination_bar | $raw %]
    - - - [% END %] -[% END %] - -[% IF op == 'add_form' OR op == 'edit_form' %] - -
    -
    - - [% IF op == 'add_form' %] -

    Create a new list

    - - [% ELSE %] -

    Edit list [% shelf.shelfname | html %]

    - - [% END %] - - -
      -
    1. - - Required -
    2. -
    3. - Owner: - [% IF op == 'add_form' %] - [% logged_in_user.userid | html %] - [% ELSE %] - [% IF owner %] - [% owner.firstname _ ' ' _ owner.surname | html %] - [% ELSE %] - [% logged_in_user.userid | html %] - [% END %] - [% END %] -
    4. -
    5. -
    6. -
    7. -
    8. - - [% INCLUDE list_permissions %] - -
    -
    - -
    - - [% IF referer == 'view' %] - Cancel - [% ELSE %] - [% IF public %] - Cancel - [% ELSE %] - Cancel +
    +
    [% END %] - [% END %] - - - -[% END %] -[% IF op == 'list' %] -

    Lists

    -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeList nameContentsTypeOwnerSort byCreation dateModification dateActions
    - -
    -
    -
    -[% END %] + [% IF op == 'list' %] +

    Lists

    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeList nameContentsTypeOwnerSort byCreation dateModification dateActions
    + +
    +
    +
    + [% END %] -
    - -
    +
    + +
    -
    -
    -
    + +
    + [% IF ( can_add_biblios ) %] @@ -503,22 +556,22 @@