View | Details | Raw Unified | Return to bug 26392
Collapse All | Expand All

(-)a/Koha/Template/Plugin/Expand.pm (+58 lines)
Line 0 Link Here
1
package Koha::Template::Plugin::Expand;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use Koha::I18N;
21
22
use base qw( Template::Plugin::Filter );
23
24
our $DYNAMIC = 1;
25
26
=head1 SYNOPSIS
27
28
    [% USE Expand %]
29
    [% PROCESS 'i18n.inc' %]
30
31
    [% t('Hello {name}') | html | $Expand name = "<strong>World !</strong>" %]
32
33
=head1 DESCRIPTION
34
35
This module is a Template::Toolkit filter that allows to replace portions of
36
text enclosed in braces by the content of a variable
37
38
Its main purpose is to be used with i18n macros : it allows translations to be
39
filtered (with the html filter for instance) while allowing variables to have
40
content that should not be filtered
41
42
=cut
43
44
=head1 METHODS
45
46
=head2 filter
47
48
See L<Template::Plugin::Filter>
49
50
=cut
51
52
sub filter {
53
    my ( $self, $text, $args, $conf ) = @_;
54
55
    return Koha::I18N::_expand($text, %$conf);
56
}
57
58
1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/i18n.inc (-9 / +9 lines)
Lines 2-38 Link Here
2
[% USE raw %]
2
[% USE raw %]
3
3
4
[% MACRO t(msgid) BLOCK %]
4
[% MACRO t(msgid) BLOCK %]
5
    [% I18N.t(msgid) | $raw %]
5
    [%~ I18N.t(msgid) | $raw ~%]
6
[% END %]
6
[% END %]
7
7
8
[% MACRO tx(msgid, vars) BLOCK %]
8
[% MACRO tx(msgid, vars) BLOCK %]
9
    [% I18N.tx(msgid, vars) | $raw %]
9
    [%~ I18N.tx(msgid, vars) | $raw ~%]
10
[% END %]
10
[% END %]
11
11
12
[% MACRO tn(msgid, msgid_plural, count) BLOCK %]
12
[% MACRO tn(msgid, msgid_plural, count) BLOCK %]
13
    [% I18N.tn(msgid, msgid_plural, count) | $raw %]
13
    [%~ I18N.tn(msgid, msgid_plural, count) | $raw ~%]
14
[% END %]
14
[% END %]
15
15
16
[% MACRO tnx(msgid, msgid_plural, count, vars) BLOCK %]
16
[% MACRO tnx(msgid, msgid_plural, count, vars) BLOCK %]
17
    [% I18N.tnx(msgid, msgid_plural, count, vars) | $raw %]
17
    [%~ I18N.tnx(msgid, msgid_plural, count, vars) | $raw ~%]
18
[% END %]
18
[% END %]
19
19
20
[% MACRO txn(msgid, msgid_plural, count, vars) BLOCK %]
20
[% MACRO txn(msgid, msgid_plural, count, vars) BLOCK %]
21
    [% I18N.txn(msgid, msgid_plural, count, vars) | $raw %]
21
    [%~ I18N.txn(msgid, msgid_plural, count, vars) | $raw ~%]
22
[% END %]
22
[% END %]
23
23
24
[% MACRO tp(msgctxt, msgid) BLOCK %]
24
[% MACRO tp(msgctxt, msgid) BLOCK %]
25
    [% I18N.tp(msgctxt, msgid) | $raw %]
25
    [%~ I18N.tp(msgctxt, msgid) | $raw ~%]
26
[% END %]
26
[% END %]
27
27
28
[% MACRO tpx(msgctxt, msgid, vars) BLOCK %]
28
[% MACRO tpx(msgctxt, msgid, vars) BLOCK %]
29
    [% I18N.tpx(msgctxt, msgid, vars) | $raw %]
29
    [%~ I18N.tpx(msgctxt, msgid, vars) | $raw ~%]
30
[% END %]
30
[% END %]
31
31
32
[% MACRO tnp(msgctxt, msgid, msgid_plural, count) BLOCK %]
32
[% MACRO tnp(msgctxt, msgid, msgid_plural, count) BLOCK %]
33
    [% I18N.tnp(msgctxt, msgid, msgid_plural, count) | $raw %]
