From a089e061d29c98822e1270a72a66c1c87c79417e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 2 Mar 2023 10:56:42 +0100 Subject: [PATCH] Bug 33104: Make the code reusable We could then reuse it for the contacts code in this same template, on another bug report. Signed-off-by: Jonathan Field Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/acqui/supplier.tt | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt index ea7263ec17..2543a8c1e1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt @@ -569,13 +569,25 @@ n.append("" + _("Interface details") + ""); n.append(``); let ol = $('
    '); - ol.append(`
  1. `); - ol.append(`
  2. `); - ol.append(`
  3. `); - ol.append(`
  4. `); - ol.append(`
  5. `); - ol.append(`
  6. `); - ol.append(`
  7. `); + let attributes = [ + { label: _("Name"), name: 'name', node: 'input' }, + { label: _("Type"), name: 'type', node: 'input' }, + { label: _("URI"), name: 'uri', node: 'input' }, + { label: _("Login"), name: 'login', node: 'input' }, + { label: _("Password"), name: 'password', node: 'input' }, + { label: _("Account email"), name: 'account_email', node: 'input' }, + { label: _("Notes"), name: 'notes', node: 'textarea' } + ]; + attributes.forEach((attribute, ii) => { + let li = $('
  8. '); + li.append(``); + if( attribute.node == 'input' ) { + li.append(``); + } else if ( attribute.node == 'textarea' ) { + li.append(``); + } + ol.append(li); + }); ol.append(`
  9. `); n.append(ol); nodes.append(n); -- 2.39.5