-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9604650
commit 576fcf1
Showing
3 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
|
||
<select id="languages"> | ||
{% for lang in lizmap_locales %} | ||
<option value="{{ lang }}" data-url="{{ lizmap_path_to_root }}../{{ lang }}/index.html" title="{{ lizmap_locales_name[lang] }}">{{ lizmap_locales_label[lang] }}</option> | ||
{% endfor %} | ||
</select> | ||
|
||
<span id="versions-links"> | ||
Versions: | ||
<span id="versions-links-list"> | ||
{% for liz_vers, liz_label, liz_link in lizmap_versions.list %} | ||
{% if liz_vers == lizmap_versions.next_version%} | ||
{% if version == lizmap_versions.next_version %}<strong class="verlink">{{ liz_label }}</strong>{% endif %} | ||
{%else%} | ||
{% if liz_vers == version %} | ||
<strong class="verlink">{{ liz_label }}</strong> | ||
{% else %} | ||
<a class="verlink" href="{{ lizmap_path_to_root }}../../{{ liz_link }}/{{ language }}/" title="{{ liz_label }}">{{ liz_label }}</a> | ||
{% endif %}{% endif %} | ||
{% endfor %} | ||
</span> | ||
</span> | ||
|
||
<script> | ||
var currentPage = '{{current_page_name}}.html'; // coming from sphinx, always without starting '/'; | ||
var currentLang = '{{ language }}'; | ||
document.addEventListener("DOMContentLoaded", function(){ | ||
var selectLanguage = document.getElementById("languages"); | ||
selectLanguage.value = currentLang; | ||
selectLanguage.addEventListener("change", function(event) { | ||
window.location.href = event.target.selectedOptions[0].getAttribute('data-url'); | ||
}, false); | ||
}, false); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{% extends "!layout.html" %} | ||
|
||
{% set lizmap_locales_name = { | ||
'fr': _('French'), | ||
'en': _('English'), | ||
'es': _('Spanish'), | ||
'it': _('Italian'), | ||
'pt': _('Portuguese'), | ||
'fi': _('Finnish'), | ||
'ca_ES': _('Catalan'), | ||
'da_DK': _('Danish'), | ||
'de': _('German'), | ||
'fa': _('Persian'), | ||
'id': _('Indonesian'), | ||
'ja': _('Japanese'), | ||
'ko_KR': _('Korean'), | ||
'nl': _('Dutch'), | ||
'ro': _('Romanian'), | ||
'ru': _('Russian'), | ||
'zh_CN': _('Chinese (China)'), | ||
'zh_TW': _('Chinese (Taiwan)') | ||
} | ||
%} | ||
|
||
{% set lizmap_locales_label = { | ||
'fr': 'Français', | ||
'en': 'English', | ||
'es': 'Español', | ||
'it': 'Italiano', | ||
'pt': 'Português', | ||
'fi': 'Suomalainen', | ||
'ca_ES': 'Catalan', | ||
'da_DK': 'Dansk', | ||
'de': 'Deutsch', | ||
'fa': 'فارسی', | ||
'id': 'Bahasa Indonesia', | ||
'ja': '日本語', | ||
'ko_KR': '한국어', | ||
'nl': 'Nederlands', | ||
'ro': 'Română', | ||
'ru': 'Русский', | ||
'zh_CN': '中文', | ||
'zh_TW': _('Chinese (Taiwan)') | ||
} | ||
%} | ||
|
||
{% set lizmap_locales = lizmap_versions.locales[version] %} | ||
{% set lizmap_path_to_root = pathto('index')|replace('index.html','')|replace('#','') %} | ||
|
||
{% block extrahead %} | ||
{% for lang in lizmap_locales -%} | ||
{% if language != lang -%} | ||
<link href="{{ lizmap_path_to_root }}../{{ lang }}/" rel="alternate" hreflang="{{ lang }}"/> | ||
{% endif %} | ||
{%- endfor %} | ||
<link href="https://docs.lizmap.com/current/{{ language }}/" rel="canonical"/> | ||
{% endblock %} | ||
|
||
{% block bodyheader %} | ||
<div class="globalnav globalhead"> | ||
<a class="siteNav" href="{{ pathto(master_doc) }}" > | ||
<img src="{{ pathto('_static/' + logo, 1) }}" class="logo" /> | ||
<span class="siteNavTitle"> | ||
Documentation | ||
</span> | ||
</a> | ||
{% include "languageswitch.html" %} | ||
</div> | ||
{% endblock %} | ||
|
||
{% block sidebartitle %} | ||
<a class="sideTitle" href="{{ pathto(master_doc) }}" style="color:black"> | ||
LIZMAP | ||
</a> | ||
<div class="version" style="color:black"> | ||
{{ version }} | ||
</div> | ||
{% include "searchbox.html" %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters