forked from rc/aircox
work on pages, filters, lists
This commit is contained in:
@ -4,7 +4,9 @@
|
||||
|
||||
{% block content %}{{ block.super }}
|
||||
{# TODO: date subtitle #}
|
||||
<a-statistics>
|
||||
<div class="columns">
|
||||
|
||||
<a-statistics class="column">
|
||||
<template v-slot:default="{counts}">
|
||||
<table class="table is-hoverable is-fullwidth">
|
||||
<thead>
|
||||
@ -63,6 +65,15 @@
|
||||
</template>
|
||||
</a-statistics>
|
||||
|
||||
|
||||
<nav class="column menu is-one-fifth-desktop" role="menu">
|
||||
{% with "admin:tools-stats" as url_name %}
|
||||
{% include "aircox/widgets/dates_menu.html" %}
|
||||
{% endwith %}
|
||||
</nav>
|
||||
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
<a class="navbar-link" href="{% url "admin:aircox_article_changelist" %}">{% trans "Articles" %}</a>
|
||||
<div class="navbar-dropdown is-boxed is-right">
|
||||
{% for program in programs %}
|
||||
<a class="navbar-item" href="{% url "admin:aircox_article_changelist" %}?program={{ program.pk }}">
|
||||
<a class="navbar-item" href="{% url "admin:aircox_article_changelist" %}?parent={{ program.pk }}">
|
||||
{{ program.title }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
@ -56,7 +56,7 @@
|
||||
<a class="navbar-link" href="{% url "admin:aircox_episode_changelist" %}">{% trans "Episodes" %}</a>
|
||||
<div class="navbar-dropdown is-boxed is-right">
|
||||
{% for program in programs %}
|
||||
<a class="navbar-item" href="{% url "admin:aircox_episode_changelist" %}?program={{ program.pk }}">
|
||||
<a class="navbar-item" href="{% url "admin:aircox_episode_changelist" %}?parent={{ program.pk }}">
|
||||
{{ program.title }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
@ -1,14 +1,14 @@
|
||||
{% extends "aircox/page_detail.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block side_nav %}
|
||||
{% block sidebar %}
|
||||
{{ block.super }}
|
||||
|
||||
{% if side_items %}
|
||||
{% if sidebar_items %}
|
||||
<section>
|
||||
<h4 class="title is-4">{% trans "Latest news" %}</h4>
|
||||
|
||||
{% for object in side_items %}
|
||||
{% for object in sidebar_items %}
|
||||
{% include "aircox/page_item.html" %}
|
||||
{% endfor %}
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
Context:
|
||||
- cover: image cover
|
||||
- site: current website
|
||||
- has_filters: display filter bar (using block "filters")
|
||||
{% endcomment %}
|
||||
<html>
|
||||
<head>
|
||||
@ -71,19 +72,50 @@ Context:
|
||||
{% endblock %}
|
||||
</header>
|
||||
|
||||
{% if has_filters %}
|
||||
<nav class="navbar filters"
|
||||
aria-label="{% trans "list filters" %}">
|
||||
{% block filters %}{% endblock %}
|
||||
</nav>
|
||||
{% endif %}
|
||||
|
||||
{% block main %}{% endblock main %}
|
||||
</main>
|
||||
|
||||
{% if show_side_nav %}
|
||||
{% if has_sidebar %}
|
||||
<aside class="column is-one-third-desktop">
|
||||
{# FIXME: block cover into side_nav one #}
|
||||
{# FIXME: block cover into sidebar one #}
|
||||
{% block cover %}
|
||||
{% if cover is not None %}
|
||||
<img class="cover" src="{{ cover.url }}" class="cover"/>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block side_nav %}
|
||||
{% block sidebar %}
|
||||
{% if sidebar_items %}
|
||||
<section>
|
||||
<h4 class="title is-4">
|
||||
{% block sidebar_title %}{% trans "Recently" %}{% endblock %}
|
||||
</h4>
|
||||
|
||||
{% for object in sidebar_items %}
|
||||
{% include "aircox/episode_item.html" %}
|
||||
{% endfor %}
|
||||
|
||||
<br>
|
||||
<nav class="pagination is-centered">
|
||||
<ul class="pagination-list">
|
||||
<li>
|
||||
<a {% if parent %}href="{% url "page-list" parent_slug=parent.slug %}"{% else %}href="{% url "page-list" %}"{% endif %}
|
||||
class="pagination-link"
|
||||
aria-label="{% trans "Show all program's diffusions" %}">
|
||||
{% trans "Show more" %}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
</aside>
|
||||
{% endif %}
|
||||
|
11
aircox/templates/aircox/diffusion_item.html
Normal file
11
aircox/templates/aircox/diffusion_item.html
Normal file
@ -0,0 +1,11 @@
|
||||
{% comment %}
|
||||
Context:
|
||||
- object: diffusion
|
||||
- "episode_item"'s context (except object and diffusion)
|
||||
{% endcomment %}
|
||||
{% with object as diffusion %}
|
||||
{% with object.episode as object %}
|
||||
{% include "aircox/episode_item.html" %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% extends "aircox/page.html" %}
|
||||
{% load i18n aircox %}
|
||||
{% load i18n aircox humanize %}
|
||||
|
||||
{% block title %}
|
||||
{% with station.name as station %}
|
||||
@ -9,17 +9,22 @@
|
||||
|
||||
{% block subtitle %}{{ date|date:"l d F Y" }}{% endblock %}
|
||||
|
||||
{% block main %}{{ block.super }}
|
||||
<div class="columns">
|
||||
{% block filters %}
|
||||
{% with "diffusion-list" as url_name %}
|
||||
{% include "aircox/widgets/dates_menu.html" %}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block main %}{{ block.super }}
|
||||
{% with True as hide_schedule %}
|
||||
<section class="column">
|
||||
<section role="list">
|
||||
<div id="timetable-{{ date|date:"Y-m-d" }}">
|
||||
{% for diffusion in object_list %}
|
||||
<div class="columns">
|
||||
{# FIXME: opacity should work -- maybe hidden tz #}
|
||||
<div class="columns {% if diffusion.start.date != date and diffusion.start.end <= date %}is-opacity-light{% 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" }}
|
||||
{{ diffusion.start|date:"d H:i" }} - {{ diffusion.end|date:"d H:i" }}
|
||||
</time>
|
||||
</div>
|
||||
<div class="column">
|
||||
@ -33,12 +38,10 @@
|
||||
</section>
|
||||
{% endwith %}
|
||||
|
||||
{% comment %}
|
||||
<nav class="column menu is-one-third-desktop" role="menu">
|
||||
{% with "diffusion-list" as url_name %}
|
||||
{% include "aircox/widgets/dates_menu.html" %}
|
||||
{% endwith %}
|
||||
</nav>
|
||||
{% endcomment %}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
@ -11,9 +11,7 @@ for design review.
|
||||
|
||||
{% if object|is_diffusion %}
|
||||
{% with object as diffusion %}
|
||||
{% with diffusion.episode as object %}
|
||||
{% include "aircox/episode_item.html" %}
|
||||
{% endwith %}
|
||||
{% include "aircox/diffusion_item.html" %}
|
||||
{% endwith %}
|
||||
{% else %}
|
||||
{% with object.track as object %}
|
||||
|
@ -10,14 +10,17 @@
|
||||
|
||||
{% block subtitle %}{{ date|date:"l d F Y" }}{% endblock %}
|
||||
|
||||
{% block filters %}
|
||||
{% with "log-list" as url_name %}
|
||||
{% include "aircox/widgets/dates_menu.html" %}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<div class="columns">
|
||||
|
||||
<section class="section column">
|
||||
<section>
|
||||
{# <h4 class="subtitle size-4">{{ date }}</h4> #}
|
||||
{% with True as hide_schedule %}
|
||||
<table class="table is-striped is-hoverable is-fullwidth has-background-transparent">
|
||||
<table class="table is-striped is-hoverable is-fullwidth">
|
||||
{% for object in object_list %}
|
||||
<tr>
|
||||
<td>
|
||||
@ -37,13 +40,5 @@
|
||||
</table>
|
||||
{% endwith %}
|
||||
</section>
|
||||
|
||||
<nav class="column menu is-one-third-desktop" role="menu">
|
||||
{% with "logs" as url_name %}
|
||||
{% include "aircox/widgets/dates_menu.html" %}
|
||||
{% endwith %}
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
@ -2,63 +2,65 @@
|
||||
{% load i18n aircox %}
|
||||
|
||||
{% block title %}
|
||||
{{ view.model|verbose_name:True|title }}
|
||||
{% if not parent %}{{ view.model|verbose_name:True|title }}
|
||||
{% else %}
|
||||
{% with parent.title as title %}
|
||||
{% blocktrans %}Publications of {{ title }}{% endblocktrans %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block side_nav %}
|
||||
{{ block.super }}
|
||||
|
||||
{% if filter_categories|length != 1 %}
|
||||
<section class="toolbar">
|
||||
<h4 class="subtitle is-5">{% trans "Filters" %}</h4>
|
||||
<form method="GET" action="">
|
||||
{% block list_filters %}
|
||||
<div class="field is-horizontal">
|
||||
<div class="field-label">
|
||||
<label class="label">{% trans "Categories" %}</label>
|
||||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field is-grouped is-narrow">
|
||||
<div class="control">
|
||||
{% for category in filter_categories %}
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" class="checkbox" name="categories"
|
||||
value="{{ category.slug }}"
|
||||
{% if category.slug in categories %}checked{% endif %} />
|
||||
{{ category.title }}
|
||||
</label>
|
||||
{% endfor %}
|
||||
{% block filters %}
|
||||
<div class="navbar-branding">
|
||||
<h4 class="navbar-item title">{% trans "Filters" %}</h4>
|
||||
</div>
|
||||
<form method="GET" action="" class="navbar-menu">
|
||||
<div class="navbar-start">
|
||||
<div class="navbar-item">
|
||||
{% block list_filters %}
|
||||
<div class="field is-horizontal">
|
||||
<div class="field-label">
|
||||
<label class="label">{% trans "Categories" %}</label>
|
||||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field is-grouped is-narrow">
|
||||
<div class="control">
|
||||
{% for category in filter_categories %}
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" class="checkbox" name="categories"
|
||||
value="{{ category.slug }}"
|
||||
{% if category.slug in categories %}checked{% endif %} />
|
||||
{{ category.title }}
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
<div class="field is-horizontal">
|
||||
<div class="field-label">
|
||||
<label class="label"></label>
|
||||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field is-grouped is-grouped-right">
|
||||
<div class="control">
|
||||
<button class="button is-primary"/>{% trans "Apply" %}</button>
|
||||
</div>
|
||||
<div class="control">
|
||||
<a href="?" class="button is-secondary">{% trans "Reset" %}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="navbar-end">
|
||||
<div class="navbar-item">
|
||||
<div class="field is-grouped is-grouped-right">
|
||||
<div class="control">
|
||||
<button class="button is-primary"/>{% trans "Apply" %}</button>
|
||||
</div>
|
||||
<div class="control">
|
||||
<a href="?" class="button is-secondary">{% trans "Reset" %}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
{% endif %}
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block main %}
|
||||
<section>
|
||||
<section role="list">
|
||||
{% for object in object_list %}
|
||||
{% block list_object %}
|
||||
{% include item_template_name %}
|
||||
{% include object.item_template_name|default:item_template_name %}
|
||||
{% endblock %}
|
||||
{% endfor %}
|
||||
</section>
|
||||
|
@ -1,30 +1,16 @@
|
||||
{% extends "aircox/page_detail.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block side_nav %}
|
||||
{{ block.super }}
|
||||
|
||||
{% if side_items %}
|
||||
<section>
|
||||
<h4 class="title is-4">{% trans "Last shows" %}</h4>
|
||||
|
||||
{% for object in side_items %}
|
||||
{% include "aircox/episode_item.html" %}
|
||||
{% endfor %}
|
||||
|
||||
<br>
|
||||
<nav class="pagination is-centered">
|
||||
<ul class="pagination-list">
|
||||
<li>
|
||||
<a href="{% url "episode-list" parent_slug=program.slug %}"
|
||||
class="pagination-link"
|
||||
aria-label="{% trans "Show all program's diffusions" %}">
|
||||
{% trans "More shows" %}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% block sidebar_title %}
|
||||
{% with program.title as program %}
|
||||
{% blocktrans %} Recently on {{ program }}{% endblocktrans %}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with program as parent %}
|
||||
{{ block.super }}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
@ -4,9 +4,9 @@ Context:
|
||||
{% endcomment %}
|
||||
|
||||
<span class="has-text-info is-size-5">♬</span>
|
||||
<span>{{ track.title }}</span>
|
||||
<span>{{ object.title }}</span>
|
||||
<span class="has-text-grey-dark has-text-weight-light">
|
||||
— {{ track.artist }}
|
||||
{% if track.info %}(<i>{{ track.info }}</i>){% endif %}
|
||||
— {{ object.artist }}
|
||||
{% if object.info %}(<i>{{ object.info }}</i>){% endif %}
|
||||
</span>
|
||||
|
||||
|
@ -9,40 +9,35 @@ Context:
|
||||
|
||||
An empty date results to a title or a separator
|
||||
{% endcomment %}
|
||||
{% load i18n humanize %}
|
||||
{% load i18n %}
|
||||
|
||||
<nav class="menu is-one-third-desktop " role="menu"
|
||||
<div class="navbar-menu" role="menu"
|
||||
aria-label="{% trans "pick a date" %}">
|
||||
<p class="menu-label">{% trans "Pick a date" %}</p>
|
||||
<form action="{% url url_name %}" method="GET"
|
||||
aria-label="{% trans "Jump to date" %}">
|
||||
<div class="field has-addons">
|
||||
<div class="control has-icons-left">
|
||||
<span class="icon is-small is-left"><span class="far fa-calendar"></span></span>
|
||||
<input type="{{ date_input|default:"date" }}" class="input date"
|
||||
name="date" value="{{ date|date:"Y-m-d" }}">
|
||||
</div>
|
||||
<div class="control">
|
||||
<button class="button is-primary">{% trans "Go" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<ul class="menu-list">
|
||||
{% for day, title in dates %}
|
||||
{% if not day %}
|
||||
{% if title %}
|
||||
</ul>
|
||||
<p class="menu-label">{{ title }}</p>
|
||||
<ul class="menu-list">
|
||||
{% else %}<hr class="dropdown-divider">{% endif %}
|
||||
{% else %}
|
||||
<li><a href="{% url url_name date=day %}" {% if day == date %}class="is-active"{% endif %}>
|
||||
{% if title %}{{ title }}{% else %}{{ day|naturalday:"l d" }}{% endif %}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
<div class="navbar-start">
|
||||
{% for day in dates %}
|
||||
<a href="{% url url_name date=day %}" class="navbar-item {% if day == date %}is-active{% endif %}">
|
||||
{{ day|date:"D. d" }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="navbar-end">
|
||||
<div class="navbar-item">
|
||||
<form action="{% url url_name %}" method="GET" class="navbar-body"
|
||||
aria-label="{% trans "Jump to date" %}">
|
||||
<div class="field has-addons">
|
||||
<div class="control has-icons-left">
|
||||
<span class="icon is-small is-left"><span class="far fa-calendar"></span></span>
|
||||
<input type="{{ date_input|default:"date" }}" class="input date"
|
||||
name="date" value="{{ date|date:"Y-m-d" }}">
|
||||
</div>
|
||||
<div class="control">
|
||||
<button class="button is-primary">{% trans "Go" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user