From 314d9e455c9ae92633a8ce4481ab3392b98abdae Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 21 Jan 2025 21:27:43 +0000 Subject: [PATCH] Bug 38942: Fix display issues with item-template-toolbar This patch does the following: -Adds a 'btn' and 'btn-default' class to the buttons in the item-template-toolbar -Removes the btn-group parent containers -Changes the wording of the remember session checkbox to 'Remember for session', just like it is on the check out screen for due dates. -Adds a visual divider after the 'Remember for session' checkbox -Add CSS to addbiblio.css to make the checkbox/label appear a little nicer To test: -Add an item and 'Save as template' -Notice the toolbar buttons look different from other toolbars in Koha. -Apply patch -Look again, the buttons should look better, hopefully! Signed-off-by: Barbara Johnson --- .../intranet-tmpl/prog/css/addbiblio.css | 12 +- .../prog/en/modules/cataloguing/additem.tt | 667 ++++++++---------- 2 files changed, 323 insertions(+), 356 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css b/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css index ae89201194d..69e5de2a4f4 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css +++ b/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css @@ -326,6 +326,16 @@ tbody tr.active td { width: 15em; } +#item-template-toolbar div:has(label[for="use_template_for_session"]) { + display: flex; + align-items: center; +} + +#item-template-toolbar div:has(label[for="use_template_for_session"])::after { + content: "|"; + padding-left: 7px; +} + #toolbar { padding: 5px 0; } @@ -521,4 +531,4 @@ tbody tr.active td { font-size: 100%; font-weight: bold; padding: 0; -} +} \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt index 72ec98529ea..852151402e0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -7,19 +7,17 @@ [% USE TablesSettings %] [% PROCESS 'i18n.inc' %] [% INCLUDE 'doc-head-open.inc' %] -[% FILTER collapse %] - [% t("Items") | html %] - › - [% IF ( biblio.author ) %] - [% tx("{title} by {author}", { title = biblio.title, author = biblio.author }) | html %] - [% ELSE %] - [% biblio.title | html %] - [% END %] - [% tx("(Record #{biblionumber})", { biblionumber = biblio.biblionumber }) | html %] - › [% t("Cataloging") | html %] › [% t("Koha") | html %] - [% END %] +[% FILTER collapse %] + [% t("Items") | html %] › + [% IF ( biblio.author ) %] + [% tx("{title} by {author}", { title = biblio.title, author = biblio.author }) | html %] + [% ELSE %] + [% biblio.title | html %] + [% END %] + [% tx("(Record #{biblionumber})", { biblionumber = biblio.biblionumber }) | html %] › + [% t("Cataloging") | html %] › + [% t("Koha") | html %] +[% END %] [% INCLUDE 'doc-head-close.inc' %] [% Asset.css("css/addbiblio.css") | $raw %] [% INCLUDE 'datatables.inc' %] @@ -38,18 +36,18 @@ [% INCLUDE 'str/cataloging_additem.inc' %] [% Asset.js("js/cataloging_additem.js") | $raw %] [% Asset.js("js/form-submit.js") | $raw %] - - + .flatpickr_wrapper { + flex-basis: 50%; + } + @@ -65,375 +63,334 @@ [% WRAPPER breadcrumb_item %] [% IF ( biblio.author ) %] - [% tx('Edit {title} by {author}', { title = biblio.title, author = biblio.author }) | html %] - ([% tp('Bibliographic record number', 'Record #') | html %] [% biblio.biblionumber | html %]) + [% tx('Edit {title} by {author}', { title = biblio.title, author = biblio.author }) | html %] ([% tp('Bibliographic record number', 'Record #') | html %] [% biblio.biblionumber | html %]) [% ELSE %] - [% tx('Edit {title}', title = biblio.title) | html %] - ([% tp('Bibliographic record number', 'Record #') | html %] [% biblio.biblionumber | html %]) + [% tx('Edit {title}', title = biblio.title) | html %] ([% tp('Bibliographic record number', 'Record #') | html %] [% biblio.biblionumber | html %]) [% END %] [% END %] [% WRAPPER breadcrumb_item bc_active= 1 %] - [% tp('Items attached to a bibliographic record', 'Items') | html %] + [% tp('Items attached to a bibliographic record', 'Items') | html %] [% END %] [% END #/ WRAPPER breadcrumbs %] [% END #/ WRAPPER sub-header.inc %] [% WRAPPER 'main-container.inc' wide_full => 1 %] - [% INCLUDE 'messages.inc' %] - [% IF item_doesnt_exist %] - - [% END %] -

