radiocampus: integrate marielle design (step 1)

This commit is contained in:
2024-08-29 11:59:49 +02:00
parent a0be3c0fda
commit b7429e11f0
7 changed files with 378 additions and 13 deletions

View File

@ -0,0 +1,98 @@
{% extends "aircox/public.html" %}
{% load static i18n humanize honeypot aircox %}
{% comment %}
Base template used to display a Page
Context:
- page: page
- parent: parent page
- related_objects: list of object to display as related publications
- related_url: url to the full list of related_objects
{% endcomment %}
{% block breadcrumbs %}
{% if parent %}
{% include "./widgets/breadcrumbs.html" with page=parent %}
{% if page %}
<a href="{% url page.list_url_name parent_slug=parent.slug %}">
{{ page|verbose_name:True }}
</a>
{% endif %}
{% elif page %}
{% include "./widgets/breadcrumbs.html" with page=page no_title=True %}
{% endif %}
{% endblock %}
{% block title-container %}
{{ block.super }}
{% block page-actions %}
{% include "aircox/widgets/page_actions.html" %}
{% endblock %}
{% endblock %}
{% block main %}
{{ block.super }}
{% block episodes %}
{% endblock %}
{% block related %}
{% if related_objects %}
<section class="container">
{% with models=object|verbose_name:True %}
<h2 class="title is-2">{% blocktranslate %}Related {{models}}{% endblocktranslate %}</h2>
{% include "./widgets/carousel.html" with objects=related_objects url_name=object.list_url_name url_category=object.category %}
{% endwith %}
</section>
{% endif %}
{% endblock %}
{% block comments %}
{% if comments %}
<section class="container">
<h2 class="title is-2">{% translate "Comments" %}</h2>
{% for object in comments %}
{% page_widget "item" object %}
{% endfor %}
</section>
{% endif %}
{% if comment_form %}
<section class="container">
<h2 class="title is-2">{% translate "Post a comment" %}</h2>
<form method="POST">
{% csrf_token %}
{% render_honeypot_field "website" %}
<div class="field">
<div class="control">
{{ comment_form.content }}
</div>
</div>
{% for field in comment_form %}
{% if field.name != "content" %}
<div class="field is-horizontal">
<label class="label">{{ field.label }}</label>
<div class="control">{{ field }}</div>
</div>
{% if field.errors %}
<p class="help is-danger">{{ field.errors }}</p>
{% endif %}
{% if field.help_text %}
<p class="help">{{ field.help_text|safe }}</p>
{% endif %}
{% endif %}
{% endfor %}
<div class="has-text-right">
<button type="submit" class="button">{% translate "Post comment" %}</button>
</div>
</form>
</section>
{% endif %}
{% endblock %}
{% endblock %}

View File

@ -0,0 +1,27 @@
{% extends "aircox/page_list.html" %}
{% comment %}Display a list of Pages{% endcomment %}
{% load i18n aircox %}
{% block breadcrumbs %}
{% if parent and model.list_url_name %}
{% include "./widgets/breadcrumbs.html" with page=parent %}
<a href="{% url model.list_url_name %}">{{ model|verbose_name:True }}</a>
{% elif page.title == "Podcasts" and not category %}
{% elif page and model.list_url_name %}
<a href="{% url model.list_url_name %}">{{ page.title }}</a>
{% if category %}
<a href="{% url request.resolver_match.url_name category_slug=category.slug %}">
{{ category.title }}
</a>
{% endif %}
{% else %}
<a href="{% url request.resolver_match.url_name %}">{{ model|verbose_name:True }}</a>
{% if category %}
<a href="{% url request.resolver_match.url_name category_slug=category.slug %}">
{{ category.title }}
</a>
{% endif %}
{% endif %}
{% endblock %}
{% block content-container %}{% endblock %}

View File

