mirror of https://gitlab.com/tildes/tildes.git
No known key found for this signature in database
GPG Key ID: 95A9C856EC788689
2 changed files with 46 additions and 39 deletions
@ -1,66 +1,68 @@ |
|||
{% macro render_user_menu(current_page) %} |
|||
{% set route = request.matched_route.name %} |
|||
|
|||
<h2>User menu</h2> |
|||
<ul class="nav"> |
|||
<li>Profile</li> |
|||
<ul class="nav"> |
|||
<li class="nav-item"><a href="/user/{{ request.user }}"> |
|||
{% if(current_page == 'profile_activity') %}<u>{% endif %} |
|||
Recent activity |
|||
{% if(current_page == 'profile_activity') %}</u>{% endif %} |
|||
</a></li> |
|||
<li class="nav-item {{ 'active' if route == 'user' else ''}}"> |
|||
<a href="/user/{{ request.user }}"> |
|||
Recent activity |
|||
</a> |
|||
</li> |
|||
</ul> |
|||
|
|||
<li>Notifications</li> |
|||
<ul class="nav"> |
|||
{% if request.user.num_unread_notifications > 0 %} |
|||
<li class="nav-item"><strong><a href="/notifications/unread"> |
|||
{% if(current_page == 'notifications_unread') %}<u>{% endif %} |
|||
Unread ({{ request.user.num_unread_notifications }}) |
|||
{% if(current_page == 'notifications_unread') %}</u>{% endif %} |
|||
</a></strong></li> |
|||
<li class="nav-item {{ 'active' if route == 'notifications_unread' else '' }}"> |
|||
<strong><a href="/notifications/unread"> |
|||
Unread ({{ request.user.num_unread_notifications }}) |
|||
</a></strong> |
|||
</li> |
|||
{% endif %} |
|||
<li class="nav-item"><a href="/notifications"> |
|||
{% if(current_page == 'notifications_prev') %}<u>{% endif %} |
|||
Previously read |
|||
{% if(current_page == 'notifications_prev') %}</u>{% endif %} |
|||
</a></li> |
|||
<li class="nav-item {{ 'active' if route == 'notifications' else '' }}"> |
|||
<a href="/notifications"> |
|||
Previously read |
|||
</a> |
|||
</li> |
|||
</ul> |
|||
|
|||
<li>Messages</li> |
|||
<ul class="nav"> |
|||
{% if request.user.num_unread_messages > 0 %} |
|||
<li class="nav-item"><strong><a href="/messages/unread"> |
|||
{% if(current_page == 'messages_unread') %}<u>{% endif %} |
|||
<li class="nav-item {{ 'active' if route == 'messages_unread' else '' }}"> |
|||
<strong><a href="/messages/unread"> |
|||
Unread ({{ request.user.num_unread_messages }}) |
|||
{% if(current_page == 'messages_unread') %}</u>{% endif %} |
|||
</a></strong></li> |
|||
</a></strong> |
|||
</li> |
|||
{% endif %} |
|||
<li class="nav-item"><a href="/messages"> |
|||
{% if(current_page == 'messages_inbox') %}<u>{% endif %} |
|||
Inbox |
|||
{% if(current_page == 'messages_inbox') %}</u>{% endif %} |
|||
</a></li> |
|||
<li class="nav-item"><a href="/messages/sent"> |
|||
{% if(current_page == 'messages_sent') %}<u>{% endif %} |
|||
Sent messages |
|||
{% if(current_page == 'messages_sent') %}</u>{% endif %} |
|||
</a></li> |
|||
<li class="nav-item {{ 'active' if route == 'messages' else '' }}"> |
|||
<a href="/messages"> |
|||
Inbox |
|||
</a> |
|||
</li> |
|||
<li class="nav-item {{ 'active' if route == 'messages_sent' else '' }}"> |
|||
<a href="/messages/sent"> |
|||
Sent messages |
|||
</a> |
|||
</li> |
|||
</ul> |
|||
|
|||
<li>Misc</li> |
|||
<ul class="nav"> |
|||
{% if request.user.invite_codes_remaining or num_active_invite_codes|default(0) %} |
|||
<li class="nav-item"><strong><a href="/invite"> |
|||
{% if(current_page == 'misc_invite') %}<u>{% endif %} |
|||
Invite someone ({{ request.user.invite_codes_remaining + num_active_invite_codes|default(0) }}) |
|||
{% if(current_page == 'misc_invite') %}</u>{% endif %} |
|||
</a></strong></li> |
|||
<li class="nav-item {{ 'active' if route == 'invite' else '' }}"> |
|||
<strong><a href="/invite"> |
|||
Invite someone ({{ request.user.invite_codes_remaining + num_active_invite_codes|default(0) }}) |
|||
</a></strong> |
|||
</li> |
|||
{% endif %} |
|||
<li class="nav-item"><a href="/settings"> |
|||
{% if(current_page == 'misc_settings') %}<u>{% endif %} |
|||
Settings |
|||
{% if(current_page == 'misc_settings') %}</u>{% endif %} |
|||
</a></li> |
|||
<li class="nav-item {{ 'active' if route == 'settings' else '' }}"> |
|||
<a href="/settings"> |
|||
Settings |
|||
</a> |
|||
</li> |
|||
<li class="nav-item"><a href="/logout">Log out</a></li> |
|||
</ul> |
|||
</ul> |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue