Small refactor in messaging.
[wolnelektury.git] / src / catalogue / templates / catalogue / book_text.html
index 9f349bc..c0fe955 100644 (file)
     {% annoy_banners 'book-text-intermission' %}
 
     {% for insert in inserts %}
-      {% with text=insert.choose %}
-        <div class="dynamic-insert{% if text.image %} with-image{% endif %}" style="{% if text.text_color %}color: {{ text.text_color }};{% endif %}" data-paragraphs="{{ insert.paragraphs }}">
-          <a href="{% url 'club' %}">
-            <div class="text" style="{% if text.background_color %}background-color:{{ text.background_color }}{% endif %}">
-              {{ text.text }}
-            </div>
-            {% if text.image %}
-              <img src="{% thumbnail text.image '120x120' as thumb %}{{ thumb.url }}{% empty %}{{ text.image.url }}{% endthumbnail %}">
-            {% endif %}
-          </a>
-        </div>
-      {% endwith %}
+      {% include 'annoy/dynamic_insert.html' %}
     {% endfor %}
   </div>
 {% endblock footer %}