Koha/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc
Owen Leonard e180c568af Bug 17418 - Move staff client home page JavaScript to the footer
This patch alters the header and footer include files so that JavaScript
can be included in either one or the other. As a proof of concept, the
staff client home page is updated to include JS in the footer instead
of the header.

The processing of JavaScript included on individual pages can now be
similar to how it is done in the OPAC. A block is created with the
page's JavaScript which is then processed in js_includes.inc in the
correct order, after other required js assets.

On pages which have been modified to allow JavaScript to be moved to the
footer you must add a variable to the template: [% SET footerjs = 1 %].
Eventually all staff client templates should be modified so that setting
a flag is not required.

"[% MACRO jsinclude BLOCK %]" is used instead of "[% BLOCK %]" and "[%
PROCESS %]" because MACRO allows the template directives to be
processed correctly when included by intranet-bottom.inc.

To test, apply the patch and view the staff client home page.

- Confirm that you get a confirmation when deleting a news item from the
  home page.
- Enable the CircAutocompl system preference and test that patron
  autocomplete works from the "Check out" tab from the staff home page
  and from other pages where the "Check out" tab is present.
- Test that JavaScript is working correctly on other pages like
  Circulation, Preferences, etc.

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-12-16 11:53:39 +00:00

74 lines
3.6 KiB
HTML

</div>
[% IF ( languages_loop ) %]
[% UNLESS ( one_language_enabled ) %]
<div id="changelanguage" class="navbar navbar-fixed-bottom">
<div class="navbar-inner">
<ul id="i18nMenu" class="nav">
[% FOREACH languages_loo IN languages_loop %]
[% IF ( languages_loo.group_enabled ) %]
[% IF ( languages_loo.plural ) %]
<li class="dropdown"><a class="dropdown-toggle dropup" data-toggle="dropdown" id="show[% languages_loo.rfc4646_subtag %]" href="#">
[% IF ( languages_loo.native_description ) %]
[% languages_loo.native_description %]
[% ELSE %]
[% languages_loo.rfc4646_subtag %]
[% END %]
[% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %]
[% IF ( sublanguages_loo.enabled ) %]
[% IF ( sublanguages_loo.sublanguage_current ) %]
<span class="sublanguage-selected">([% sublanguages_loo.rfc4646_subtag %])</span>
[% END %]
[% END %]
[% END %]
<span class="caret"></span></a>
<ul id="sub[% languages_loo.rfc4646_subtag %]" class="dropdown-menu">
[% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %]
[% IF ( sublanguages_loo.enabled ) %]
[% IF ( sublanguages_loo.sublanguage_current ) %]
<li class="navbar-text"> <a href="#" class="currentlanguage disabled">[% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %] ([% sublanguages_loo.rfc4646_subtag %])</a></li>
[% ELSE %]
<li><a href="/cgi-bin/koha/changelanguage.pl?language=[% sublanguages_loo.rfc4646_subtag %]"> [% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %] ([% sublanguages_loo.rfc4646_subtag %])</a></li>
[% END %]
[% END %]
[% END %]
</ul></li>
[% ELSE %]
[% IF ( languages_loo.group_enabled ) %]
[% IF ( languages_loo.current ) %]
<li class="navbar-text">
[% IF ( languages_loo.native_description ) %]
<span class="currentlanguage">[% languages_loo.native_description %]</span>
[% ELSE %]
<span class="currentlanguage">[% languages_loo.rfc4646_subtag %]</span>
[% END %]
</li>
[% ELSE %]
<li><a href="/cgi-bin/koha/changelanguage.pl?language=[% languages_loo.rfc4646_subtag %]">
[% IF ( languages_loo.native_description ) %]
[% languages_loo.native_description %]
[% ELSE %]
[% languages_loo.rfc4646_subtag %]
[% END %]
</a></li>
[% END %]
[% END %]
[% END %]
[% END %]
[% END %]
</ul>
</div>
</div>
[% END %]
[% END %]
<span id="audio-alert"></span>
[% IF ( footerjs ) %]
[% INCLUDE js_includes.inc %]
[% jsinclude # Parse the page template's JavaScript block if necessary %]
[% END %]
</body>
</html>