33
    [%~ I18N.tnp(msgctxt, msgid, msgid_plural, count) | $raw ~%]
34
[% END %]
34
[% END %]
35
35
36
[% MACRO tnpx(msgctxt, msgid, msgid_plural, count, vars) BLOCK %]
36
[% MACRO tnpx(msgctxt, msgid, msgid_plural, count, vars) BLOCK %]
37
    [% I18N.tnpx(msgctxt, msgid, msgid_plural, count, vars) | $raw %]
37
    [%~ I18N.tnpx(msgctxt, msgid, msgid_plural, count, vars) | $raw ~%]
38
[% END %]
38
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/i18n.inc (-9 / +9 lines)
Lines 2-38 Link Here
2
[% USE raw %]
2
[% USE raw %]
3
3
4
[% MACRO t(msgid) BLOCK %]
4
[% MACRO t(msgid) BLOCK %]
5
    [% I18N.t(msgid) | $raw %]
5
    [%~ I18N.t(msgid) | $raw ~%]
6
[% END %]
6
[% END %]
7
7
8
[% MACRO tx(msgid, vars) BLOCK %]
8
[% MACRO tx(msgid, vars) BLOCK %]
9
    [% I18N.tx(msgid, vars) | $raw %]
9
    [%~ I18N.tx(msgid, vars) | $raw ~%]
10
[% END %]
10
[% END %]
11
11
12
[% MACRO tn(msgid, msgid_plural, count) BLOCK %]
12
[% MACRO tn(msgid, msgid_plural, count) BLOCK %]
13
    [% I18N.tn(msgid, msgid_plural, count) | $raw %]
13
    [%~ I18N.tn(msgid, msgid_plural, count) | $raw ~%]
14
[% END %]
14
[% END %]
15
15
16
[% MACRO tnx(msgid, msgid_plural, count, vars) BLOCK %]
16
[% MACRO tnx(msgid, msgid_plural, count, vars) BLOCK %]
17
    [% I18N.tnx(msgid, msgid_plural, count, vars) | $raw %]
17
    [%~ I18N.tnx(msgid, msgid_plural, count, vars) | $raw ~%]
18
[% END %]
18
[% END %]
19
19
20
[% MACRO txn(msgid, msgid_plural, count, vars) BLOCK %]
20
[% MACRO txn(msgid, msgid_plural, count, vars) BLOCK %]
21
    [% I18N.txn(msgid, msgid_plural, count, vars) | $raw %]
21
    [%~ I18N.txn(msgid, msgid_plural, count, vars) | $raw ~%]
22
[% END %]
22
[% END %]
23
23
24
[% MACRO tp(msgctxt, msgid) BLOCK %]
24
[% MACRO tp(msgctxt, msgid) BLOCK %]
25
    [% I18N.tp(msgctxt, msgid) | $raw %]
25
    [%~ I18N.tp(msgctxt, msgid) | $raw ~%]
26
[% END %]
26
[% END %]
27
27
28
[% MACRO tpx(msgctxt, msgid, vars) BLOCK %]
28
[% MACRO tpx(msgctxt, msgid, vars) BLOCK %]
29
    [% I18N.tpx(msgctxt, msgid, vars) | $raw %]
29
    [%~ I18N.tpx(msgctxt, msgid, vars) | $raw ~%]
30
[% END %]
30
[% END %]
31
31
32
[% MACRO tnp(msgctxt, msgid, msgid_plural, count) BLOCK %]
32
[% MACRO tnp(msgctxt, msgid, msgid_plural, count) BLOCK %]
33
    [% I18N.tnp(msgctxt, msgid, msgid_plural, count) | $raw %]
33
    [%~ I18N.tnp(msgctxt, msgid, msgid_plural, count) | $raw ~%]
34
[% END %]
34
[% END %]
35
35
36
[% MACRO tnpx(msgctxt, msgid, msgid_plural, count, vars) BLOCK %]
36
[% MACRO tnpx(msgctxt, msgid, msgid_plural, count, vars) BLOCK %]
37
    [% I18N.tnpx(msgctxt, msgid, msgid_plural, count, vars) | $raw %]
