From 6c5e46fa8de47ec7cc9b5ae1f12c334b6dfc5a6f Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson <frjo@xdeb.org> Date: Thu, 14 Jul 2022 21:40:17 +0200 Subject: [PATCH] Link formatting, dropdown z-index and date format. --- .../activity/include/notifications_dropdown.html | 6 +++--- .../activity/templates/activity/notifications.html | 11 +++++------ .../apply/components/_activity-notifications.scss | 1 + hypha/static_src/src/sass/apply/components/_feed.scss | 2 ++ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/hypha/apply/activity/templates/activity/include/notifications_dropdown.html b/hypha/apply/activity/templates/activity/include/notifications_dropdown.html index d8926e90d..b6212ab5d 100644 --- a/hypha/apply/activity/templates/activity/include/notifications_dropdown.html +++ b/hypha/apply/activity/templates/activity/include/notifications_dropdown.html @@ -9,9 +9,9 @@ {% for activity in latest_notifications %} <p class="notifications__item"> <strong>{{ activity.source_content_type.name|source_type }} </strong> - <a href="{{ activity.source.get_absolute_url }}">{{ activity.source.title|capfirst|truncatechars:15 }}</a> - : {{ activity.user.get_full_name }} {% ifequal activity.type 'comment' %}{% trans "made a comment" %}{% else %} {{ activity|display_for:request.user }} - {% if activity.related_object %}<a href="{{ activity.related_object.get_absolute_url }}">{{ activity.related_object|model_verbose_name }}</a>{% endif %}{% endifequal %} + <a href="{{ activity.source.get_absolute_url }}{% ifequal activity.type 'comment' %}#communications{% endifequal %}">{{ activity.source.title|capfirst|truncatechars:15 }}</a> + : {{ activity.user.get_full_name }} {% ifequal activity.type 'comment' %}{% trans "made a comment" %}{% else %} {{ activity|display_for:request.user }}{% endifequal %} + {% if activity.related_object %}<a href="{{ activity.related_object.get_absolute_url }}">{{ activity.related_object|model_verbose_name }}</a>{% endif %} </p> {% endfor %} <p class="notifications__more"><a href="{% url "activity:notifications" %}">Show All</a></p> diff --git a/hypha/apply/activity/templates/activity/notifications.html b/hypha/apply/activity/templates/activity/notifications.html index b4b2c26c0..1b9f19f82 100644 --- a/hypha/apply/activity/templates/activity/notifications.html +++ b/hypha/apply/activity/templates/activity/notifications.html @@ -31,14 +31,14 @@ <div class="tabs__content" id="tab-1"> {% for activity in object_list %} {% if activity.type == 'comment' %} - <div class="feed__item feed__item--comment"> + <div class="feed__item feed__item--{{ activity.type }}"> <div class="feed__pre-content"> <p class="feed__label feed__label--{{ activity.source_content_type.name|source_type|lower }}">{{ activity.source_content_type.name|source_type }}</p> </div> <div class="feed__content js-feed-content"> <div class="feed__meta js-feed-meta"> - <p class="feed__meta-item"><a href="{{ activity.source.get_absolute_url }}">{{ activity.source.title|capfirst }}</a> - : {{ activity.user }} made a comment – {{ activity.timestamp|date:"SHORT_DATETIME_FORMAT" }}</p> + <p class="feed__meta-item"><a href="{{ activity.source.get_absolute_url }}#communications">{{ activity.source.title|capfirst }}</a> + : {{ activity.user.get_full_name }} {% trans "made a comment" %} – {{ activity.timestamp|date:"SHORT_DATE_FORMAT" }}</p> </div> </div> </div> @@ -49,15 +49,14 @@ <div class="tabs__content" id="tab-2"> {% for activity in object_list %} {% if activity.type == 'action' %} - <div class="feed__item feed__item--action"> + <div class="feed__item feed__item--{{ activity.type }}"> <div class="feed__pre-content"> <p class="feed__label feed__label--{{ activity.source_content_type.name|source_type|lower }}">{{ activity.source_content_type.name|source_type }}</p> </div> <div class="feed__content js-feed-content"> <div class="feed__meta js-feed-meta"> <p class="feed__meta-item"><a href="{{ activity.source.get_absolute_url }}">{{ activity.source.title|capfirst }}</a> - : {{ activity|display_for:request.user }} {% if activity.related_object %}<a href="{{ activity.related_object.get_absolute_url }}">{{ activity.related_object|model_verbose_name }}</a>{% endif %} - – {{ activity.timestamp|date:"SHORT_DATETIME_FORMAT" }}</p> + : {{ activity.user.get_full_name }} – {{ activity.timestamp|date:"SHORT_DATE_FORMAT" }} – {{ activity|display_for:request.user }} {% if activity.related_object %}<a href="{{ activity.related_object.get_absolute_url }}" class="feed__related-item">{{ activity.related_object|model_verbose_name }} <svg><use xlink:href="#arrow-head-pixels--solid"></use></svg></a>{% endif %}</p> </div> </div> </div> diff --git a/hypha/static_src/src/sass/apply/components/_activity-notifications.scss b/hypha/static_src/src/sass/apply/components/_activity-notifications.scss index ba63b70b7..132a6f373 100644 --- a/hypha/static_src/src/sass/apply/components/_activity-notifications.scss +++ b/hypha/static_src/src/sass/apply/components/_activity-notifications.scss @@ -2,6 +2,7 @@ &--dropdown { position: relative; display: inline-block; + z-index: 200; } &__bell { diff --git a/hypha/static_src/src/sass/apply/components/_feed.scss b/hypha/static_src/src/sass/apply/components/_feed.scss index 4f45fa2a6..83d342d4b 100644 --- a/hypha/static_src/src/sass/apply/components/_feed.scss +++ b/hypha/static_src/src/sass/apply/components/_feed.scss @@ -160,6 +160,8 @@ } &__related-item { + white-space: nowrap; + svg { width: 10px; height: 14px; -- GitLab