From 0714c107e8f8355aec7bb96b627f95561de13bac 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 Content-Type: text/plain; charset="utf-8" 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 --- .../intranet-tmpl/prog/en/css/staff-global.css | 1 + .../prog/en/modules/admin/aqbudgetperiods.tt | 6 +-- .../prog/en/modules/admin/aqcontract.tt | 2 +- .../intranet-tmpl/prog/en/modules/admin/aqplan.tt | 2 +- .../en/modules/admin/auth_subfields_structure.tt | 4 -- .../prog/en/modules/admin/auth_tag_structure.tt | 50 ++++++++++---------- .../prog/en/modules/admin/authtypes.tt | 4 -- .../prog/en/modules/admin/biblio_framework.tt | 4 +- .../en/modules/admin/branch_transfer_limits.tt | 2 +- .../prog/en/modules/admin/branches.tt | 6 +-- .../intranet-tmpl/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 -- .../en/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 +- .../prog/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 382701b..0f67416 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 51b8b8a..be49860 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 afbabfd..ed8336a 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 d5d8906..65cd9c4 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 bc72266..f7b1d52 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 87c55b4..eabcf9e 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 dcc606d..2c12808 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 fcba389..791e971 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 7e8165f..375152c 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 f12107f..df49e26 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 0265634..fa5629c 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 140c033..8f9446f 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 74d6ef4..146b203 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 522420b..9a691fb 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 35134fa..a96dd7d 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 c12ddf1..bfa8815 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 219389d..049f419 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 151e8d6..0e77e8b 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 535c740..8bc5809 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 6ba5697..db1016f 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 6ca3274..2d27d83 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 10298ce..fd27234 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' ) %] -- 1.7.9.5