1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <!--
- marked parts of the template is external code
- import from https://tutorial.djangogirls.org/en/template_extending/
- -->
- {% extends 'base.html' %} {% block content %}
- <div class="row">
- {% if tag %} <div class="mx-auto">
- <h2> Artikel mit dem Tag "{{ tag.name }}" </h2>
- </div>{% endif %}
- </div>
- <!-- imported start -->
- <div class="row">
- <div class="mx-auto">
- <h1> Artikleübersicht </h1>
- </div>
- </div>
- <!-- imported end -->
-
- <div class="row">
- <div class="col-md-8">
- {% if messages %}
- <div class="messages">
- {% for message in messages %}
- <p {% if message.tags %} class="{{ message.tags }}" {% endif %}>{{ message }}</p>
- {% endfor %}
- </div>
-
- <!-- imported start -->
- {% endif %}
- {% for post in posts %}
- <div class="mt-5 post">
- <div class="date">
- {{ post.published_date }}
- </div>
- <h2>
- <a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a>
- </h2>
- <p>{{ post.text|linebreaks }}</p>
- <!-- imported end -->
-
- Tags: {% for tag in post.tags.all %}
- <a href="{% url 'post_list_by_tag' tag.slug %}">{{ tag.name }}</a>
- {% if not forloop.last %}, {% endif %} {% endfor %} <p>
- {{ post.author }}
- </p>
- </div>
- {% endfor %}
- </div>
- </div>
- {% endblock %}
|