Avoid repetition in menu links

This commit is contained in:
Piero Toffanin 2023-01-05 14:54:56 -05:00
parent bfbe848c01
commit f0457da7b6
2 changed files with 17 additions and 16 deletions

View file

@ -11,6 +11,10 @@ a {
text-decoration: underline; text-decoration: underline;
} }
a.noline{
text-decoration: none;
}
#app { #app {
min-height: 80vh; min-height: 80vh;
} }

View file

@ -63,25 +63,22 @@
<span>LibreTranslate</span> <span>LibreTranslate</span>
</a> </a>
<ul class="right hide-on-med-and-down"> <ul class="right hide-on-med-and-down">
<li><a href="{{ swagger_url }}">{{ _h("API Docs") }}</a></li> {% set menulinks %}
{% if get_api_key_link %} <li><a href="{{ swagger_url }}">{{ _h("API Docs") }}</a></li>
<li><a href="{{ get_api_key_link }}">{{ _h("Get API Key") }}</a></li> {% if get_api_key_link %}
{% endif %} <li><a href="{{ get_api_key_link }}">{{ _h("Get API Key") }}</a></li>
<li><a href="https://github.com/LibreTranslate/LibreTranslate" rel="noopener noreferrer">{{ _h("GitHub") }}</a></li> {% endif %}
{% if api_keys %} <li><a href="https://github.com/LibreTranslate/LibreTranslate" rel="noopener noreferrer">{{ _h("GitHub") }}</a></li>
<li><a href="javascript:setApiKey()" title="Set API Key"><i class="material-icons">vpn_key</i></a></li> {% if api_keys %}
{% endif %} <li><a class="noline" href="javascript:setApiKey()" title="{{ _h('Set API Key') }}"><i class="material-icons">vpn_key</i></a></li>
{% endif %}
<li><a class="noline" href="#" title="{{ _h('Change language') }}"><i class="material-icons">language</i></a></li>
{% endset %}
{{ menulinks }}
</ul> </ul>
<ul id="nav-mobile" class="sidenav"> <ul id="nav-mobile" class="sidenav">
<li><a href="{{ swagger_url }}">{{ _h("API Docs") }}</a></li> {{ menulinks }}
{% if get_api_key_link %}
<li><a href="{{ get_api_key_link }}">{{ _h("Get API Key") }}</a></li>
{% endif %}
<li><a href="https://github.com/LibreTranslate/LibreTranslate" rel="noopener noreferrer">{{ _h("GitHub") }}</a></li>
{% if api_keys %}
<li><a href="javascript:setApiKey()" title="{{ _h('Set API Key') }}"><i class="material-icons">vpn_key</i></a></li>
{% endif %}
</ul> </ul>
</div> </div>
</nav> </nav>