diff --git a/readthedocsext/theme/templates/includes/utils/messages.html b/readthedocsext/theme/templates/includes/utils/messages.html index c379eaa5..7fb3b5ca 100644 --- a/readthedocsext/theme/templates/includes/utils/messages.html +++ b/readthedocsext/theme/templates/includes/utils/messages.html @@ -7,6 +7,23 @@ page content pane. {% endcomment %} +{% comment %} +``user_notifications`` comes from a Context Processor. +We need to use a CustomUser to have access to "user.notifications" +See https://docs.djangoproject.com/en/4.2/ref/settings/#std-setting-AUTH_USER_MODEL +{% endcomment %} +{% if user_notifications %} + {% for notification in user_notifications %} +
+ {% comment %} + Add this Xmark here once we implement dismissing notifications. + + {% endcomment %} + {{ notification.get_message.get_rendered_body|safe }} +
+ {% endfor %} +{% endif %} + {% if messages %} {% for message in messages %} {% comment %} diff --git a/readthedocsext/theme/templates/organizations/partials/header.html b/readthedocsext/theme/templates/organizations/partials/header.html index 79366b61..58472314 100644 --- a/readthedocsext/theme/templates/organizations/partials/header.html +++ b/readthedocsext/theme/templates/organizations/partials/header.html @@ -126,4 +126,13 @@ {% endblock organization_header_navigation %} +{# Render all the notifications attached to the organization.#} + {% for notification in organization.notifications.all %} +
+ + {{ notification.get_message.get_rendered_body|safe }} +
+ {% endfor %} + + {% endblock organization_header %} diff --git a/readthedocsext/theme/templates/projects/partials/header.html b/readthedocsext/theme/templates/projects/partials/header.html index 5d44a8cb..a2b7f5de 100644 --- a/readthedocsext/theme/templates/projects/partials/header.html +++ b/readthedocsext/theme/templates/projects/partials/header.html @@ -201,4 +201,12 @@ {% endblock project_header_navigation %} +{# Render all the notifications attached to the project.#} + {% for notification in project.notifications.all %} +
+ + {{ notification.get_message.get_rendered_body|safe }} +
+ {% endfor %} + {% endblock project_header %}