From a46b3b4de0209f44bdd448c8669a69ba83fed23d Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 14 Jul 2014 08:33:48 -0400 Subject: [PATCH] Bug 2889 - templates should use [% IF ( loop.odd ) %] - Administration Some scripts pass a template variable to facilitate an alternate table row class for styling. Other use the 'IF (loop.odd)' construction. I think we're at the point where the CSS3 :nth-child() selector is widely-supported enough that we can do without template-based solutions: http://caniuse.com/#feat=css-sel3 This patch adds such a selector to the staff client CSS and removes the corresponding template markup from Administration pages. The last in this series of patches will remove the redundant CSS. Also in this patch: a few minor markup corrections. To test, apply the patch and clear your browser cache if necessary. View the following pages and confirm that alternate table row highlighting works as before: - Administration -> Budgets - Acquisitions -> Vendor -> Contracts - Administration -> Budgets -> Budget -> Planning - Administration -> Authority types - Administration -> Authority types -> MARC structure - Administration -> Authority types -> MARC structure -> subfields - Administration -> MARC bibliographic framework - Administration -> MARC bibliographic framework -> MARC structure - Administration -> MARC bibliographic framework -> MARC structure -> Subfields - Administration -> Libraries and groups - Administration -> Cities and towns - Administration -> Classification sources - Administration -> Circulation and fines rules - Administration -> Currencies and exchange rates - Administration -> Item types - Administration -> Koha to MARC mapping - Administration -> System preferences -> Local use - Administration -> Z39.50 client targets Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- .../prog/en/css/staff-global.css | 1 + .../prog/en/modules/admin/aqbudgetperiods.tt | 6 +-- .../prog/en/modules/admin/aqcontract.tt | 2 +- .../prog/en/modules/admin/aqplan.tt | 2 +- .../modules/admin/auth_subfields_structure.tt | 4 -- .../en/modules/admin/auth_tag_structure.tt | 50 +++++++++---------- .../prog/en/modules/admin/authtypes.tt | 4 -- .../prog/en/modules/admin/biblio_framework.tt | 4 +- .../modules/admin/branch_transfer_limits.tt | 2 +- .../prog/en/modules/admin/branches.tt | 6 +-- .../prog/en/modules/admin/cities.tt | 6 +-- .../prog/en/modules/admin/classsources.tt | 4 -- .../prog/en/modules/admin/clone-rules.tt | 2 +- .../prog/en/modules/admin/itemtypes.tt | 6 +-- .../prog/en/modules/admin/koha2marclinks.tt | 4 -- .../modules/admin/marc_subfields_structure.tt | 4 -- .../prog/en/modules/admin/marctagstructure.tt | 2 +- .../prog/en/modules/admin/printers.tt | 2 +- .../prog/en/modules/admin/smart-rules.tt | 4 -- .../prog/en/modules/admin/stopwords.tt | 4 +- .../en/modules/admin/systempreferences.tt | 2 +- .../prog/en/modules/admin/z3950servers.tt | 6 +-- 22 files changed, 40 insertions(+), 87 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index 382701b4c8..0f6741661d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -260,6 +260,7 @@ table+table { .highlighted-row { background-color: orange !important } +tbody tr:nth-child(odd) td, tr.highlight td, tr.highlight th, tr.odd td, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt index 51b8b8a3dd..be498606de 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt @@ -570,11 +570,7 @@ [% FOREACH period_loo IN period_inactive_loop %] - [% IF ( loop.odd ) %] - - [% ELSE %] - - [% END %] + [% period_loo.budget_period_description %] [% period_loo.budget_period_startdate | $KohaDates %] [% period_loo.budget_period_enddate | $KohaDates %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt index afbabfdafa..ed8336a9af 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt @@ -181,7 +181,7 @@ function Check(ff) {   [% FOREACH loo IN loop %] - [% IF ( loop.even ) %][% ELSE %][% END %] + [% loo.contractname %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt index d5d89066bd..65cd9c4e18 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt @@ -125,7 +125,7 @@ [% FOREACH budget_line IN budget_lines %] - [% UNLESS ( loop.odd ) %][% ELSE %][% END %] + [% IF ( budget_line.budget_lock ) %] [% ELSE %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt index bc72266510..f7b1d52e0f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt @@ -262,11 +262,7 @@ function displayMoreConstraint(numlayer){ Delete [% FOREACH loo IN loop %] - [% UNLESS ( loop.odd ) %] - - [% ELSE %] - [% END %] [% loo.tagsubfield %] [% IF ( loo.subfield_ignored ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt index 87c55b4ac4..eabcf9ea91 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt @@ -54,7 +54,7 @@ [% ELSE %]Default framework [% END %] › Data deleted [% ELSE %] - [% IF ( authtypecode ) %][% authtypecode %] Framework + [% IF ( authtypecode ) %][% authtypecode %] Framework [% ELSE %]Default framework [% END %] [% END %] @@ -200,31 +200,31 @@ - - - - - - - - + + + + + + + + + + - [% FOREACH loo IN loop %] - [% UNLESS ( loop.odd ) %] - - [% ELSE %] - - [% END %] - - - - - - - - - - [% END %] + + [% FOREACH loo IN loop %] + + + + + + + + + + + [% END %] +
TagLibRepeatableMandatoryAuthorized
value
SubfieldsEditDelete
TagLibRepeatableMandatoryAuthorized
value
SubfieldsEditDelete
[% loo.tagfield %][% loo.liblibrarian %][% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %][% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %][% loo.authorised_value %]subfieldsEditDelete
[% loo.tagfield %][% loo.liblibrarian %][% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %][% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %][% loo.authorised_value %]subfieldsEditDelete
[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt index dcc606df11..2c12808e81 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt @@ -104,11 +104,7 @@ [% FOREACH loo IN loop %] - [% IF ( loop.odd ) %] - [% ELSE %] - - [% END %] [% loo.authtypecode %] [% loo.authtypetext %] [% loo.summary %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt index fcba389d80..791e971e32 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt @@ -220,9 +220,7 @@ [% FOREACH loo IN loop %] - [% IF ( loop.odd ) %] - [% ELSE %] - [% END %] + [% loo.frameworkcode %] [% loo.frameworktext %] MARC structure diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt index 7e8165f957..375152ca35 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt @@ -95,7 +95,7 @@ [% FOREACH to_branch_loo IN codes_loo.to_branch_loop %] - [% UNLESS ( loop.odd ) %][% ELSE %][% END %] + [% IF ( to_branch_loo.isChecked ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt index f12107f9e3..df49e26c12 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt @@ -186,11 +186,7 @@ tinyMCE.init({   [% FOREACH branche IN branches %] - [% IF ( loop.odd ) %] - - [% ELSE %] - - [% END %] + [% branche.branch_name |html %] [% branche.branch_code |html %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt index 02656343a6..fa5629ccdb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt @@ -131,11 +131,7 @@   [% FOREACH loo IN loop %] - [% UNLESS ( loop.odd ) %] - - [% ELSE %] - - [% END %] + [% loo.cityid %] [% loo.city_name %] [% loo.city_state %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tt index 140c0335ec..8f9446fa63 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tt @@ -250,11 +250,7 @@ function CheckRuleForm(f) { Actions [% FOREACH class_source IN class_sources %] - [% IF ( loop.odd ) %] - [% ELSE %] - - [% END %] [% class_source.code %] [% class_source.description %] [% IF ( class_source.used ) %]Yes[% ELSE %]No[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tt index 74d6ef451d..146b203f55 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tt @@ -1,5 +1,5 @@ [% INCLUDE 'doc-head-open.inc' %] -Koha › Administration › Issuing Rules › Clone Issuing Rules +Koha › Administration › Issuing rules › Clone issuing rules [% INCLUDE 'doc-head-close.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt index 522420be0a..9a691fb663 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt @@ -266,11 +266,7 @@ Item types administration Actions [% FOREACH loo IN loop %] - [% UNLESS ( loop.odd ) %] - - [% ELSE %] - - [% END %] + [% UNLESS ( noItemTypeImages ) %] [% IF ( loo.imageurl ) %][% ELSE %] [% END %][% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt index 35134fa357..a96dd7d41b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt @@ -92,11 +92,7 @@   [% FOREACH loo IN loop %] -[% UNLESS ( loop.odd ) %] - -[% ELSE %] -[% END %] [% loo.kohafield %] [% loo.tagfield %] [% loo.tagsubfield %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt index c12ddf1331..bfa88158fe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt @@ -391,11 +391,7 @@ function populateHiddenCheckboxes(tab) { Delete [% FOREACH loo IN loop %] -[% UNLESS ( loop.odd ) %] - -[% ELSE %] -[% END %] [% loo.tagsubfield %] [% IF ( loo.subfield_ignored ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt index 219389dc21..049f419583 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt @@ -192,7 +192,7 @@ $(document).ready(function() { [% IF ( select_display ) %] [% FOREACH loo IN loop %] - [% IF ( loop.odd ) %][% ELSE %][% END %] + [% loo.tagfield %] [% loo.liblibrarian %] [% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tt index 151e8d6ff8..0e77e8b836 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tt @@ -164,7 +164,7 @@   [% FOREACH loo IN loop %] - [% IF ( loop.odd ) %][% ELSE %][% END %] + [% loo.printername %] [% loo.printqueue %] [% loo.printtype %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt index 535c740eba..8bc5809e61 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -162,11 +162,7 @@ for="tobranch">Clone these rules to: - [% ELSE %] - [% END %] [% IF ( rule.default_humancategorycode ) %] All [% ELSE %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/stopwords.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/stopwords.tt index 6ba5697433..db1016feb1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/stopwords.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/stopwords.tt @@ -120,9 +120,7 @@ [% FOREACH loo IN loop %] - [% IF ( loop.odd ) %] - [% ELSE %] - [% END %] + [% loo.word %] Delete diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt index 6ca3274a30..2d27d8303d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt @@ -264,7 +264,7 @@ [% END %] [% FOREACH loo IN loop %] - [% UNLESS ( loop.odd ) %][% ELSE %][% END %] + [% loo.variable %] [% loo.explanation |html %] [% IF ( loo.oneline ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt index 10298cece2..fd272341e9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt @@ -216,11 +216,7 @@ [% FOREACH loo IN loop %] - [% UNLESS ( loop.odd ) %] - - [% ELSE %] - - [% END %] + [% loo.servername %][% loo.host %]:[% loo.port %][% loo.db %][% loo.userid %][% IF loo.password %]########[% END %][% IF ( loo.checked ) %]Yes[% ELSE %]No[% END %][% loo.rank %] [% loo.syntax %][% loo.encoding %][% loo.timeout %] [% IF ( loo.recordtype == 'biblio' ) %] -- 2.39.5