forked from rc/aircox
feat: add error message page; improve admin ui; add missing test files
This commit is contained in:
@ -2,92 +2,92 @@
|
||||
{% load i18n thumbnail %}
|
||||
|
||||
|
||||
{% block messages %}
|
||||
{{ block.super }}
|
||||
|
||||
{% block app %}
|
||||
<div class="section">
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
<h1 class="title is-4">{% translate "Today" %}</h1>
|
||||
<table class="table is-fullwidth is-striped">
|
||||
<tbody>
|
||||
{% for diffusion in diffusions %}
|
||||
{% with episode=diffusion.episode %}
|
||||
<tr {% if diffusion.is_now %}class="is-selected"{% endif %}>
|
||||
<td>{{ diffusion.start|time }} - {{ diffusion.end|time }}</td>
|
||||
<td><img src="{% thumbnail episode.cover 64x64 crop %}"/></td>
|
||||
<td>
|
||||
<a href="{% url "admin:aircox_episode_change" episode.pk %}">{{ episode.title }}</a>
|
||||
|
||||
{% if diffusion.type == diffusion.TYPE_ON_AIR %}
|
||||
<span class="tag is-info">
|
||||
<span class="icon is-small">
|
||||
{% if diffusion.is_live %}
|
||||
<i class="fa fa-microphone"
|
||||
title="{% translate "Live diffusion" %}"></i>
|
||||
{% else %}
|
||||
<i class="fa fa-music"
|
||||
title="{% translate "Differed diffusion" %}"></i>
|
||||
{% endif %}
|
||||
</span>
|
||||
<div class="box">
|
||||
<h1 class="title icon-text is-4">
|
||||
<span class="icon"><i class="fa-regular fa-calendar-days"></i></span>
|
||||
<span>{% translate "Today" %}</span>
|
||||
</h1>
|
||||
{% if diffusions %}
|
||||
<table class="table is-fullwidth is-striped">
|
||||
<tbody>
|
||||
{% for diffusion in diffusions %}
|
||||
{% with episode=diffusion.episode %}
|
||||
<tr {% if diffusion.is_now %}class="is-selected"{% endif %}>
|
||||
<td>{{ diffusion.start|time }} - {{ diffusion.end|time }}</td>
|
||||
<td><img src="{% thumbnail episode.cover 64x64 crop %}"/></td>
|
||||
<td>
|
||||
<a href="{% url "admin:aircox_episode_change" episode.pk %}">{{ episode.title }}</a>
|
||||
|
||||
{{ diffusion.get_type_display }}
|
||||
</span>
|
||||
{% elif diffusion.type == diffusion.TYPE_CANCEL %}
|
||||
<span class="tag is-danger">
|
||||
{{ diffusion.get_type_display }}</span>
|
||||
{% elif diffusion.type == diffusion.TYPE_UNCONFIRMED %}
|
||||
<span class="tag is-warning">
|
||||
{{ diffusion.get_type_display }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="column">
|
||||
<h1 class="title is-4">{% translate "Latest comments" %}</h1>
|
||||
<table class="table is-fullwidth is-striped">
|
||||
{% for comment in comments %}
|
||||
{% with page=comment.page %}
|
||||
<tr>
|
||||
<th>
|
||||
{{ page.title }}
|
||||
</a>
|
||||
|
|
||||
<span title="{{ comment.email }}">{{ comment.nickname }}</span>
|
||||
—
|
||||
<span>{{ comment.date }}</span>
|
||||
<span class="float-right">
|
||||
<a href="{% url "admin:aircox_comment_change" comment.pk %}"
|
||||
title="{% translate "Edit comment" %}"
|
||||
aria-label="{% translate "Edit comment" %}">
|
||||
<span class="fa fa-edit"></span>
|
||||
</a>
|
||||
<a class="has-text-danger"
|
||||
title="{% translate "Delete comment" %}"
|
||||
aria-label="{% translate "Delete comment" %}"
|
||||
href="{% url "admin:aircox_comment_delete" comment.pk %}">
|
||||
<span class="fa fa-trash-alt"></span>
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
{{ comment.content|slice:"0:128" }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="has-text-centered">
|
||||
<a href="{% url "admin:aircox_comment_changelist" %}" class="float-center">{% translate "All comments" %}</a>
|
||||
{% if diffusion.type == diffusion.TYPE_ON_AIR %}
|
||||
<span class="tag is-info">
|
||||
<span class="icon is-small">
|
||||
{% if diffusion.is_live %}
|
||||
<i class="fa fa-microphone"
|
||||
title="{% translate "Live diffusion" %}"></i>
|
||||
{% else %}
|
||||
<i class="fa fa-music"
|
||||
title="{% translate "Differed diffusion" %}"></i>
|
||||
{% endif %}
|
||||
</span>
|
||||
|
||||
{{ diffusion.get_type_display }}
|
||||
</span>
|
||||
{% elif diffusion.type == diffusion.TYPE_CANCEL %}
|
||||
<span class="tag is-danger">
|
||||
{{ diffusion.get_type_display }}</span>
|
||||
{% elif diffusion.type == diffusion.TYPE_UNCONFIRMED %}
|
||||
<span class="tag is-warning">
|
||||
{{ diffusion.get_type_display }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<div class="block has-text-centered">
|
||||
{% trans "No diffusion is scheduled for today." %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<h1 class="title is-4 icon-text">
|
||||
<span class="icon"><i class="fa-regular fa-comments"></i></span>
|
||||
<span>{% translate "Latest comments" %}</span>
|
||||
</h1>
|
||||
{% if comments %}
|
||||
{% include "aircox/widgets/page_list.html" with object_list=comments with_title=True %}
|
||||
<div class="has-text-centered">
|
||||
<a href="{% url "admin:aircox_comment_changelist" %}" class="float-center">{% translate "All comments" %}</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="block has-text-centered">{% trans "No comment posted yet" %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="box">
|
||||
<h1 class="title is-4 icon-text">
|
||||
<span class="icon"><i class="fa-regular fa-newspaper"></i></span>
|
||||
<span>{% translate "Latest publications" %}</span>
|
||||
</h1>
|
||||
{% if latests %}
|
||||
{% include "aircox/widgets/page_list.html" with object_list=latests no_actions=True %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="box">
|
||||
<h1 class="title is-4 icon-text">
|
||||
<span class="icon"><i class="fa fa-screwdriver-wrench"></i></span>
|
||||
<span>{% translate "Administration" %}</span>
|
||||
</h1>
|
||||
{% include "admin/app_list.html" with app_list=app_list show_changelinks=True %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user