From c69958ddd5724f11b0e3b59d18238b5fb79a881e Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 11 Nov 2024 18:17:13 +0000 Subject: [PATCH] Bug 36221: (follow-up) Style and markup fixes This patch makes several changes to make the updated forms more consistent with how other pages work: - Form labels should have ":" after them. - Form fields should have a hint when they are required. - Required fields should not be indicated with an asterisk. - In the OPAC, + + Required
  • @@ -104,11 +104,12 @@ [% END %] + Required
  • - + Cancel
    diff --git a/Koha/ILL/Backend/intra-includes/migrate.inc b/Koha/ILL/Backend/intra-includes/migrate.inc index ea85d7e1e8..0fbbe91aab 100644 --- a/Koha/ILL/Backend/intra-includes/migrate.inc +++ b/Koha/ILL/Backend/intra-includes/migrate.inc @@ -2,11 +2,11 @@ [% IF whole.status == 'missing_identifier' %]

    Please Note: Mandatory field Identifier is missing.

    [% ELSIF whole.status == 'missing_branch' %] -

    Please Note: Branch is a mandatory field.

    +

    Please Note: Library is a mandatory field.

    [% ELSIF whole.status == 'invalid_borrower' %] -

    Please Note: The borrower details you entered are invalid.

    +

    Please Note: The patrons details you entered are invalid.

    [% ELSIF whole.status == 'invalid_branch' %] -

    Please Note: The branch you chose is invalid.

    +

    Please Note: The library you chose is invalid.

    [% ELSE %]

    Unhandled error

    [% END %] @@ -20,8 +20,8 @@
    1. - + [% IF whole.value.other.type.lower == "book" %] [% ELSE %] @@ -68,6 +68,9 @@ [% END %] + [% IF required %] +
      Required
      + [% END %]
    @@ -84,19 +87,20 @@ - + +
    Required
  • - + xxx +
    Required
  • diff --git a/Koha/ILL/Backend/opac-includes/create.inc b/Koha/ILL/Backend/opac-includes/create.inc index 13078deae2..3e8f5581c4 100644 --- a/Koha/ILL/Backend/opac-includes/create.inc +++ b/Koha/ILL/Backend/opac-includes/create.inc @@ -3,15 +3,25 @@ [% PROCESS "${cwd}/shared-includes/form_input_helpers.inc" %] [% IF whole.error %] [% IF whole.status == 'missing_identifier' %] -

    Please Note: Mandatory field Identifier is missing.

    +
    + Please note: Mandatory field Identifier is missing. +
    [% ELSIF whole.status == 'missing_type' %] -

    Please Note: Type is a mandatory field.

    +
    + Please note: Type is a mandatory field. +
    [% ELSIF whole.status == 'missing_branch' %] -

    Please Note: Branch is a mandatory field.

    +
    + Please note: Library is a mandatory field. +
    [% ELSIF whole.status == 'invalid_borrower' %] -

    Please Note: The borrower details you entered are invalid.

    +
    + Please note: The patron details you entered are invalid. +
    [% ELSIF whole.status == 'invalid_branch' %] -

    Please Note: The branch you chose is invalid.

    +
    + Please note: The library you chose is invalid. +
    [% ELSE %]

    Unhandled error

    [% END %] @@ -25,12 +35,11 @@
    Patron options
      -
    1. [% WRAPPER ill_select_field required = 1 id = 'branchcode' label = t('Destination library') %] - [% FOREACH branch IN branches %] [% IF whole.value.other.branchcode && branch.branchcode == whole.value.other.branchcode %] - [% ELSE %] @@ -40,15 +49,13 @@ [% END %] [% END %] [% END #ill_select_field %] -
    General details
      - [% WRAPPER ill_select_field required = 1 id = 'type' label = t('Type') %] -
    1. - [% IF whole.value.other.type.lower == "book" %] [% ELSE %] @@ -94,8 +101,7 @@ [% ELSE %] [% END %] -
    2. - [% END #ill_select_field %] + [% END #ill_select_field %]
    [% type = whole.value.other.type %] @@ -122,4 +128,4 @@ [% INCLUDE "${cwd}/shared-includes/shared.js" %] // ]]> -[% END %] \ No newline at end of file +[% END %] diff --git a/Koha/ILL/Backend/shared-includes/form_input_helpers.inc b/Koha/ILL/Backend/shared-includes/form_input_helpers.inc index 63b42a3482..5ac8be9b86 100644 --- a/Koha/ILL/Backend/shared-includes/form_input_helpers.inc +++ b/Koha/ILL/Backend/shared-includes/form_input_helpers.inc @@ -1,25 +1,33 @@ [% BLOCK ill_text_input_field %]
  • - - [% IF opac %] - - [% ELSE %] - - [% END %] + + [% IF opac %] + + [% ELSE %] + + [% END %] + [% IF required %] +
    Required
    + [% END %] + [% SET required = 0 %]
  • - [% SET required = 0 %] [% END %] [% BLOCK ill_select_field %] - - [% IF opac %] - - [% END %] - [% content | $raw %] - - [% SET required = 0 %] +
  • + + [% IF opac %] + + [% END %] + [% content | $raw %] + + [% IF required %] +
    Required
    + [% END %] + [% SET required = 0 %] +
  • [% END %] [% BLOCK book_text_input_fields %] @@ -41,4 +49,4 @@ [% PROCESS ill_text_input_field id = 'issue' label = t('Issue number') value = whole.value.other.issue %] [% PROCESS ill_text_input_field id = 'year' label = t('Year') value = whole.value.other.year %] [% PROCESS ill_text_input_field id = 'issn' label = t('ISSN') value = whole.value.other.issn %] -[% END %] \ No newline at end of file +[% END %] diff --git a/Koha/ILL/Backend/shared-includes/shared.js b/Koha/ILL/Backend/shared-includes/shared.js index a341464e83..12db43984d 100644 --- a/Koha/ILL/Backend/shared-includes/shared.js +++ b/Koha/ILL/Backend/shared-includes/shared.js @@ -12,8 +12,9 @@ document.addEventListener('DOMContentLoaded', function() { ( opac ? 'form-control input-fluid custom-field-input' : '') +'" placeholder="'+__('value')+'"> ' + ''; + ' ' + + __('Delete') + + ''; $('#standard-fields').append(row); }); $('#standard-fields').on('click', '.delete-new-field', @@ -31,7 +32,7 @@ document.addEventListener('DOMContentLoaded', function() { $('#standard-fields').on('keyup', '.custom-name', function() { var val = $(this).val(); if (core.indexOf(val.toLowerCase()) > -1) { - $('#custom-warning').text(_('The name "' + val + '" is not permitted')).show(); + $('#custom-warning').text(__('The name "' + val + '" is not permitted')).show(); $('#ill-submit').attr('disabled', true); $('#add-new-fields').attr('disabled', true); } else { -- 2.39.5