mirror of
https://github.com/YunoHost/doc.git
synced 2024-09-03 20:06:26 +02:00
7b447ac5ae
Creating the pages hierarchy for transitioning to Grav
19 lines
753 B
Twig
19 lines
753 B
Twig
<div class="version-chooser">
|
|
Version:
|
|
<select id="switch-version">
|
|
{% set langobj = grav['language'] %}
|
|
{% for key in langswitcher.languages %}
|
|
{% if key == langswitcher.current %}
|
|
{% set lang_url = page.url %}
|
|
{% set active = ' selected="selected"' %}
|
|
{% else %}
|
|
{% set lang_url = base_url_simple ~ langobj.getLanguageURLPrefix(key)~langswitcher.page_route ?: '/' %}
|
|
{% set active = '' %}
|
|
{% endif %}
|
|
<option value="{{ lang_url ~ uri.params }}"{{ active }}>{{ (key / 10)|number_format(1) }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<script>
|
|
jQuery(document).on('change', '#switch-version', function() { window.location.href = this.value });
|
|
</script>
|