-
Notifications
You must be signed in to change notification settings - Fork 172
align logo with content, replace language links with dropdown, and fix header alignment #1476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,12 +17,15 @@ | |
| {% if organizer.settings.theme_color_background|upper != "#FFFFFF" or organizer.settings.organizer_logo_image_large %} | ||
| <div class="container page-header-links"> | ||
| <div class="pull-right header-part flip header-content"> | ||
| <div class="locales"> | ||
| {% for l in languages %} | ||
| <a href="{% url "presale:locale.set" %}?locale={{ l.code }}&next={{ request.path }}%3F{{ request.META.QUERY_STRING|urlencode }}" class="{% if l.code == request.LANGUAGE_CODE %}active{% endif %}" rel="nofollow"> | ||
| {{ l.name_local }}</a> | ||
| {% endfor %} | ||
| </div> | ||
| <form action="{% url 'presale:locale.set' %}" method="get" class="locales" aria-label="{% trans "select language" %}"> | ||
| <label for="locale-select-org" class="sr-only">{% trans "Language" %}</label> | ||
| <select id="locale-select-org" name="locale" onchange="this.form.submit()" class="form-control input-sm"> | ||
| {% for l in languages %} | ||
| <option value="{{ l.code }}" {% if l.code == request.LANGUAGE_CODE %}selected{% endif %}>{{ l.name_local }}</option> | ||
| {% endfor %} | ||
| </select> | ||
| <input type="hidden" name="next" value="{{ request.path }}{% if request.META.QUERY_STRING %}?{{ request.META.QUERY_STRING|urlencode }}{% endif %}"> | ||
| </form> | ||
| </div> | ||
| </div> | ||
| {% endif %} | ||
|
|
@@ -47,12 +50,17 @@ <h1><a href="{% eventurl organizer "presale:organizer.index" %}">{{ organizer.na | |
| </div> | ||
| {% if organizer.settings.locales|length > 1 %} | ||
| {% if organizer.settings.theme_color_background|upper == "#FFFFFF" and not organizer.settings.organizer_logo_image_large %} | ||
| <div class="{% if not organizer_logo or not organizer.settings.organizer_logo_image_large %}pull-right flip{% endif %} loginbox"> | ||
| <div class="locales"> | ||
| {% for l in languages %} | ||
| <a href="{% url "presale:locale.set" %}?locale={{ l.code }}&next={{ request.path }}%3F{{ request.META.QUERY_STRING|urlencode }}" class="{% if l.code == request.LANGUAGE_CODE %}active{% endif %}" rel="nofollow"> | ||
| {{ l.name_local }}</a> | ||
| {% endfor %} | ||
| <div class="container"> | ||
| <div class="{% if not organizer_logo or not organizer.settings.organizer_logo_image_large %}pull-right flip{% endif %} loginbox"> | ||
| <form action="{% url 'presale:locale.set' %}" method="get" class="locales" aria-label="{% trans "select language" %}"> | ||
| <label for="locale-select-org-inline" class="sr-only">{% trans "Language" %}</label> | ||
| <select id="locale-select-org-inline" name="locale" onchange="this.form.submit()" class="form-control input-sm"> | ||
| {% for l in languages %} | ||
| <option value="{{ l.code }}" {% if l.code == request.LANGUAGE_CODE %}selected{% endif %}>{{ l.name_local }}</option> | ||
| {% endfor %} | ||
| </select> | ||
| <input type="hidden" name="next" value="{{ request.path }}{% if request.META.QUERY_STRING %}?{{ request.META.QUERY_STRING|urlencode }}{% endif %}"> | ||
| </form> | ||
| </div> | ||
| </div> | ||
|
Comment on lines
+53
to
65
|
||
| {% endif %} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider deduplicating the locale switcher markup and URL-building logic.
The language switcher form and
nextparameter construction are now repeated in multiple templates (event/base.htmltwice andorganizers/base.htmltwice). Moving this into a shared include/fragment or a helper for generatingnextwould reduce duplication and keep behavior consistent across templates.Suggested implementation:
To fully implement the deduplication and keep behavior consistent:
app/eventyay/presale/templates/pretixpresale/partials/locale_switcher.htmlwith the full, DRY implementation:event/base.htmlandorganizers/base.htmlwith{% include "pretixpresale/partials/locale_switcher.html" %}in the same way as above.idvalues for the<select>(e.g., multiple switchers on one page), either:idvia{% include ... with select_id="locale-select-header" %}, oridif it's not relied on by JavaScript or labels elsewhere.