update home page + sidebar items sizing

This commit is contained in:
bkfox
2022-08-07 12:55:03 +02:00
parent a4593dc0c5
commit ffd5b5b013
8 changed files with 69 additions and 63 deletions

View File

@ -132,10 +132,11 @@ Usefull context:
{# FIXME: block cover into sidebar one #}
{% block cover %}
{% if page and page.cover %}
<img class="cover" src="{{ page.cover.url }}" class="cover"/>
<img class="cover mb-4" src="{{ page.cover.url }}" class="cover"/>
{% endif %}
{% endblock %}
{% with is_thin=True %}
{% block sidebar %}
{% if sidebar_object_list %}
{% with object_list=sidebar_object_list %}
@ -152,6 +153,7 @@ Usefull context:
{% endif %}
</section>
{% endblock %}
{% endwith %}
</aside>
{% endif %}
</div>

View File

@ -23,22 +23,7 @@
{% block pages_list %}
{% with hide_schedule=True %}
<section role="list">
<div id="timetable-{{ date|date:"Y-m-d" }}">
{% for diffusion in object_list %}
<div class="columns {% if diffusion.is_now %}has-background-primary{% endif %}">
<div class="column is-one-fifth has-text-right">
<time datetime="{{ diffusion.start|date:"c" }}">
{{ diffusion.start|date:"H:i" }} - {{ diffusion.end|date:"H:i" }}
</time>
</div>
<div class="column">
{% with diffusion.episode as object %}
{% include "aircox/widgets/episode_item.html" %}
{% endwith %}
</div>
</div>
{% endfor %}
</div>
{% include 'aircox/widgets/diffusion_list.html' %}
</section>
{% endwith %}
{% endblock %}

View File

@ -14,10 +14,10 @@
{% block pages_list %}
{% if page and page.content %}<hr/>{% endif %}
{% if top_diffs %}
{% if next_diffs %}
<div class="columns">
{% with render_card=True %}
{% for object in top_diffs %}
{% for object in next_diffs %}
{% with is_primary=object.is_now %}
<div class="column is-relative">
<h4 class="card-super-title" title="{{ object.start }}">
@ -40,16 +40,16 @@
{% endfor %}
{% endwith %}
</div>
<hr>
{% endif %}
<h4 class="title is-4">{% translate "Last publications" %}</h4>
{% with has_headline=True %}
{{ block.super }}
{% endwith %}
{% if object_list %}
<h4 class="title is-4">{% translate "Today" %}</h4>
<section role="list">
{% include 'aircox/widgets/diffusion_list.html' %}
</section>
{% endif %}
{% endblock %}
{% block pagination %}
<ul class="pagination-list">
<li>
@ -65,25 +65,20 @@
{% block sidebar %}
<section>
<h4 class="title is-4">{% translate "Previously on air" %}</h4>
{% with has_cover=False %}
{% with logs as object_list %}
{% include "aircox/widgets/log_list.html" %}
{% endwith %}
{% endwith %}
</section>
<section>
<h4 class="title is-4">{% translate "Today" %}</h4>
{% with is_thin=True %}
<h4 class="title is-4">{% translate "Last publications" %}</h4>
{% with hide_schedule=True %}
{% with has_headline=False %}
<table class="table is-fullwidth has-background-transparent">
{% for object in sidebar_object_list %}
<tr {% if object.is_now %}class="is-selected"{% endif %}>
<td>{{ object.start|date:"H:i" }}</td>
<td>{% include "aircox/widgets/diffusion_item.html" %}</td>
</tr>
{% for object in last_publications %}
{% include object.item_template_name|default:'aircox/widgets/page_item.html' %}
{% endfor %}
</table>
{% endwith %}
{% endwith %}
{% endwith %}
</section>

View File

@ -8,6 +8,7 @@ Context variables:
- is-primary: render as primary
- has_headline (=False): if True, display headline
- has_cover (=True): hide page cover
- is_thin (=False): if True, smaller cover and display less info
{% endcomment %}
{% if render_card %}
@ -31,8 +32,13 @@ Context variables:
<article class="media item {% block css %}{% endblock%}">
{% if has_cover|default_if_none:True %}
<div class="media-left">
{% if is_thin %}
<img src="{% thumbnail object.cover|default:station.default_cover 64x64 crop=scale %}"
class="cover is-tiny">
{% else %}
<img src="{% thumbnail object.cover|default:station.default_cover 128x128 crop=scale %}"
class="cover is-small">
{% endif %}
</div>
{% endif %}
<div class="media-content">

View File

@ -0,0 +1,22 @@
{% comment %}
Context:
- object_list: object list
- date: date for list
{% endcomment %}
<table id="timetable{% if date %}-{{ date|date:"Y-m-d" }}{% endif %}" style="border:none;">
{% for diffusion in object_list %}
<tr class="{% if diffusion.is_now %}has-background-primary{% endif %}">
<td class="pr-2 pb-2">
<time datetime="{{ diffusion.start|date:"c" }}">
{{ diffusion.start|date:"H:i" }} - {{ diffusion.end|date:"H:i" }}
</time>
</td>
<td class="pb-2">
{% with diffusion.episode as object %}
{% include "aircox/widgets/episode_item.html" %}
{% endwith %}
</td>
</tr>
{% endfor %}
</table>