From c42639a67db1eee2363aa4745dd0d0c7e95f5715 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 20 Jun 2016 11:45:10 +0000 Subject: [PATCH] Bug 15707 [QA Followup] - Allow object names to be styled without impeding translation --- Koha/Template/Plugin/KohaSpan.pm | 43 ++++++++++++++++++++++ .../prog/en/modules/admin/library_groups.tt | 9 +++-- 2 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 Koha/Template/Plugin/KohaSpan.pm diff --git a/Koha/Template/Plugin/KohaSpan.pm b/Koha/Template/Plugin/KohaSpan.pm new file mode 100644 index 0000000..6286116 --- /dev/null +++ b/Koha/Template/Plugin/KohaSpan.pm @@ -0,0 +1,43 @@ +package Koha::Template::Plugin::KohaSpan; + +# Copyright ByWater Solutions 2016 +# Author: Kyle M Hall + +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Template::Plugin::Filter; +use base qw( Template::Plugin::Filter ); + +our $DYNAMIC = 1; + +sub filter { + my ( $self, $text, $args, $config ) = @_; + + $config->{with_hours} //= 0; + my $id = $config->{id}; + my $class = $config->{class}; + + my $span = "Koha › Administration › Library groups [% INCLUDE 'doc-head-close.inc' %] @@ -94,17 +95,17 @@ [% IF added %]
[% IF added.branchcode %] - [% added.library.branchname %] added to group. + [% added.library.branchname | $KohaSpan class = 'name' %] added to group. [% ELSE %] - Group [% added.title %] created. + Group [% added.title | $KohaSpan class = 'name' %] created. [% END %]
[% ELSIF deleted %]
[% IF deleted.title %] - Group [% deleted.title %] has been deleted. + Group [% deleted.title | $KohaSpan class = 'name' %] has been deleted. [% ELSE %] - [% deleted.library %] has been removed from group. + [% deleted.library | $KohaSpan class = 'name' %] has been removed from group. [% END %]
[% END %] -- 2.1.4