From: Jan Szejko Date: Fri, 21 Apr 2017 10:32:05 +0000 (+0200) Subject: adapt audience display for multiple values X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/a74c48a5de6d9a00f76f7c10b41bd4a26691a22f?hp=b6d961cf3b454e6fcc9365a1121c34501f5f9106 adapt audience display for multiple values --- diff --git a/apps/catalogue/templates/catalogue/book_text.html b/apps/catalogue/templates/catalogue/book_text.html index efe23be6..453157ee 100644 --- a/apps/catalogue/templates/catalogue/book_text.html +++ b/apps/catalogue/templates/catalogue/book_text.html @@ -147,7 +147,7 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', e
-{% trans "Audience" %}: {{ doc.meta.audience|default:"–" }} +{% trans "Audience" %}: {{ doc.meta.audience|join:", "|default:"–" }}
{% trans "Finished resources" %} -{% for doc in objects_list %} - -{% endfor %} - - +

{% trans "Finished resources" %}

+ {% for doc in objects_list %} + {% include "catalogue/resource_box.html" with link_url='catalogue_html' %} + {% endfor %} {% endblock %} diff --git a/apps/catalogue/templates/catalogue/resource_box.html b/apps/catalogue/templates/catalogue/resource_box.html new file mode 100644 index 00000000..9e022c6b --- /dev/null +++ b/apps/catalogue/templates/catalogue/resource_box.html @@ -0,0 +1,24 @@ +{% load i18n %} +{% load thumbnail %} +{% load catalogue_files %} + diff --git a/apps/catalogue/templates/catalogue/upcoming.html b/apps/catalogue/templates/catalogue/upcoming.html index a95c9b36..9a8ae8c5 100644 --- a/apps/catalogue/templates/catalogue/upcoming.html +++ b/apps/catalogue/templates/catalogue/upcoming.html @@ -1,33 +1,10 @@ {% extends "catalogue/base.html" %} {% load i18n %} -{% load thumbnail catalogue_files %} {% block inner_content %} - -

{% trans "Upcoming resources" %}

-{% for doc in objects_list %} - -{% endfor %} - +

{% trans "Upcoming resources" %}

+ {% for doc in objects_list %} + {% include "catalogue/resource_box.html" with link_url='catalogue_preview' %} + {% endfor %} {% endblock %} diff --git a/redakcja/templates/main.html b/redakcja/templates/main.html index 64421c38..7d28701e 100644 --- a/redakcja/templates/main.html +++ b/redakcja/templates/main.html @@ -1,7 +1,7 @@ {% extends "catalogue/base.html" %} {% load i18n %} {% load thumbnail %} -{% load catalogue_files %} +{% load static %} {% block content %} @@ -28,7 +28,7 @@
{#{% trans "Competition" %}#}

{% trans "Joint project by:" %}

- +
@@ -46,7 +46,7 @@

{% trans "See active organizations and join" %}

{% for org in organizations %} -
+
{% if org.logo %} {% thumbnail org.logo "160x100" format="PNG" padding=True as th %} @@ -68,27 +68,7 @@

{% trans "Finished resources" %}

{% for doc in finished %} -
+ {% include "catalogue/resource_box.html" with link_url='catalogue_html' %} {% endfor %} {% if more_finished %}

{% trans "More finished resources" %}

@@ -98,27 +78,7 @@

{% trans "Upcoming resources" %}

{% for doc in upcoming %} - + {% include "catalogue/resource_box.html" with link_url='catalogue_preview' %} {% endfor %} {% if more_upcoming %}

{% trans "More upcoming resources" %}