Moves the locale switcher to its own shared view

This commit is contained in:
kikito
2015-08-19 21:39:57 +02:00
parent 961a317c9b
commit 5205ac99e3
3 changed files with 12 additions and 18 deletions

View File

@@ -1,15 +1,7 @@
<header class="<%= header_css %>"> <header class="<%= header_css %>">
<section class="top-links"> <section class="top-links">
<div class="row"> <div class="row">
<div class="language"> <%= render 'shared/locale_switcher' %>
<span id="locale-switcher">
<%= t("layouts.header.language") %>
[
<% available_locales_to_switch.each do |locale| %>
<%= link_to(locale, params.merge(locale: locale), id: "locale-link-#{locale}") %>
<% end %>
]
</div>
</div> </div>
</section> </section>

View File

@@ -1,15 +1,7 @@
<header class="<%= header_css %>"> <header class="<%= header_css %>">
<section class="top-links"> <section class="top-links">
<div class="row"> <div class="row">
<div class="language"> <%= render 'shared/locale_switcher' %>
<span id="locale-switcher">
<%= t("layouts.header.language") %>
[
<% available_locales_to_switch.each do |locale| %>
<%= link_to(locale, params.merge(locale: locale), id: "locale-link-#{locale}", data: { no_turbolink: true }) %>
<% end %>
]
</div>
<div class="external-links"> <div class="external-links">
<%= link_to t("layouts.header.participation"), root_path, class: "selected" %>&nbsp;| <%= link_to t("layouts.header.participation"), root_path, class: "selected" %>&nbsp;|
<%= link_to t("layouts.header.external_link_transparency"), "#" %>&nbsp;| <%= link_to t("layouts.header.external_link_transparency"), "#" %>&nbsp;|

View File

@@ -0,0 +1,10 @@
<div class="locale">
<span>
<%= t("layouts.header.language") %>
<form>
<select class="js-locale-switcher" name='locale-switcher'>
<%= available_locale_options_for_select %>
</select>
</form>
</span>
</div>