37
    [%~ I18N.tnpx(msgctxt, msgid, msgid_plural, count, vars) | $raw ~%]
38
[% END %]
38
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt (-28 / +45 lines)
Lines 1-3 Link Here
1
[% PROCESS 'i18n.inc' %]
1
[% USE raw %]
2
[% USE raw %]
2
[% USE Koha %]
3
[% USE Koha %]
3
[% USE KohaDates %]
4
[% USE KohaDates %]
Lines 5-15 Link Here
5
[% USE Categories %]
6
[% USE Categories %]
6
[% USE Price %]
7
[% USE Price %]
7
[% USE KohaNews %]
8
[% USE KohaNews %]
9
[% USE Expand %]
8
[% SET OpacNavRight = KohaNews.get( location => "OpacNavRight", lang => lang, library => branchcode ) %]
10
[% SET OpacNavRight = KohaNews.get( location => "OpacNavRight", lang => lang, library => branchcode ) %]
9
[% SET OpacMainUserBlock = KohaNews.get( location => "OpacMainUserBlock", lang => lang, library => branchcode ) %]
11
[% SET OpacMainUserBlock = KohaNews.get( location => "OpacMainUserBlock", lang => lang, library => branchcode ) %]
10
[% SET OpacLoginInstructions = KohaNews.get( location => "OpacLoginInstructions", lang => lang, library => branchcode ) %]
12
[% SET OpacLoginInstructions = KohaNews.get( location => "OpacLoginInstructions", lang => lang, library => branchcode ) %]
11
[% INCLUDE 'doc-head-open.inc' %]
13
[% INCLUDE 'doc-head-open.inc' %]
12
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
14
<title>[% IF ( LibraryNameTitle ) %][% tx('{LibraryNameTitle} catalog', LibraryNameTitle = LibraryNameTitle) | html %][% ELSE %][% t('Koha online catalog') | html %][% END %]</title>
13
[% INCLUDE 'doc-head-close.inc' %]
15
[% INCLUDE 'doc-head-close.inc' %]
14
[% BLOCK cssinclude %][% END %]
16
[% BLOCK cssinclude %][% END %]
15
</head>
17
</head>
Lines 18-24 Link Here
18
20
19
<div class="main">
21
<div class="main">
20
    <ul class="breadcrumb">
22
    <ul class="breadcrumb">
21
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a>
23
        <li><a href="/cgi-bin/koha/opac-main.pl">[% t('Home') | html %]</a>
22
        [% IF news_item %]
24
        [% IF news_item %]
23
            <span class="divider">&rsaquo;</span></li>
25
            <span class="divider">&rsaquo;</span></li>
24
            <li>[% news_item.title | html %]</li>
26
            <li>[% news_item.title | html %]</li>