@ -0,0 +1,61 @@
{% extends "aircox/page_detail.html" %}
{% comment %}Detail page of a show{% endcomment %}
{% load i18n aircox %}
{% block content %}
{% with schedules=object.schedule_set.all %}
{% if object.active and schedules %}
<header class="schedules mt-3">
{% for schedule in schedules %}
<div class="schedule">
<div class="heading">
<span class="day">{{ schedule.get_frequency_display }}</span>
{% with schedule.start|date:"H:i" as start %}
{% with schedule.end|date:"H:i" as end %}
<time datetime="{{ start }}">{{ start }}</time>
&mdash;
<time datetime="{{ end }}">{{ end }}</time>
{% endwith %}
{% endwith %}
<small>
{% if schedule.is_rerun %}
{% with schedule.initial.date as date %}
<span title="{% blocktranslate %}Rerun of {{ date }}{% endblocktranslate %}">
({% translate "Rerun" %})
</span>
{% endwith %}
{% endif %}
</small>
</div>
</div>
{% endfor %}
</header>
{% endif %}
{% endwith %}
{{ block.super }}
{% endblock %}
{% block episodes %}
{% if episodes %}
<section class="container">
<h2 class="title is-2">{% translate "Last Episodes" %}</h2>
{% include "./widgets/carousel.html" with objects=episodes url_name="episode-list" url_parent=object url_label=_("All episodes") %}
</section>
{% endif %}
{% endblock %}
{% block main %}
{{ block.super }}
{% if articles %}
<section class="container">
<h2 class="title is-2">{% translate "Last Articles" %}</h2>
{% include "./widgets/carousel.html" with objects=articles url_name="article-list" url_parent=object url_label=_("All articles") %}
</section>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,71 @@
{% extends "./page.html" %}
{% load i18n humanize aircox %}
{% block outer %}
{% with diffusion.is_now as is_active %}
{{ block.super }}
{% endwith %}
{% endblock %}
{% block subtitle %}
{% if diffusion %}
{% if timetable %}
{{ diffusion.start|date:"H:i" }}
&mdash;
{{ diffusion.end|date:"H:i" }}
{% else %}
{{ diffusion.start|naturalday }},
{{ diffusion.start|date:"H:i" }}
{% endif %}
{% else %}
{{ block.super }}
{% endif %}
{% endblock %}
{% block actions-container %}
{% if admin and diffusion %}
<div class="flex-row">
<div class="flex-grow-1">
{% 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>
&nbsp;
{{ 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 %}
</div>
{{ block.super }}
</div>
{% else %}
{{ block.super }}
{% endif %}
{% endblock %}
{% block actions %}
{{ block.super }}
{% if object.episodesound_set.available.public.count %}
<button type="button" class="button action" @click="player.playButtonClick($event)"
data-sounds="{{ object.podcasts|json }}">
<span class="icon is-small">
<span class="fas fa-play" title="{% translate "Listen" %}"></span>
</span>
<!--<label>{% translate "Listen" %}</label> -->
</button>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,42 @@
{% extends "./preview.html" %}
{% load i18n aircox %}
{% block tag-class %}{{ block.super }} list-item is-fullwidth{% endblock %}
{% block headings %}
{% endblock %}
{% block inner %}
{% block headings-container %}{{ block.super }}{% endblock %}
{% block content-container %}
<div class="media">
{% if object.cover and not no_cover %}
<a href="{{ object.get_absolute_url }}"
class="media-left preview-cover small"
style="background-image: url({{ object.cover.url }})">
</a>
{% endif %}
<div class="media-content flex-column">
{% if object|model_name == "Episode" %}
<div class="episode-date">
{{ object.pub_date|date:"d/m/Y" }}<Br/>
</div>
{% endif %}
<a href="{{ url|escape }}" class="heading title {% block title-class %}{% endblock %}">
{% block title %}{{ title|default:"" }}{% endblock %}
</a>
<span class="heading subtitle {% block subtitle-class %}{% endblock %}">
{% block subtitle %}{{ subtitle|default:"" }}{% endblock %}
</span>
</br>
<section class="content flex-grow-1">
{% block content %}{{ block.super }}{% endblock %}
</section>
{% block actions-container %}{{ block.super }}{% endblock %}
</div>
</div>
{% endblock %}
{% endblock %}

View File

@ -0,0 +1,35 @@
{% extends widget_template %}
{% load i18n aircox %}
{% block outer %}
{% with cover|default:object.cover_url as cover %}
{% with url|default:object.get_absolute_url as url %}
{{ block.super }}
{% endwith %}
{% endwith %}
{% endblock %}
{% block title %}
{% if title %}
{{ block.super }}
{% elif object %}
{{ object.display_title }}
{% endif %}
{% endblock %}
{% block content %}
{% if not content and object %}
{% with object.display_headline as content %}
{{ block.super }}
{% endwith %}
{% else %}
{{ block.super }}
{% endif %}
{% endblock %}
{% block actions %}
{{ block.super }}
{% endblock %}