draft templates for detail and section views

This commit is contained in:
krmax44 2022-03-14 17:45:23 +01:00
parent 20fe00e8f7
commit b5b86f5c85
No known key found for this signature in database
GPG key ID: 5C499A4F4EC4EE03
4 changed files with 161 additions and 67 deletions

View file

@ -1,10 +1,21 @@
{% extends "cms/page.html" %}
{% load cms_tags %}
{% load menu_tags %}
{% block navbar %}{% endblock %}
{% block body %}
<nav class="breadcrumb-container" aria-label="breadcrumb">
<div class="container">
<ol class="breadcrumb">
{# TODO: make this dynamic #}
<li class="breadcrumb-item"><a href="/koalitionstracker/">Koalitionstracker</a></li>
{% block govplan_breadcrumbs %}{% endblock %}
</ol>
</div>
</nav>
{% static_placeholder "govplan_header" %}
{% block app_body %}
{% placeholder "content" %}

View file

@ -7,25 +7,85 @@
{% block title %}{{ object.title }}{% endblock %}
{% block govplan_breadcrumbs %}
<li class="breadcrumb-item active" aria-current="page">
<a href="{{ object.get_absolute_url }}">{{ object.title }}</a>
</li>
{% endblock %}
{% block app_body %}
<div class="container mt-3 mb-5">
<div class="container mb-5">
<div class="row justify-content-center mb-5">
<div class="col col-lg-8 mt-md-n5">
<div class="box-card border-yellow md:shadow-yellow bg-white">
<div>
<div class="flex-grow-1 tight-margin p-3 p-md-4 p-lg-5">
<h1 class="mt-0 h3">
{{ object.title }}
</h1>
<div class="jumbotron">
<small class="badge badge-light">Vorhaben der {{ object.government.name }}</small>
<h1 class="display-4 mt-0">
{{ object.title }}
</h1>
<div class="d-md-flex my-3 align-items-center">
<ul class="list-unstyled d-flex m-0">
<li>
<span class="badge badge-{{ object.get_status_css }} mr-2">
{{ object.get_status_display }}
</span>
</li>
{% for cat in object.categories.all %}
<li>
<a href="{% comment %} TODO: link to category {% endcomment %}">
<span class="badge badge-light mr-2">{{ cat.name }}</span>
</a>
</li>
{% endfor %}
</ul>
<div class="ml-auto">
{% show_follow "govplan" object %}
</div>
</div>
{% if object.quote %}
<blockquote>
{{ object.quote | markdown }}
</blockquote>
{% endif %}
{% with refs=object.get_reference_links %}
{% if refs %}
<p class="small">
{% if refs|length > 1 %}
Quellen:
{% else %}
Quelle:
{% endif %}
{% for ref in refs %}
<a href="{{ ref }}" target="_blank">
{{ forloop.counter }}
</a>
{% endfor %}
</p>
{% endif %}
{% endwith %}
{% if object.organization %}
<p>
Dieses Vorhaben wird beobachtet von
<a href="{{ object.organization.website }}">
{{ object.organization.name }}
</a>
</p>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
{% if object.image %}
{# this should not be a dependency! #}
{% include "fds_blog/includes/_picture.html" with picture=object.image %}
{% endif %}
<div class="container">
<dl>
<dt>Status</dt>
<dd>{{ object.get_status_display }}</dd>
{% if object.rating %}
<dt>Bewertung</dt>
<dd>{{ object.get_rating_display }}</dd>
@ -44,37 +104,9 @@
{{ object.description | safe }}
</div>
{% if object.quote %}
<details>
<summary>Zitat</summary>
<blockquote class="blockquote">
{{ object.quote | markdown }}
</blockquote>
</details>
{% endif %}
{% with refs=object.get_reference_links %}
{% if refs %}
<p>
{% if refs|length > 1 %}
Quellen:
{% else %}
Quelle:
{% endif %}
{% for ref in refs %}
<a href="{{ ref }}" target="_blank">
{{ forloop.counter }}
</a>
{% endfor %}
</p>
{% endif %}
{% endwith %}
{% show_follow "govplan" object %}
<p>
{% for cat in object.categories.all %}<span class="badge badge-light mr-2">{{ cat.name }}</span>{% endfor %}
</p>
{% if object.responsible_publicbody %}
<p>
@ -85,15 +117,6 @@
</p>
{% endif %}
{% if object.organization %}
<p>
Dieses Vorhaben wird beobachtet von
<a href="{{ object.organization.website }}">
{{ object.organization.name }}
</a>
</p>
{% endif %}
<h3>Neueste Entwicklungen</h3>
{% for update in updates %}
<h4>{{ update.title }}</h4>

View file

@ -4,26 +4,69 @@
{% load markup %}
{% load cms_tags %}
{% load follow_tags %}
{% load thumbnail %}
{% block title %}{{ object.title }}{% endblock %}
{% block govplan_breadcrumbs %}
<li class="breadcrumb-item active" aria-current="page">
<a href="{{ object.get_absolute_url }}">{{ object.title }}</a>
</li>
{% endblock %}
{% block app_body %}
<div class="container mt-3 mb-5">
<div class="container mb-5">
<div class="row justify-content-center mb-5">
<div class="col col-lg-8 mt-md-n5">
<div class="box-card {% comment %} box-card-has-image-lg {% endcomment %} border-yellow md:shadow-yellow bg-white">
<div>
{% comment %} <div class="box-card-image overlap-right text-center">
{% with picture=object.image %}
<picture>
{% if ".svg" not in picture.url %}
{% thumbnail picture 280x0 crop=smart subject_location=picture.subject_location as thumb %}
<source
media="(min-width: 992px)"
srcset="{{ thumb.url }}"
/>
<source
media="(min-width: 992px)"
srcset="{{ thumb.url }}.avif"
type="image/avif"
/>
{% thumbnail picture 200x0 crop=smart subject_location=picture.subject_location as thumb %}
<source
srcset="{{ thumb.url }}.avif"
type="image/avif"
/>
{% endif %}
<img class="img-lg z-index-10" width="{{ thumb.width }}" height="{{ thumb.height }}" src="{{ thumb.url }}"
{% if picture.default_alt_text and not attributes.alt %} alt="{{ picture.default_alt_text }}"{% endif %}>
</picture>
{% endwith %}
</div> {% endcomment %}
<div class="jumbotron">
<small class="badge badge-light">{{ object.government.name }}</small>
<h1 class="display-4 mt-0">
{{ object.title }}
</h1>
<div class="flex-grow-1 tight-margin p-3 p-md-4 p-lg-5">
<h1 class="mt-0">
{{ object.title }}
</h1>
<p>
{% blocktranslate with section=object.title %}
Here you can find all plans of the section "{{section}}", which the coalition constituted in their agreement. On the curresponding detail pages, you'll get more information, stay up to date with news or submit changes.
{% endblocktranslate %}
</p>
{# TODO: make this dynamic #}
<a href="/koalitionstracker/" class="action-link">zurück zu allen Kategorien</a>
</div>
</div>
</div>
</div>
{% if object.image %}
{# this should not be a dependency! #}
{% include "fds_blog/includes/_picture.html" with picture=object.image %}
{% endif %}
{% render_placeholder object.content_placeholder %}
</div>
</div>
<div class="container">
{% include "froide_govplan/plugins/card_cols.html" with object_list=plans %}
</div>
{% endblock %}