Skip to content

Commit

Permalink
Pin default themes to the top
Browse files Browse the repository at this point in the history
Resolves indico#3166
  • Loading branch information
mvidalgarcia committed Feb 2, 2018
1 parent 548ba54 commit b2aeb65
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Improvements
by Indico admins (:issue:`3210`)
- Sort contribution types alphabetically
- Add folding indicators when printing foldable badges (:issue:`3216`)
- Pin default themes to the top for event managers (:issue:`3166`)

Bugfixes
^^^^^^^^
Expand Down
6 changes: 6 additions & 0 deletions indico/htdocs/sass/modules/event_display/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@
font-weight: bold;
}
}

.themes-separator {
@include border-bottom($black);
height: auto;
margin: 0 1em;
}
}

.event-filters {
Expand Down
23 changes: 14 additions & 9 deletions indico/modules/events/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,20 @@
title="{% trans %}Change theme{% endtrans %}"></a>
<ul class="dropdown">
{% set endpoint = 'timetable.timetable' if event.type == 'conference' else 'events.display' %}
{% for id, data in themes.items()|sort(attribute='1.name')
if event.can_manage(session.user) or data.user_visible %}
<li>
{% if id == theme %}
<a class="disabled"><strong>{{ data.name }}</strong></a>
{% else %}
<a href="{{ url_for(endpoint, event, view=id) }}">{{ data.name }}</a>
{% endif %}
</li>
{% for user_visible, themes in themes.items()|sort(attribute='1.name')|groupby('1.user_visible')|reverse
if event.can_manage(session.user) or user_visible %}
{% if user_visible == False %}
<li class="themes-separator"></li>
{% endif %}
{% for id, data in themes %}
<li>
{% if id == theme %}
<a class="disabled"><strong>{{ data.name }}</strong></a>
{% else %}
<a href="{{ url_for(endpoint, event, view=id) }}">{{ data.name }}</a>
{% endif %}
</li>
{% endfor %}
{% endfor %}
</ul>
{%- endmacro -%}
Expand Down

0 comments on commit b2aeb65

Please sign in to comment.