From 70838f69037eb159e1e1be0fed28e59be9bcec2b Mon Sep 17 00:00:00 2001 From: Ivan Fonseca Date: Sun, 22 Jul 2018 10:19:26 -0400 Subject: [PATCH] Create base template for user menu --- tildes/tildes/templates/base_user_menu.jinja2 | 8 ++++++++ tildes/tildes/templates/invite.jinja2 | 6 +----- tildes/tildes/templates/messages.jinja2 | 6 +----- tildes/tildes/templates/messages_sent.jinja2 | 4 ---- tildes/tildes/templates/messages_unread.jinja2 | 4 ---- tildes/tildes/templates/notifications.jinja2 | 4 ---- tildes/tildes/templates/notifications_unread.jinja2 | 6 +----- tildes/tildes/templates/settings.jinja2 | 6 +----- tildes/tildes/templates/user.jinja2 | 6 +++--- 9 files changed, 15 insertions(+), 35 deletions(-) create mode 100644 tildes/tildes/templates/base_user_menu.jinja2 diff --git a/tildes/tildes/templates/base_user_menu.jinja2 b/tildes/tildes/templates/base_user_menu.jinja2 new file mode 100644 index 0000000..75647ba --- /dev/null +++ b/tildes/tildes/templates/base_user_menu.jinja2 @@ -0,0 +1,8 @@ +{% extends 'base.jinja2' %} + +{% from 'macros/user_menu.jinja2' import render_user_menu with context %} + +{% block sidebar %} + + {{ render_user_menu('profile_activity') }} +{% endblock %} diff --git a/tildes/tildes/templates/invite.jinja2 b/tildes/tildes/templates/invite.jinja2 index 09afb0f..b432045 100644 --- a/tildes/tildes/templates/invite.jinja2 +++ b/tildes/tildes/templates/invite.jinja2 @@ -1,4 +1,4 @@ -{% extends 'base.jinja2' %} +{% extends 'base_user_menu.jinja2' %} {% from 'macros/user_menu.jinja2' import render_user_menu with context %} @@ -39,7 +39,3 @@

You don't currently have any invite codes available.

{% endif %} {% endblock %} - -{% block sidebar %} - {{ render_user_menu('misc_invite') }} -{% endblock %} diff --git a/tildes/tildes/templates/messages.jinja2 b/tildes/tildes/templates/messages.jinja2 index 4ebc3b8..d83c240 100644 --- a/tildes/tildes/templates/messages.jinja2 +++ b/tildes/tildes/templates/messages.jinja2 @@ -1,4 +1,4 @@ -{% extends 'base.jinja2' %} +{% extends 'base_user_menu.jinja2' %} {% from 'macros/datetime.jinja2' import time_ago_responsive %} {% from 'macros/links.jinja2' import username_linked %} @@ -35,7 +35,3 @@ {% endfor %} {% endblock %} - -{% block sidebar %} - {{ render_user_menu('messages_inbox') }} -{% endblock %} diff --git a/tildes/tildes/templates/messages_sent.jinja2 b/tildes/tildes/templates/messages_sent.jinja2 index 633abe3..4cd3e0e 100644 --- a/tildes/tildes/templates/messages_sent.jinja2 +++ b/tildes/tildes/templates/messages_sent.jinja2 @@ -3,7 +3,3 @@ {% block title %}Sent Messages{% endblock %} {% block main_heading %}Sent Messages{% endblock %} - -{% block sidebar %} - {{ render_user_menu('messages_sent') }} -{% endblock %} diff --git a/tildes/tildes/templates/messages_unread.jinja2 b/tildes/tildes/templates/messages_unread.jinja2 index 87b2968..708f685 100644 --- a/tildes/tildes/templates/messages_unread.jinja2 +++ b/tildes/tildes/templates/messages_unread.jinja2 @@ -3,7 +3,3 @@ {% block title %}Unread Messages{% endblock %} {% block main_heading %}Unread Messages{% endblock %} - -{% block sidebar %} - {{ render_user_menu('messages_unread') }} -{% endblock %} diff --git a/tildes/tildes/templates/notifications.jinja2 b/tildes/tildes/templates/notifications.jinja2 index 7f01acf..9cec6a6 100644 --- a/tildes/tildes/templates/notifications.jinja2 +++ b/tildes/tildes/templates/notifications.jinja2 @@ -8,7 +8,3 @@

This page shows your most recent, previously read notifications (up to a max of 100, pagination coming soon)

{{ super() }} {% endblock %} - -{% block sidebar %} - {{ render_user_menu('notifications_prev') }} -{% endblock %} diff --git a/tildes/tildes/templates/notifications_unread.jinja2 b/tildes/tildes/templates/notifications_unread.jinja2 index f46df19..76a309d 100644 --- a/tildes/tildes/templates/notifications_unread.jinja2 +++ b/tildes/tildes/templates/notifications_unread.jinja2 @@ -1,4 +1,4 @@ -{% extends 'base.jinja2' %} +{% extends 'base_user_menu.jinja2' %} {% from 'macros/comments.jinja2' import comment_tag_options_template, render_single_comment with context %} {% from 'macros/links.jinja2' import group_linked %} @@ -40,7 +40,3 @@ {{ comment_tag_options_template(comment_tag_options) }} {% endblock %} - -{% block sidebar %} - {{ render_user_menu('notifications_unread') }} -{% endblock %} diff --git a/tildes/tildes/templates/settings.jinja2 b/tildes/tildes/templates/settings.jinja2 index f704428..81ed2d7 100644 --- a/tildes/tildes/templates/settings.jinja2 +++ b/tildes/tildes/templates/settings.jinja2 @@ -1,4 +1,4 @@ -{% extends 'base.jinja2' %} +{% extends 'base_user_menu.jinja2' %} {% from 'macros/user_menu.jinja2' import render_user_menu with context %} @@ -53,7 +53,3 @@
Define a list of topic tags to filter out of listings by default
{% endblock %} - -{% block sidebar %} - {{ render_user_menu('misc_settings') }} -{% endblock %} diff --git a/tildes/tildes/templates/user.jinja2 b/tildes/tildes/templates/user.jinja2 index 17eb33e..3558c1a 100644 --- a/tildes/tildes/templates/user.jinja2 +++ b/tildes/tildes/templates/user.jinja2 @@ -1,9 +1,8 @@ -{% extends 'base.jinja2' %} +{% extends 'base_user_menu.jinja2' %} {% from 'macros/comments.jinja2' import render_single_comment with context %} {% from 'macros/links.jinja2' import group_linked, username_linked %} {% from 'macros/topics.jinja2' import render_topic_for_listing with context %} -{% from 'macros/user_menu.jinja2' import render_user_menu with context %} {% block title %}User: {{ user.username }}{% endblock %} @@ -38,7 +37,8 @@ {% block sidebar %} {% if user == request.user %} - {{ render_user_menu('profile_activity') }} + {{ super() }} + test
{% endif %}