Show single-article categories directly

This commit is contained in:
Oleg Lavrovsky 2017-04-19 18:45:51 +02:00
parent 432ca9b69f
commit 63fd774730
4 changed files with 123 additions and 59 deletions

View file

@ -0,0 +1,48 @@
{% if page.feed_image %}
<div class="image">
{% image page.feed_image fill-940x400 class="img-responsive" %}
</div>
{% endif %}
<h2>{{ page.trans_title }}</h2>
<p class="lead">{{ page.trans_intro|richtext }}</p>
{% if page.date %}
<p class="date">{{ page.date }}</p>
{% endif %}
<!-- Main content -->
<div class="article-body" role="main">
{% for block in page.trans_body %}
{% if block.block_type == 'heading' %}
<h3>{{ block.value }}</h3>
{% elif block.block_type != 'info' %}
<p class="block-{{ block.block_type }}">
{% include_block block %}
</p>
{% endif %}
{% endfor %}
</div>
<!-- Infoblocks -->
<div class="row">
{% for block in page.trans_body %}
{% if block.block_type == 'info' %}
<article class="col-md-4">
<div class="image">
{% image block.value.photo fill-300x300 %}
</div>
<header>
<h3>{{ block.value.title }}</h3>
</header>
{{ block.value.summary|richtext }}
{% if block.value.action %}
<footer>
<a href="{{ block.value.url }}" class="btn btn-default">{{ block.value.action }}</a>
</footer>
{% endif %}
</article>
{% endif %}
{% endfor %}
</div>

View file

@ -4,23 +4,36 @@
{% block body_class %}template-{{ self.get_verbose_name|slugify }}{% endblock %}
{% block content %}
{% if articles|length > 1 %}
<section id="article-index">
<div class="container">
<h2>{{ page.trans_title }}</h2>
<p class="lead">{{ page.trans_intro|richtext }}</p>
<div class="article-body" role="main">
{% for entry in articles %}
<div class="item">
<div class="article-caption">
<h3><a href="{% pageurl entry %}">{{ entry.trans_title }}</a></h3>
<p>{{ entry.trans_intro|richtext }}</p>
<h2>{{ page.trans_title }}</h2>
<p class="lead">{{ page.trans_intro|richtext }}</p>
<div class="article-body" role="main">
{% for entry in articles %}
<div class="item">
<div class="article-caption">
<h3><a href="{% pageurl entry %}">{{ entry.trans_title }}</a></h3>
<p>{{ entry.trans_intro|richtext }}</p>
</div>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
</div><!-- /container -->
</div><!-- /container -->
</section>
{% elif articles|length > 0 %}
<section id="news-details">
<div class="container">
{% for page in articles %}
{% include 'home/page_content.html' %}
{% endfor %}
</div>
</section>
{% endif %}
{% if subcategories %}
<section id="three" class="article-subcategories" class="wrapper align-center">
<div class="container">

View file

@ -7,54 +7,7 @@
<section id="news-details">
<div class="container">
{% if page.feed_image %}
<div class="image">
{% image page.feed_image fill-940x400 class="img-responsive" %}
</div>
{% endif %}
<h2>{{ page.trans_title }}</h2>
<p class="lead">{{ page.trans_intro|richtext }}</p>
{% if page.date %}
<p class="date">{{ page.date }}</p>
{% endif %}
<!-- Main content -->
<div class="article-body" role="main">
{% for block in page.trans_body %}
{% if block.block_type == 'heading' %}
<h3>{{ block.value }}</h3>
{% elif block.block_type != 'info' %}
<p class="block-{{ block.block_type }}">
{% include_block block %}
</p>
{% endif %}
{% endfor %}
</div>
<!-- Infoblocks -->
<div class="row">
{% for block in page.trans_body %}
{% if block.block_type == 'info' %}
<article class="col-md-4">
<div class="image">
{% image block.value.photo fill-300x300 %}
</div>
<header>
<h3>{{ block.value.title }}</h3>
</header>
{{ block.value.summary|richtext }}
{% if block.value.action %}
<footer>
<a href="{{ block.value.url }}" class="btn btn-default">{{ block.value.action }}</a>
</footer>
{% endif %}
</article>
{% endif %}
{% endfor %}
</div>
{% include 'home/page_content.html' %}
</div>
</section>

View file

@ -0,0 +1,50 @@
{% load wagtailcore_tags wagtailimages_tags %}
{% if page.feed_image %}
<div class="image">
{% image page.feed_image fill-940x400 class="img-responsive" %}
</div>
{% endif %}
<h2>{{ page.trans_title }}</h2>
<p class="lead">{{ page.trans_intro|richtext }}</p>
{% if page.date %}
<p class="date">{{ page.date }}</p>
{% endif %}
<!-- Main content -->
<div class="article-body" role="main">
{% for block in page.trans_body %}
{% if block.block_type == 'heading' %}
<h3>{{ block.value }}</h3>
{% elif block.block_type != 'info' %}
<p class="block-{{ block.block_type }}">
{% include_block block %}
</p>
{% endif %}
{% endfor %}
</div>
<!-- Infoblocks -->
<div class="row">
{% for block in page.trans_body %}
{% if block.block_type == 'info' %}
<article class="col-md-4">
<div class="image">
{% image block.value.photo fill-300x300 %}
</div>
<header>
<h3>{{ block.value.title }}</h3>
</header>
{{ block.value.summary|richtext }}
{% if block.value.action %}
<footer>
<a href="{{ block.value.url }}" class="btn btn-default">{{ block.value.action }}</a>
</footer>
{% endif %}
</article>
{% endif %}
{% endfor %}
</div>