diff --git a/templates/_header.twig b/templates/_header.twig index 461dfd25d1b2eacd5ea6d27d908728972f116b59..a713d17568b3d61632a47ff01a1ca5f5bf45063e 100644 --- a/templates/_header.twig +++ b/templates/_header.twig @@ -1,22 +1,26 @@ <div id="header"> - <h1><a style="text-decoration: none; color: white" href="/{{ baseurlpath }}">{{ pagetitle }}</a></h1> -</div> - -{% if not hideLanguageBar %} -<div id="languagebar"> - {% for lang in languageBar %} - {%- if not loop.first -%}|{% endif -%} - {% if lang.url %} - <a href="{{ lang.url -}} - {%- if queryParams %}&{% endif -%} - {%- for name, value in queryParams -%} - {%- if not loop.first %}&{% endif -%} - {%- if value %}{{ name }}={{ value }}{% else %}{{ name }}{% endif -%} - {%- endfor %}">{{ lang.name }}</a> - {% else %} - {{ lang.name }} + <form id="SelectLang" class="pure-form" method="get"> + {% if not hideLanguageBar %} + <div id="languagebar"> + {% for name, value in queryParams %} + {%- if value -%} + <input type="hidden" name="{{ name }}" value="{{ value }}" /> + {%- else %} + <input type="hidden" name="{{ name }}" /> {% endif %} + {% endfor %} + <select class="pure-input-1-4 right language-menu selectize" name="language" id="language_selector"> + {% for key, lang in languageBar -%} + {%- if key == currentLanguage -%} + <option value="{{ key }}" selected="selected">{{ lang.name }}</option> + {%- else -%} + <option value="{{ key }}">{{ lang.name }}</option> + {%- endif -%} {% endfor %} + </select> + </div> + {% endif %} + </form> </div> -{% endif %} +