Browse Source

Show theme switcher in footer for logged-in users

merge-requests/110/head
dougmellon 5 years ago
committed by Deimos
parent
commit
2e8623c22f
  1. 45
      tildes/tildes/templates/base.jinja2

45
tildes/tildes/templates/base.jinja2

@ -109,30 +109,27 @@
</aside> </aside>
<footer id="site-footer" data-js-hide-sidebar-if-open> <footer id="site-footer" data-js-hide-sidebar-if-open>
{# Show the theme-selection dropdown if the user isn't logged in #} <div class="site-footer-theme-selection">
{% if not request.user %} <label for="theme">Theme:</label>
<div class="site-footer-theme-selection"> <select class="form-select" name="theme" id="theme" data-js-theme-selector>
<label for="theme">Theme:</label> {% for (theme, description) in (
<select class="form-select" name="theme" id="theme" data-js-theme-selector> ("white", "White"),
{% for (theme, description) in ( ("solarized-light", "Solarized Light"),
("white", "White"), ("solarized-dark", "Solarized Dark"),
("solarized-light", "Solarized Light"), ("dracula", "Dracula"),
("solarized-dark", "Solarized Dark"), ("atom-one-dark", "Atom One Dark"),
("dracula", "Dracula"), ("black", "Black"),
("atom-one-dark", "Atom One Dark"), ("zenburn", "Zenburn"),
("black", "Black"), ("gruvbox-light", "Gruvbox Light"),
("zenburn", "Zenburn"), ("gruvbox-dark", "Gruvbox Dark")) %}
("gruvbox-light", "Gruvbox Light"), <option value="{{ theme }}"
("gruvbox-dark", "Gruvbox Dark")) %} {{ 'selected' if theme == request.cookies.get("theme", "white") else '' }}
<option value="{{ theme }}" >
{{ 'selected' if theme == request.cookies.get("theme", "white") else '' }} {{ description }}
> </option>
{{ description }} {% endfor %}
</option> </select>
{% endfor %} </div>
</select>
</div>
{% endif %}
<ul class="site-footer-links"> <ul class="site-footer-links">
<li class="site-footer-link"><a href="https://docs.tildes.net">Docs</a></li> <li class="site-footer-link"><a href="https://docs.tildes.net">Docs</a></li>

|||||||
100:0
Loading…
Cancel
Save