From 6d3bd2ce5af12f898286225f7141f1732594d589 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. --- .../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 c68f1cfcc3a..5f50130d58a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt @@ -580,13 +580,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.25.1