Items for [% biblio.title | html %] [% IF ( biblio.author ) %]by [% biblio.author | html %][% END %] (Record #[% biblio.biblionumber | html %])

- Jump to add item form + [% INCLUDE 'messages.inc' %] + [% IF item_doesnt_exist %] + + [% END %] +

Items for [% biblio.title | html %] [% IF ( biblio.author ) %] by [% biblio.author | html %][% END %] (Record #[% biblio.biblionumber | html %])

+ Jump to add item form - [% IF ( barcode_not_unique ) %]
Error saving item: Barcode must be unique.
[% END %] - [% IF ( no_next_barcode ) %]
Error saving items: Unable to automatically determine values for barcodes. No item has been inserted.
[% END %] - [% IF ( book_on_loan ) %]
Cannot delete: item is checked out.
[% END %] - [% IF ( book_reserved ) %]
Cannot delete: item has a waiting hold.
[% END %] - [% IF ( not_same_branch ) %]
Cannot delete: The items do not belong to your library.
[% END %] - [% IF ( linked_analytics ) %] -
Cannot delete: item has linked analytics..
- [% END %] - [% IF last_item_for_hold %]
Cannot delete: Last item for bibliographic record with biblio-level hold on it.
[% END %] - [% IF item_not_found %]
Cannot delete: Item not found.
[% END %] +[% IF ( barcode_not_unique ) %]
Error saving item: Barcode must be unique.
[% END %] +[% IF ( no_next_barcode ) %]
Error saving items: Unable to automatically determine values for barcodes. No item has been inserted.
[% END %] +[% IF ( book_on_loan ) %]
Cannot delete: item is checked out.
[% END %] +[% IF ( book_reserved ) %]
Cannot delete: item has a waiting hold.
[% END %] +[% IF ( not_same_branch ) %]
Cannot delete: The items do not belong to your library.
[% END %] +[% IF ( linked_analytics ) %]
Cannot delete: item has linked analytics..
[% END %] +[% IF last_item_for_hold %]
Cannot delete: Last item for bibliographic record with biblio-level hold on it.
[% END %] +[% IF item_not_found %]
Cannot delete: Item not found.
[% END %] -
- [% IF items %] - [% SET date_fields = [ 'dateaccessioned', 'onloan', 'datelastseen', 'datelastborrowed', 'replacementpricedate' ] %] -
- - - - - [% FOREACH item_header IN item_header_loop %] - +
+ [% IF items %] + [% SET date_fields = [ 'dateaccessioned', 'onloan', 'datelastseen', 'datelastborrowed', 'replacementpricedate' ] %] +
+
  [% item_header.header_value | html %]
+ + + + [% FOREACH item_header IN item_header_loop %] + + [% END %] + + + + [% FOREACH item IN items %] + [% SET can_be_edited = ! ( Koha.Preference('IndependentBranches') && ! logged_in_user.is_superlibrarian && item.homebranch != Branches.GetLoggedInBranchname() ) %] + [% SET tr_class = '' %] + [% IF item.itemnumber == itemnumber%] + [% UNLESS can_be_edited %] + [% SET tr_class='active' %] + [% ELSE %] + [% SET tr_class='active editable' %] [% END %] - - - - [% FOREACH item IN items %] - [% SET can_be_edited = ! ( Koha.Preference('IndependentBranches') && ! logged_in_user.is_superlibrarian && item.homebranch != Branches.GetLoggedInBranchname() ) %] - [% SET tr_class = '' %] - [% IF item.itemnumber == itemnumber %] - [% UNLESS can_be_edited %] - [% SET tr_class='active' %] - [% ELSE %] - [% SET tr_class='active editable' %] + [% ELSIF can_be_edited %] + [% SET tr_class='editable' %] + [% END %] + + [% UNLESS can_be_edited %] + + [% ELSE %] + - [% UNLESS can_be_edited %] - - [% ELSE %] - +
  • Duplicate
  • + + [% UNLESS item.nomod %] +
  • +
    + [% INCLUDE 'csrf-token.inc' %] + + + + + + Delete +
  • [% END %] - [% FOREACH header IN item_header_loop %] - [% SET attribute = header.attribute %] - [% SET can_mod = item.nomod ? "nomod" : "canmod" %] - [% IF attribute AND date_fields.grep('^' _ attribute _ '$').size %] - [% IF attribute == 'datelastseen' %] - - [% ELSE %] - - [% END %] - [% ELSIF ( item.$attribute && ( attribute == 'price' || attribute == 'replacementprice' ) ) %] - - [% ELSIF item.$attribute && attribute == 'itemcallnumber' %] - - [% ELSE %] - - [% END %] + [% END %] + [% IF ( OPACBaseURL ) %] +
  • OPAC view
  • [% END %] - - [% END %] - -
      + [% item_header.header_value | html %] +
      +
    + + Actions + +
      -
    - Actions - -
    -
    [% item.$attribute | $KohaDates with_hours => 1 %][% item.$attribute | $KohaDates %][% item.$attribute | $Price %][% item.$attribute | html %][% item.$attribute | html %]
    -
    - - [% END %] - -
    -
    [% INCLUDE 'biblio-view-menu.inc' %]
    -
    -
    -
    - [% INCLUDE 'csrf-token.inc' %] - - [% IF (popup) %] - + +
    + [% END %] - - [% IF op != 'cud-saveitem' %] -

    Add item [% IF (circborrowernumber) %](fast cataloging)[% END %]

    + [% FOREACH header IN item_header_loop %] + [% SET attribute = header.attribute %] + [% SET can_mod = item.nomod ? "nomod" : "canmod" %] + [% IF attribute AND date_fields.grep('^' _ attribute _ '$').size %] + [% IF attribute == 'datelastseen' %] + [% item.$attribute | $KohaDates with_hours => 1 %] + [% ELSE %] + [% item.$attribute | $KohaDates %] + [% END %] + [% ELSIF ( item.$attribute && ( attribute == 'price' || attribute == 'replacementprice' ) ) %] + [% item.$attribute | $Price %] + [% ELSIF item.$attribute && attribute == 'itemcallnumber' %] + [% item.$attribute | html %] [% ELSE %] -

    Edit item #[% itemnumber | html %][% IF ( barcode ) %]/ Barcode [% barcode | html %][% END %]

    + [% item.$attribute | html %] [% END %] + [% END %] + + [% END %] + + +
    + [% END %] - [% IF item_templates.owned.count || item_templates.shared.count %] -
    -
    - -
    -
    - -
    -
    - -
    +
    +
    + [% INCLUDE 'biblio-view-menu.inc' %] +
    +
    -
    - -
    +
    + + [% INCLUDE 'csrf-token.inc' %] + + [% IF (popup) %] + + [% END %] + + [% IF op != 'cud-saveitem' %] +

    Add item [% IF (circborrowernumber) %](fast cataloging)[% END %]

    + [% ELSE %] +

    Edit item #[% itemnumber | html %][% IF ( barcode ) %] / Barcode [% barcode | html %][% END %]

    + [% END %] -
    - -
    -
    + [% IF item_templates.owned.count || item_templates.shared.count %] +
    + + [% END %] + + + [% FOREACH t IN item_templates.shared %] + [% IF t.id == template_id %] + [% IF CAN_user_editcatalogue_manage_item_editor_templates %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF CAN_user_editcatalogue_manage_item_editor_templates %] + + [% ELSE %] + + [% END %] [% END %] + [% END %] + + + +
    + +
    - [% IF item_groups.size && op != 'cud-saveitem' && CAN_user_editcatalogue_manage_item_groups %] -
    - Add to item group - [% FOREACH ig IN item_groups %] - - [% END %] -
      -
    1. - - -
    2. -
      -
    3. - - - Required -
    4. -
    5. - - -
      Display order must be numerical
      -
    6. -
      -
    -
    + + +
    + [% END %] + +
    + [% PROCESS subfields_for_item subfields => subfields %] +
    + [% IF op != 'add_item' %] + + [% END %] + +[% IF item_groups.size && op != 'cud-saveitem' && CAN_user_editcatalogue_manage_item_groups %] +
    + Add to item group + [% FOREACH ig IN item_groups %] + + [% END %] +
      +
    1. + + +
    2. +
      +
    3. + + + Required +
    4. +
    5. + + +
      Display order must be numerical
      +
    6. +
      +
    +
    +[% END %] -
    - [% IF op != 'cud-saveitem' %] - - - - - - - - - -
    - - - - Cancel -

    Maximum currently set to 1000. The barcode you enter will be incremented for each additional item.

    -
    + + + + + + + +
    + + + Cancel +

    Maximum currently set to 1000. The barcode you enter will be incremented for each additional item.

    +
    - - - -
    - Save template -
    - -
    + + + +
    + Save template +
    + +
    + +
    + + + + Required + +
    -
    - - - - Required - -
    +
    + +
    -
    - -
    +
    + + Cancel +
    +
    -
    - - Cancel -
    -
    - [% ELSE %] - [% IF op != 'add_item' %] - - [% END %] - - - Cancel - [% END %]
    + [% ELSE %] + [% IF op != 'add_item' %] + + [% END %] + + + Cancel + [% END %] - [%# Fields for fast cataloging %] - - - - - [%# End fields for fast cataloging %] - + [%# Fields for fast cataloging %] + + + + + [%# End fields for fast cataloging %] - [% INCLUDE 'modals/cataloguing_create_av.inc' %] -
    - -
    - -
    - -
    - + + + + [% INCLUDE 'modals/cataloguing_create_av.inc' %] + +
    + + + [% END %] [% MACRO jsinclude BLOCK %] [% END %] -[% INCLUDE 'intranet-bottom.inc' %] +[% INCLUDE 'intranet-bottom.inc' %] \ No newline at end of file -- 2.39.5