aboutsummaryrefslogtreecommitdiff
path: root/templates/base.html
diff options
context:
space:
mode:
authorJieiku2023-09-20 22:24:14 -0700
committerJieiku2023-09-20 22:24:14 -0700
commite8203032fc15622085c12100d887b15a1a756326 (patch)
treee6e68868654e334f3d2dd689d1057211a9eb8400 /templates/base.html
parent4b6a81be591a07d7f5332b16ff75c2d9a6ce6f20 (diff)
downloadabridge-e8203032fc15622085c12100d887b15a1a756326.tar.gz
abridge-e8203032fc15622085c12100d887b15a1a756326.tar.bz2
abridge-e8203032fc15622085c12100d887b15a1a756326.zip
add language globe menu icon, use language name in menu
Diffstat (limited to 'templates/base.html')
-rw-r--r--templates/base.html67
1 files changed, 36 insertions, 31 deletions
diff --git a/templates/base.html b/templates/base.html
index b3dfec8..b1172a9 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -27,12 +27,14 @@
<nav>
<div>
{%- if config.extra.logo -%}
+
<h1><a href="{{ get_url(path="/", lang=lang) }}{%- if uglyurls %}/index.html{%- endif %}" title="{{config.title}}">
{%- if config.extra.logo.file -%}
<img src="{{ config.base_url | safe }}/{{ config.extra.logo.file | safe }}"{%- if config.extra.logo.alt %} alt="{{ config.extra.logo.alt | safe }}"{%- endif %}{%- if config.extra.logo.width %} width="{{ config.extra.logo.width | safe }}"{%- endif %}{%- if config.extra.logo.height %} height="{{ config.extra.logo.height | safe }}"{%- endif %} />
{%- endif -%}
{%- if config.extra.logo.text -%}{{ config.extra.logo.text | safe }}{%- endif -%}
</a></h1>
+
{%- elif config.extra.textlogo -%}
<h1><a href="{{ get_url(path="/", lang=lang) }}{%- if uglyurls -%}
{%- if lang == config.default_language -%}/{%- endif -%}
@@ -42,44 +44,46 @@
{%- endif -%}
</div>
<div>
- <div>
- <span>
- {% set js_switcher=config.extra.js_switcher | default(value=true) %}
- {%- if config.extra.menu or js_switcher %}
- {%- if config.extra.menu %}
- {%- for i in config.extra.menu -%}
-
+ <div>
+ <ul>
- <a{%- if i.size %} class="{{ i.size }}"{% endif %} href="{%- if i.url is matching("^http[s]?://") %}{{ i.url }}{%- else -%}{{ get_url(path=i.url, lang=lang, trailing_slash=i.slash) }}{%- if i.slash and uglyurls %}index.html{%- endif %}{%- endif %}"{% if i.blank %} target="_blank"{% endif %}>
- {%- if lang != config.default_language %} {{ trans(key=i.name | safe, lang=lang) }} {% else %} {{ i.name | safe }} {% endif -%}
- </a>
- {%- endfor -%}
- {%- endif -%}
- {%- if js_switcher -%}
- {%- set icon_adjust=config.extra.icon_adjust | default(value="svgs adjust") -%}
- {%- if icon_adjust -%}<i type="reset" id="mode" class="js {{ icon_adjust }}"></i>{%- else -%}<i type="reset" id="mode" class="js mode">&#9728;</i>{%- endif -%}
- {%- endif -%}
+ {%- set js_switcher=config.extra.js_switcher | default(value=true) %}
+ {%- if config.extra.menu %}
+ {%- for i in config.extra.menu -%}
+ <li><a{%- if i.size %} class="{{ i.size }}"{% endif %} href="{%- if i.url is matching("^http[s]?://") %}{{ i.url }}{%- else -%}{{ get_url(path=i.url, lang=lang, trailing_slash=i.slash) }}{%- if i.slash and uglyurls %}index.html{%- endif %}{%- endif %}"{% if i.blank %} target="_blank"{% endif %}>
+ {%- if lang != config.default_language %} {{ trans(key=i.name | safe, lang=lang) }} {% else %} {{ i.name | safe }} {% endif -%}
+ </a></li>
+ {%- endfor -%}
{%- endif -%}
+
{%- if config.languages | length > 0 %}
- <div class="dropdown" type="Button"> {%- if lang != config.default_language %}{{ trans(key="flag" | safe, lang=lang) }}{% else %}{{ config.extra.flag.en }}{% endif %}
+ <li><div class="dropdown"><i class="svgs world" type="reset"></i>
{%- if current_url %}
- <div class="dropdown-content">
- {%- for lcode,flag in config.extra.flag -%}
- {%- if lang != lcode -%}
- {%- if lcode == config.default_language -%}
- <a type="Button" href="{{ current_url | replace(from=current_path | truncate(length=4, end=""), to="/") | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ flag }}</a><br />
- {%- else -%}
- <a type="Button" href="{{ current_url | replace(from=config.base_url, to=config.base_url ~ "/" ~ lcode) | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ flag }}</a><br />
- {%- endif -%}
- {%- endif -%}
- {%- endfor -%}
- </div>
+ <div class="dropdown-content">
+ <span>{%- if lang != config.default_language %}{{ trans(key="flag" | safe, lang=lang) }}{% else %}{{ config.extra.flag.en }}{% endif %}</span>
+ {%- for lcode,flag in config.extra.flag -%}
+ {%- if lang != lcode -%}
+ {%- if lcode == config.default_language -%}
+ <a href="{{ current_url | replace(from=current_path | truncate(length=4, end=""), to="/") | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ flag }}</a>
+ {%- else -%}
+ <a href="{{ current_url | replace(from=config.base_url, to=config.base_url ~ "/" ~ lcode) | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ flag }}</a>
+ {%- endif -%}
+ {%- endif -%}
+ {%- endfor -%}
+ </div>
{%- endif %}
- </span>
- </div>
- {%- endif %}
+ </div></li>
+ {%- endif %}
+
+ {%- if js_switcher -%}
+ {%- set icon_adjust=config.extra.icon_adjust | default(value="svgs adjust") -%}
+ {%- if icon_adjust -%}<li><i type="reset" id="mode" class="js {{ icon_adjust }}"></i>{%- else -%}<i type="reset" id="mode" class="js mode">&#9728;</i></li>{%- endif -%}
+ {%- endif -%}
+
+ </ul>
</div>
+
<div>
{%- if config.build_search_index %}
{%- set icon_search=config.extra.icon_search | default(value="svgs search") %}
@@ -94,6 +98,7 @@
</div>
{%- endif %}
</div>
+
</div>
</nav>
{%- if config.extra.sitedesc %}