Content warnings.
[wolnelektury.git] / src / catalogue / templates / catalogue / snippets / content_warning.html
diff --git a/src/catalogue/templates/catalogue/snippets/content_warning.html b/src/catalogue/templates/catalogue/snippets/content_warning.html
new file mode 100644 (file)
index 0000000..8bee24d
--- /dev/null
@@ -0,0 +1,8 @@
+{% load i18n %}
+{% if warnings %}
+<p class="content-warning" style="background-color: #9e3610; color:white; display:inline-block; padding: 5px 10px; border-radius: 1em;">
+  {% trans "Caution: text contains" %}
+  {% for w in warnings %}{% if forloop.counter > 1 %},{% endif %}
+    {{ w }}{% endfor %}.
+</p>
+{% endif %}