Bug 14252: Move OPAC lang switcher to masthead navbar

The OPAC language switcher takes up a lot of space at the bottom of the
browser. It also has issues of being not always visible.
This patch adds the switcher to the masthead navbar and removes from the
opac-bottom.inc navbar.

Test plan
=========

1/ Apply patch
2/ Set opaclanguagesdisplay syspref to 'show'.
3/ Add a few languages i.e. es-ES, fr-FR and de-DE
     $ cd misc/translator
     $ perl translate <langcode>
4/ Enable installed languages for OPAC use by checking on 'opaclanguages'
   under I18N/L10N sysprefs
5/ Go to the OPAC, you should have a "Languages" dropdown on the masthead
   navbar, the opac-bottom.inc navbar should no longer be there.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works, no koha-qa errors.
Followup fix language chooser for sublanguages

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Indranil Das Gupta 2015-05-23 03:11:48 +05:30 committed by Tomas Cohen Arazi
parent cad134cd17
commit 2845fb2423
2 changed files with 39 additions and 41 deletions

View file

@ -71,6 +71,45 @@
<a id="user-menu-trigger" class="pull-right" href="#"><i class="icon-user"></i> <span class="caret"></span></a>
<div id="members">
<ul class="nav pull-right">
[% IF ( opaclanguagesdisplay ) %]
[% IF ( languages_loop && opaclanguagesdisplay ) %]
[% UNLESS ( one_language_enabled ) %]
<li class="dropdown">
<a href="#" title="Switch languages" class="dropdown-toggle" id="langmenu" data-toggle="dropdown" role="button"><i class="icon-flag icon-white"></i> <span class="langlabel">Languages</span> <b class="caret"></b></a>
<ul aria-labelledby="langmenu" role="menu" class="dropdown-menu">
[% FOREACH languages_loo IN languages_loop %]
[% IF ( languages_loo.group_enabled ) %]
[% IF ( languages_loo.plural ) %]
<li class="dropdown">
<a data-toggle="dropdown" class="dropdown-toggle sublangs" id="show[% languages_loo.rfc4646_subtag %]" href="#">[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %] <b class="caret"></b></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 role="presentation"> <a href="#" tabindex="-1" class="menu-inactive" role="menuitem">[% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %] ([% sublanguages_loo.rfc4646_subtag %])&nbsp;<i class="icon-ok"></i></a></li>
[% ELSE %]
<li role="presentation"><a href="/cgi-bin/koha/opac-changelanguage.pl?language=[% sublanguages_loo.rfc4646_subtag %]" tabindex="-1" role="menuitem" class="listmenulink"> [% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %] ([% sublanguages_loo.rfc4646_subtag %])</a></li>
[% END %]
[% END # / IF sublanguages_loo.enabled %]
[% END # / FOREACH sublanguages_loo %]
</ul> <!-- languages_loo.rfc4646_subtag -->
</li> <!-- / .more -->
[% ELSE %]
[% IF ( languages_loo.group_enabled ) %]
[% IF ( languages_loo.current ) %]
<li role="presentation"><a href="#" tabindex="-1" class="menu-inactive" role="menuitem">[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %]&nbsp;<i class="icon-ok"></i></a></li>
[% ELSE %]
<li role="presentation"><a href="/cgi-bin/koha/opac-changelanguage.pl?language=[% languages_loo.rfc4646_subtag %]" tabindex="-1" role="menuitem" class="listmenulink">[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %]</a></li>
[% END %]
[% END # / IF languages_loo.current %]
[% END # / IF ( languages_loo.plural ) %]
[% END # / IF ( languages_loo.group_enabled ) %]
[% END # / FOREACH languages_loo IN languages_loop %]
</ul> <!-- /# .dropdown-menu -->
</li> <!-- / .dropdown -->
[% END # / UNLESS ( one_language_enabled ) %]
[% END # / IF ( languages_loop && opaclanguagesdisplay ) %]
[% END # / IF opaclanguagesdisplay %]
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
[% UNLESS ( loggedinusername ) %]
[% IF Koha.Preference('casAuthentication') %]

View file

@ -30,47 +30,6 @@
</div> <!-- / #wrap in masthead.inc -->
[% IF ( opaclanguagesdisplay ) %]
[% IF ( languages_loop && opaclanguagesdisplay ) %]
[% UNLESS ( one_language_enabled ) %]
<div id="changelanguage" class="navbar navbar-fixed-bottom navbar-static-bottom noprint">
<div class="navbar-inner">
<ul id="i18nMenu" class="nav">
<li><p class="lang navbar-text"><strong>Languages:&nbsp;</strong></p></li>
[% FOREACH languages_loo IN languages_loop %]
[% IF ( languages_loo.group_enabled ) %]
[% IF ( languages_loo.plural ) %]
<li class="dropdown">
<a data-toggle="dropdown" class="dropdown-toggle sublangs" id="show[% languages_loo.rfc4646_subtag %]" href="#">[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %] <b class="caret"></b></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> <p>[% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %] ([% sublanguages_loo.rfc4646_subtag %])</p></li>
[% ELSE %]
<li><a href="/cgi-bin/koha/opac-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 # / IF sublanguages_loo.enabled %]
[% END # / FOREACH sublanguages_loo %]
</ul>
</li> <!-- / .more -->
[% ELSE %]
[% IF ( languages_loo.group_enabled ) %]
[% IF ( languages_loo.current ) %]
<li class="active"><p class="navbar-text">[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %]</p></li>
[% ELSE %]
<li><a href="/cgi-bin/koha/opac-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 # / IF languages_loo.current %]
[% END # / IF ( languages_loo.plural ) %]
[% END # / IF ( languages_loo.group_enabled ) %]
[% END # / FOREACH languages_loo IN languages_loop %]
</ul> <!-- / #i18menu -->
</div> <!-- / .navbar-inner -->
</div> <!-- / #changelanguage -->
[% END # / UNLESS ( one_language_enabled ) %]
[% END # / IF ( languages_loop && opaclanguagesdisplay ) %]
[% END # / IF opaclanguagesdisplay %]
[% END # / UNLESS is_popup %]