forked from rc/aircox
continue migration: make website working
This commit is contained in:
84
aircox/templates/aircox/base.html
Normal file
84
aircox/templates/aircox/base.html
Normal file
@ -0,0 +1,84 @@
|
||||
{% load static i18n thumbnail aircox %}
|
||||
{% comment %}
|
||||
Context:
|
||||
- site: current website
|
||||
{% endcomment %}
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="application-name" content="aircox">
|
||||
<meta name="description" content="{{ site.description }}">
|
||||
<meta name="keywords" content="{{ site.tags }}">
|
||||
<link rel="icon" href="{% thumbnail site.favicon 32x32 crop %}" />
|
||||
|
||||
{% block assets %}
|
||||
<link rel="stylesheet" type="text/css" href="{% static "aircox/main.css" %}"/>
|
||||
<script src="{% static "aircox/main.js" %}"></script>
|
||||
<script src="{% static "aircox/vendor.js" %}"></script>
|
||||
{% endblock %}
|
||||
|
||||
<title>
|
||||
{% block head_title %}{{ site.title }}{% endblock %}
|
||||
</title>
|
||||
|
||||
{% block head_extra %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<nav class="navbar has-shadow" role="navigation" aria-label="main navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-brand">
|
||||
<a href="/" title="{% trans "Home" %}" class="navbar-item">
|
||||
<img src="{{ station.logo.url }}" class="logo"/>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-menu">
|
||||
<div class="navbar-start">
|
||||
{% block top-nav %}
|
||||
{% nav_items "top" css_class="navbar-item" active_class="is-active" as items %}
|
||||
{% for item, render in items %}
|
||||
{{ render }}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container">
|
||||
<div class="columns is-desktop">
|
||||
<main class="column page">
|
||||
<header class="header">
|
||||
{% block header %}
|
||||
<h1 class="title is-1">{% block title %}{% endblock %}</h1>
|
||||
|
||||
{% if parent %}
|
||||
<h4 class="subtitle is-size-3">
|
||||
<a href="{{ parent.get_absolute_url }}">
|
||||
❬ {{ parent.title }}</a></li>
|
||||
</h4>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</header>
|
||||
|
||||
{% block main %}{% endblock main %}
|
||||
</main>
|
||||
{% if show_side_nav %}
|
||||
<aside class="column is-one-third-desktop">
|
||||
{% block cover %}
|
||||
{% if cover is not None %}
|
||||
<img class="cover" src="{{ cover.url }}" class="cover"/>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block side_nav %}
|
||||
{% endblock %}
|
||||
</aside>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
59
aircox/templates/aircox/diffusion_item.html
Normal file
59
aircox/templates/aircox/diffusion_item.html
Normal file
@ -0,0 +1,59 @@
|
||||
{% load i18n easy_thumbnails_tags aircox %}
|
||||
{% comment %}
|
||||
Context variables:
|
||||
- object: the actual diffusion
|
||||
- page: current parent page in which item is rendered
|
||||
- hide_schedule: if True, do not display start time
|
||||
- hide_headline: if True, do not display headline
|
||||
{% endcomment %}
|
||||
|
||||
{% with object.episode as episode %}
|
||||
{% with episode.program as program %}
|
||||
<article class="media">
|
||||
<div class="media-left">
|
||||
<img src="{% thumbnail episode.cover 128x128 crop=scale %}"
|
||||
class="small-cover">
|
||||
</div>
|
||||
<div class="media-content">
|
||||
<h5 class="subtitle is-size-5">
|
||||
{% if episode.is_published %}
|
||||
<a href="{{ episode.get_absolute_url }}">{{ episode.title }}</a>
|
||||
{% endif %}
|
||||
</h5>
|
||||
|
||||
<div class="">
|
||||
{% if not page or program != page %}
|
||||
{% if program.is_published %}
|
||||
<a href="{{ program.get_absolute_url }}" class="has-text-grey-dark">
|
||||
{{ program.title }}</a>
|
||||
{% else %}{{ program.title }}
|
||||
{% endif %}
|
||||
{% if not hide_schedule %} — {% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if not hide_schedule %}
|
||||
<time datetime="{{ object.start|date:"c" }}" title="{{ object.start }}"
|
||||
class="has-text-weight-light is-size-6">
|
||||
{{ object.start|date:"d M, H:i" }}
|
||||
</time>
|
||||
{% endif %}
|
||||
|
||||
{% if object.initial %}
|
||||
{% with object.initial.date as date %}
|
||||
<span class="tag is-info" title="{% blocktrans %}Rerun of {{ date }}{% endblocktrans %}">
|
||||
{% trans "rerun" %}
|
||||
</span>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
{% if not hide_headline %}
|
||||
<div class="content">
|
||||
{{ episode.headline }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</article>
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
|
51
aircox/templates/aircox/diffusion_list.html
Normal file
51
aircox/templates/aircox/diffusion_list.html
Normal file
@ -0,0 +1,51 @@
|
||||
{% extends "aircox/page.html" %}
|
||||
{% load i18n aircox %}
|
||||
|
||||
{% block title %}
|
||||
{% if program %}
|
||||
{% with program.name as program %}
|
||||
{% blocktrans %}Diffusions of {{ program }}{% endblocktrans %}
|
||||
{% endwith %}
|
||||
{% else %}
|
||||
{% trans "All diffusions" %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<section>
|
||||
{% for object in object_list %}
|
||||
{% include "aircox/diffusion_item.html" %}
|
||||
{% endfor %}
|
||||
</section>
|
||||
|
||||
|
||||
{% if is_paginated %}
|
||||
<nav class="pagination is-centered" role="pagination" aria-label="{% trans "pagination" %}">
|
||||
{% if page_obj.has_previous %}
|
||||
<a href="?page={{ page_obj.previous_page_number }}" class="pagination-previous">
|
||||
{% else %}
|
||||
<a class="pagination-previous" disabled>
|
||||
{% endif %}
|
||||
{% trans "Previous" %}</a>
|
||||
|
||||
{% if page_obj.has_next %}
|
||||
<a href="?page={{ page_obj.next_page_number }}" class="pagination-next">
|
||||
{% else %}
|
||||
<a class="pagination-next" disabled>
|
||||
{% endif %}
|
||||
{% trans "Next" %}</a>
|
||||
|
||||
<ul class="pagination-list">
|
||||
{% for i in paginator.page_range %}
|
||||
<li>
|
||||
<a class="pagination-link {% if page_obj.number == i %}is-current{% endif %}"
|
||||
href="?page={{ i }}">{{ i }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
56
aircox/templates/aircox/diffusion_timetable.html
Normal file
56
aircox/templates/aircox/diffusion_timetable.html
Normal file
@ -0,0 +1,56 @@
|
||||
{% extends "aircox/page.html" %}
|
||||
{% load i18n aircox %}
|
||||
|
||||
{% block title %}{% trans "Timetable" %}{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
{{ block.super }}
|
||||
|
||||
<section class="section">
|
||||
<h3 class="subtitle size-3">
|
||||
{% blocktrans %}From <b>{{ start }}</b> to <b>{{ end }}</b>{% endblocktrans %}
|
||||
</h3>
|
||||
|
||||
{% unique_id "timetable" as timetable_id %}
|
||||
<a-tabs default="{{ date }}">
|
||||
<template v-slot:tabs="scope" noscript="hidden">
|
||||
<li><a href="{% url "timetable" date=prev_date %}"><</a></li>
|
||||
|
||||
{% for day in by_date.keys %}
|
||||
<a-tab value="{{ day }}">
|
||||
<a href="{% url "timetable" date=day %}">
|
||||
{{ day|date:"D. d" }}
|
||||
</a>
|
||||
</a-tab>
|
||||
{% endfor %}
|
||||
|
||||
<li>
|
||||
<a href="{% url "timetable" date=next_date %}">></a>
|
||||
</li>
|
||||
</template>
|
||||
|
||||
{% with True as hide_schedule %}
|
||||
<template v-slot:default="{value}">
|
||||
{% for day, diffusions in by_date.items %}
|
||||
<noscript><h4 class="subtitle is-4">{{ day|date:"l d F Y" }}</h4></noscript>
|
||||
<div id="{{timetable_id}}-{{ day|date:"Y-m-d" }}" v-if="value == '{{ day }}'">
|
||||
{% for object in diffusions %}
|
||||
<div class="columns">
|
||||
<div class="column is-one-fifth has-text-right">
|
||||
<time datetime="{{ object.start|date:"c" }}">
|
||||
{{ object.start|date:"H:i" }} - {{ object.end|date:"H:i" }}
|
||||
</time>
|
||||
</div>
|
||||
<div class="column">
|
||||
{% include "aircox/diffusion_item.html" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</template>
|
||||
{% endwith %}
|
||||
</a-tabs>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
14
aircox/templates/aircox/episode_detail.html
Normal file
14
aircox/templates/aircox/episode_detail.html
Normal file
@ -0,0 +1,14 @@
|
||||
{% extends "aircox/program_base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block main %}
|
||||
{{ block.super }}
|
||||
|
||||
{% if podcasts %}
|
||||
{% for object in podcasts %}
|
||||
{% include "aircox/podcast_item.html" %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
19
aircox/templates/aircox/log_item.html
Normal file
19
aircox/templates/aircox/log_item.html
Normal file
@ -0,0 +1,19 @@
|
||||
{% load i18n %}
|
||||
|
||||
{% with object.track as track %}
|
||||
<span class="has-text-info is-size-5">♬</span>
|
||||
<span>{{ track.title }}</span>
|
||||
{% with track.artist as artist %}
|
||||
{% with track.info as info %}
|
||||
<span class="has-text-grey-dark has-text-weight-light">
|
||||
{% blocktrans %}
|
||||
by {{ artist }}
|
||||
{% endblocktrans %}
|
||||
{% if info %}
|
||||
({% blocktrans %}<i>{{ info }}</i>{% endblocktrans %})
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
|
57
aircox/templates/aircox/log_list.html
Normal file
57
aircox/templates/aircox/log_list.html
Normal file
@ -0,0 +1,57 @@
|
||||
{% extends "aircox/page.html" %}
|
||||
{% load i18n aircox %}
|
||||
|
||||
{% block title %}
|
||||
{% trans "Logs" %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block main %}
|
||||
{{ block.super }}
|
||||
|
||||
<section class="section">
|
||||
{% if dates %}
|
||||
<nav class="tabs is-centered" aria-label="{% trans "Other days' logs" %}">
|
||||
<ul>
|
||||
{% for day in dates %}
|
||||
<li {% if day == date %}class="is-active"{% endif %}>
|
||||
<a href="{% url "logs" date=day %}">
|
||||
{{ day|date:"d b" }}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{% if forloop.last and day > min_date %}
|
||||
<li>...</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
|
||||
{# <h4 class="subtitle size-4">{{ date }}</h4> #}
|
||||
{% with True as hide_schedule %}
|
||||
<table class="table is-striped is-hoverable is-fullwidth">
|
||||
{% for object in object_list reversed %}
|
||||
<tr>
|
||||
{% if object|is_diffusion %}
|
||||
<td>
|
||||
<time datetime="{{ object.start }}" title="{{ object.start }}">
|
||||
{{ object.start|date:"H:i" }} - {{ object.end|date:"H:i" }}
|
||||
</time>
|
||||
</td>
|
||||
<td>{% include "aircox/diffusion_item.html" %}</td>
|
||||
{% else %}
|
||||
<td>
|
||||
<time datetime="{{ object.date }}" title="{{ object.date }}">
|
||||
{{ object.date|date:"H:i" }}
|
||||
</time>
|
||||
</td>
|
||||
<td>{% include "aircox/log_item.html" %}</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endwith %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
30
aircox/templates/aircox/page.html
Normal file
30
aircox/templates/aircox/page.html
Normal file
@ -0,0 +1,30 @@
|
||||
{% extends "aircox/base.html" %}
|
||||
{% load static i18n thumbnail %}
|
||||
{% comment %}
|
||||
Context:
|
||||
- cover: cover image
|
||||
- title: title
|
||||
- page: page
|
||||
{% endcomment %}
|
||||
|
||||
{% block head_title %}
|
||||
{% block title %}{{ title }}{% endblock %}
|
||||
{% if title %} — {% endif %}
|
||||
{{ site.title }}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block main %}
|
||||
{% block headline %}
|
||||
{% if page and page.headline %}
|
||||
<p class="headline">{{ page.headline }}</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ page.content|default_if_none:''|safe }}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
8
aircox/templates/aircox/podcast_item.html
Normal file
8
aircox/templates/aircox/podcast_item.html
Normal file
@ -0,0 +1,8 @@
|
||||
<div class="podcast">
|
||||
{% if object.embed %}
|
||||
{{ object.embed }}
|
||||
{% else %}
|
||||
<audio src="{{ object.url }}" controls>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
29
aircox/templates/aircox/program_base.html
Normal file
29
aircox/templates/aircox/program_base.html
Normal file
@ -0,0 +1,29 @@
|
||||
{% extends "aircox/page.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block side_nav %}
|
||||
{{ block.super }}
|
||||
|
||||
{% if diffusions %}
|
||||
<section>
|
||||
<h4 class="subtitle is-size-4">{% trans "Last shows" %}</h4>
|
||||
|
||||
{% for object in diffusions %}
|
||||
{% include "aircox/diffusion_item.html" %}
|
||||
{% endfor %}
|
||||
|
||||
<br>
|
||||
<nav class="pagination is-centered">
|
||||
<ul class="pagination-list">
|
||||
<li>
|
||||
<a href="{% url "diffusion-list" program_slug=page.slug %}"
|
||||
class="pagination-link"
|
||||
aria-label="{% trans "Show all diffusions" %}">
|
||||
{% trans "All diffusions" %}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
8
aircox/templates/aircox/program_detail.html
Normal file
8
aircox/templates/aircox/program_detail.html
Normal file
@ -0,0 +1,8 @@
|
||||
{% extends "aircox/program_base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block header %}
|
||||
{{ block.super }}
|
||||
{% include "aircox/program_header.html" %}
|
||||
{% endblock %}
|
||||
|
25
aircox/templates/aircox/program_header.html
Normal file
25
aircox/templates/aircox/program_header.html
Normal file
@ -0,0 +1,25 @@
|
||||
{% load i18n %}
|
||||
<section class="is-size-5">
|
||||
{% for schedule in program.schedule_set.all %}
|
||||
<p>
|
||||
{{ schedule.get_frequency_verbose }}
|
||||
{% with schedule.start|date:"H:i" as start %}
|
||||
{% with schedule.end|date:"H:i" as end %}
|
||||
<time datetime="{{ start }}">{{ start }}</time>
|
||||
—
|
||||
<time datetime="{{ end }}">{{ end }}</time>
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
<small>
|
||||
{% if schedule.initial %}
|
||||
{% with schedule.initial.date as date %}
|
||||
<span title="{% blocktrans %}Rerun of {{ date }}{% endblocktrans %}">
|
||||
({% trans "rerun" %})
|
||||
</span>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
</small>
|
||||
</p>
|
||||
{% endfor %}
|
||||
</section>
|
||||
|
Reference in New Issue
Block a user