Lines 58-69 Link Here
58
        [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
60
        [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
59
            [% UNLESS news_item %]
61
            [% UNLESS news_item %]
60
                <form id="news-branch-select" class="form-inline" name="news-branch-select" method="get" action="/cgi-bin/koha/opac-main.pl">
62
                <form id="news-branch-select" class="form-inline" name="news-branch-select" method="get" action="/cgi-bin/koha/opac-main.pl">
61
                    <label for="news-branch">Display news for: </label>
63
                    <label for="news-branch">[% t('Display news for:') | html %] </label>
62
                    <select id="news-branch" name="branch">
64
                    <select id="news-branch" name="branch">
63
                        [% IF ( branchcode == "" ) %]
65
                        [% IF ( branchcode == "" ) %]
64
                            <option value="" selected="selected">System-wide only</option>
66
                            <option value="" selected="selected">[% t('System-wide only') | html %]</option>
65
                        [% ELSE %]
67
                        [% ELSE %]
66
                            <option value="">System-wide only</option>
68
                            <option value="">[% t('System-wide only') | html %]</option>
67
                        [% END %]
69
                        [% END %]
68
                        [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
70
                        [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
69
                    </select>
71
                    </select>
Lines 76-82 Link Here
76
            [% IF single_news_error %]
78
            [% IF single_news_error %]
77
79
78
                <div class="alert alert-error">
80
                <div class="alert alert-error">
79
                    This news item does not exist.
81
                    [% t('This news item does not exist.') | html %]
80
                </div>
82
                </div>
81
83
82
            [% ELSE %]
84
            [% ELSE %]
Lines 94-105 Link Here
94
                            </h4>
96
                            </h4>
95
                            <div class="newsbody">[% koha_new.content | $raw %]</div>
97
                            <div class="newsbody">[% koha_new.content | $raw %]</div>
96
                            <div class="newsfooter">
98
                            <div class="newsfooter">
97
                                Published on [% koha_new.published_on | $KohaDates %]
99
                                [% published_on = BLOCK %][% koha_new.published_on | $KohaDates %][% END %]
98
                                [% IF ( (newsdisp == 'opac' || newsdisp == 'both') && koha_new.borrowernumber ) %]
100
                                [% author = BLOCK %]
99
                                    by <span class="newsauthor_title">[% koha_new.author_title | html %] </span>[% koha_new.author_firstname | html %] [% koha_new.author_surname | html %]
101
                                    [% IF ( (newsdisp == 'opac' || newsdisp == 'both') && koha_new.borrowernumber ) %]
102
                                        <span class="newsauthor_title">[% koha_new.author_title | html %] </span>[% koha_new.author_firstname | html %] [% koha_new.author_surname | html %]
103
                                    [% END %]
104
                                [% END %]
105
                                [% IF author %]
106
                                    [% t('Published on {published_on} by {author}') | html | $Expand published_on = published_on, author = author %]
107
                                [% ELSE %]
108
                                    [% t('Published on {published_on}') | html | $Expand published_on = published_on %]
100
                                [% END %]
109
                                [% END %]
101
                                [% IF ( news_item ) %]
110
                                [% IF ( news_item ) %]
102
                                    &bull; <a href="/cgi-bin/koha/opac-main.pl">Show all news</a>
111
                                    &bull; <a href="/cgi-bin/koha/opac-main.pl">[% t('Show all news') | html %]</a>
103
                                [% END %]
112
                                [% END %]
104
                            </div>
113
                            </div>
105
                        </div>
114
                        </div>
Lines 112-126 Link Here
112
                                <i class="fa fa-rss" aria-hidden="true"></i>
121
                                <i class="fa fa-rss" aria-hidden="true"></i>
113
                                [% IF Branches.all.size == 1 %]
122
                                [% IF Branches.all.size == 1 %]
114
                                    [% IF branchcode %]
123
                                    [% IF branchcode %]
115
                                        RSS feed for [% Branches.GetName( branchcode ) | html %] library news
124
                                        [% libraryName = BLOCK %][% Branches.GetName(branchcode) | html %][% END %]
125
                                        [% t('RSS feed for {libraryName} library news') | html | $Expand libraryName = libraryName %]
116
                                    [% ELSE %]
126
                                    [% ELSE %]
117
                                        RSS feed for library news
127
                                        [% t('RSS feed for library news') | html %]
118
                                    [% END %]
128
                                    [% END %]
119
                                [% ELSE %]
129
                                [% ELSE %]
120
                                    [% IF branchcode %]
130
                                    [% IF branchcode %]
121
                                        RSS feed for [% Branches.GetName( branchcode ) | html %] and system-wide library news
131
                                        [% libraryName = BLOCK %][% Branches.GetName(branchcode) | html %][% END %]
132
                                        [% t('RSS feed for {libraryName} and system-wide library news') | html | $Expand libraryName = libraryName %]
122
                                    [% ELSE %]
133
                                    [% ELSE %]
123
                                        RSS feed for system-wide library news
134
                                        [% t('RSS feed for system-wide library news') | html %]
124
                                    [% END %]
135
                                    [% END %]
125
                                [% END %]
136
                                [% END %]
126
                            </a>
137
                            </a>
Lines 134-140 Link Here
134
            [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
145
            [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
135
                <div id="news" class="newscontainer">
146
                <div id="news" class="newscontainer">
136
                    <div class="newsitem">
147
                    <div class="newsitem">
137
                        <div class="newsbody">No news to display.</div>
148
                        <div class="newsbody">[% t('No news to display.') | html %]</div>
138
                        <div class="newsfooter"></div>
149
                        <div class="newsfooter"></div>
139
                    </div>
150
                    </div>
140
                </div>
151
                </div>
Lines 145-151 Link Here
145
        [% UNLESS news_item # Don't show under single news item %]
156
        [% UNLESS news_item # Don't show under single news item %]
146
            [% IF ( daily_quote ) %]
157
            [% IF ( daily_quote ) %]
147
                <div id="daily-quote">
158
                <div id="daily-quote">
148
                    <h3>Quote of the day</h3>
159
                    <h3>[% t('Quote of the day') | html %]</h3>
149
                    <div>
160
                    <div>
150
                        <span id="daily-quote-text">[% daily_quote.text | html %]</span><span id="daily-quote-sep"> ~ </span><span id="daily-quote-source">[% daily_quote.source | html %]</span>
161
                        <span id="daily-quote-text">[% daily_quote.text | html %]</span><span id="daily-quote-sep"> ~ </span><span id="daily-quote-source">[% daily_quote.source | html %]</span>
151
                    </div>
162
                    </div>
Lines 170-180 Link Here
170
                                <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="auth" autocomplete="off">
181
                                <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="auth" autocomplete="off">
171
                                    <input type="hidden" name="koha_login_context" value="opac" />
182
                                    <input type="hidden" name="koha_login_context" value="opac" />
172
                                    <fieldset class="brief">
183
                                    <fieldset class="brief">
173
                                        <legend>Log in to your account:</legend>
184
                                        <legend>[% t('Log in to your account:') | html %]</legend>
174
                                        <label for="userid">Login:</label><input type="text" id="userid" name="userid" />
185
                                        <label for="userid">[% t('Login:') | html %]</label><input type="text" id="userid" name="userid" />
175
                                        <label for="password">Password:</label><input type="password" id="password" name="password" />
186
                                        <label for="password">[% t('Password:') | html %]</label><input type="password" id="password" name="password" />
176
                                        <fieldset class="action">
187
                                        <fieldset class="action">
177
                                            <input type="submit" value="Log in" class="btn" />
188
                                            <input type="submit" value="[% t('Log in') | html %]" class="btn" />
178
                                        </fieldset>
189
                                        </fieldset>
179
                                        [% IF ( OpacLoginInstructions ) %]
190
                                        [% IF ( OpacLoginInstructions ) %]
180
                                            <div id="nologininstructions-main" class="nologininstructions">
191
                                            <div id="nologininstructions-main" class="nologininstructions">
Lines 183-194 Link Here
183
                                        [% END %]
194
                                        [% END %]
184
                                        [% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
195
                                        [% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
185
                                            <div id="forgotpassword-main" class="forgotpassword">
196
                                            <div id="forgotpassword-main" class="forgotpassword">
186
                                                <p><a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a></p>
197
                                                <p><a href="/cgi-bin/koha/opac-password-recovery.pl">[% t('Forgot your password?') | html %]</a></p>
187
                                            </div>
198
                                            </div>
188
                                        [% END %]
199
                                        [% END %]
189
                                        [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]
200
                                        [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]
190
                                            <div id="patronregistration-main" class="patronregistration">
201
                                            <div id="patronregistration-main" class="patronregistration">
191
                                                <p>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></p>
202
                                                <p>[% t('Don\'t have an account?') | html %] <a href="/cgi-bin/koha/opac-memberentry.pl">[% t('Register here.') | html %]</a></p>
192
                                            </div>
203
                                            </div>
193
                                        [% END %]
204
                                        [% END %]
194
                                    </fieldset>
205
                                    </fieldset>
Lines 198-219 Link Here
198
                    [% ELSE %]
209
                    [% ELSE %]
199
                        [% IF Koha.Preference('OPACUserSummary') && dashboard_info %]
210
                        [% IF Koha.Preference('OPACUserSummary') && dashboard_info %]
200
                            <div id="user_summary">
211
                            <div id="user_summary">
201
                                <h3>Welcome, <a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</span></a></h3>
212
                                [% user = BLOCK %]<a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</span></a>[% END %]
213
                                <h3>[% t('Welcome, {user}') | html | $Expand user = user %]</h3>
202
                                <ul id="user_summary_shortcuts">
214
                                <ul id="user_summary_shortcuts">
203
                                    [% IF checkouts && checkouts > 0 %]
215
                                    [% IF checkouts && checkouts > 0 %]
204
                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-checkouts"><span class="user_checkouts_count count_label">[% checkouts | html %]</span> checkout(s)</a></li>
216
                                        [% count = BLOCK %]<span class="user_checkouts_count count_label">[% checkouts | html %]</span>[% END %]
217
                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-checkouts">[% tn('{count} checkout', '{count} checkouts', checkouts) | html | $Expand count = count %]</a></li>
205
                                    [% END %]
218
                                    [% END %]
206
                                    [% IF overdues && overdues > 0 %]
219
                                    [% IF overdues && overdues > 0 %]
207
                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-overdues"><span class="user_overdues_count count_label">[% overdues | html %]</span> overdue(s)</a></li>
220
                                        [% count = BLOCK %]<span class="user_overdues_count count_label">[% overdues | html %]</span>[% END %]
221
                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-overdues">[% tn('{count} overdue', '{count} overdues', overdues) | html | $Expand count = count %]</a></li>
208
                                    [% END %]
222
                                    [% END %]
209
                                    [% IF holds_pending && holds_pending > 0 %]
223
                                    [% IF holds_pending && holds_pending > 0 %]
210
                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-holds"><span class="user_holds_pending_count count_label">[% holds_pending | html %]</span> hold(s) pending</a></li>
224
                                        [% count = BLOCK %]<span class="user_holds_pending_count count_label">[% holds_pending | html %]</span>[% END %]
225
                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-holds">[% tn('{count} hold pending', '{count} holds pending', holds_pending) | html | $Expand count = count %]</a></li>
211
                                    [% END %]
226
                                    [% END %]
212
                                    [% IF holds_waiting && holds_waiting > 0 %]
227
                                    [% IF holds_waiting && holds_waiting > 0 %]
213
                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-holds"><span class="user_holds_waiting_count count_label">[% holds_waiting | html %]</span> hold(s) waiting</a></li>
228
                                        [% count = BLOCK %]<span class="user_holds_waiting_count count_label">[% holds_waiting | html %]</span>[% END %]
229
                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-holds">[% tn('{count} hold waiting', '{count} holds waiting', holds_waiting) | html | $Expand count = count %]</a></li>
214
                                    [% END %]
230
                                    [% END %]
215
                                    [% IF total_owing && total_owing > 0 %]
231
                                    [% IF total_owing && total_owing > 0 %]
216
                                        <li><a href="/cgi-bin/koha/opac-account.pl"><span class="user_fines_count count_label">[% total_owing | $Price with_symbol => 1 %]</span> due in fines and charges</a></li>
232
                                        [% amount = BLOCK %]<span class="user_fines_count count_label">[% total_owing | $Price with_symbol => 1 %]</span>[% END %]
233
                                        <li><a href="/cgi-bin/koha/opac-account.pl">[% t('{amount} due in fines and charges') | html | $Expand amount = amount %]</a></li>
217
                                    [% END %]
234
                                    [% END %]
218
                                </ul>
235
                                </ul>
219
                            </div>
236
                            </div>
(-)a/t/Koha/Template/Plugin/Expand.t (-1 / +11 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/env perl
2
3
use Modern::Perl;
4
5
use Test::More tests => 1;
6
use Koha::Template::Plugin::Expand;
7
8
my $filter = Koha::Template::Plugin::Expand->new();
9
10
my $filtered = $filter->filter('Hello, {name}', [], { name => 'World!' });
11
is($filtered, 'Hello, World!', '{name} was replaced by World!');

Return to bug 26392