mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-28 11:00:36 +00:00
Merge pull request #2210 from bookwyrm-social/notification-cw
Show content warning in notification status previews
This commit is contained in:
commit
85f811022f
5 changed files with 18 additions and 5 deletions
|
@ -118,7 +118,7 @@
|
|||
<div class="notification py-2 {% if notification.id in unread %}is-primary is-light{% else %}has-background-body has-text-muted{% endif %}">
|
||||
<div class="columns">
|
||||
<div class="column is-clipped">
|
||||
{% include 'snippets/status_preview.html' with status=related_status %}
|
||||
{% include 'notifications/items/status_preview.html' with status=related_status %}
|
||||
</div>
|
||||
<div class="column is-narrow has-text-muted">
|
||||
{{ related_status.published_date|timesince }}
|
||||
|
|
|
@ -119,7 +119,7 @@
|
|||
<div class="notification py-2 {% if notification.id in unread %}is-primary is-light{% else %}has-background-body has-text-muted{% endif %}">
|
||||
<div class="columns">
|
||||
<div class="column is-clipped">
|
||||
{% include 'snippets/status_preview.html' with status=related_status %}
|
||||
{% include 'notifications/items/status_preview.html' with status=related_status %}
|
||||
</div>
|
||||
<div class="column is-narrow has-text-muted">
|
||||
{{ related_status.published_date|timesince }}
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
<div class="notification py-2 {% if notification.id in unread %}is-primary is-light{% else %}has-background-body has-text-default{% endif %}">
|
||||
<div class="columns">
|
||||
<div class="column is-clipped">
|
||||
{% include 'snippets/status_preview.html' with status=related_status %}
|
||||
{% include 'notifications/items/status_preview.html' with status=related_status %}
|
||||
</div>
|
||||
<div class="column is-narrow has-text-default">
|
||||
{{ related_status.published_date|timesince }}
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<div class="notification py-2 {% if notification.id in unread %}is-primary is-light{% else %}has-background-body has-text-default{% endif %}">
|
||||
<div class="columns">
|
||||
<div class="column is-clipped">
|
||||
{% include 'snippets/status_preview.html' with status=related_status %}
|
||||
{% include 'notifications/items/status_preview.html' with status=related_status %}
|
||||
</div>
|
||||
<div class="column is-narrow has-text-default">
|
||||
{{ related_status.published_date|timesince }}
|
||||
|
|
|
@ -1,4 +1,17 @@
|
|||
{% if status.content %}
|
||||
{% load i18n %}
|
||||
{% if status.content_warning %}
|
||||
|
||||
{% trans "Content warning" as text %}
|
||||
<span>
|
||||
<span class="icon icon-warning is-size-5" title="{{ text }}">
|
||||
<span class="is-sr-only">{{ text }}</span>
|
||||
</span>
|
||||
|
||||
<a href="{{ status.local_path }}">
|
||||
{{ status.content_warning }}
|
||||
</a>
|
||||
</span>
|
||||
{% elif status.content %}
|
||||
<a href="{{ status.local_path }}">
|
||||
{{ status.content | safe | truncatewords_html:10 }}{% if status.mention_books %} <em>{{ status.mention_books.first.title }}</em>{% endif %}
|
||||
</a>
|
Loading…
Reference in a new issue