work on website

This commit is contained in:
bkfox
2019-07-24 01:59:40 +02:00
parent 6ed33c34a9
commit 7c8814e164
16 changed files with 7918 additions and 119 deletions

View File

@ -0,0 +1,69 @@
{% load static i18n thumbnail %}
{% 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_web/assets/main.css" %}"/>
<script src="{% static "aircox_web/assets/main.js" %}"></script>
<script src="{% static "aircox_web/assets/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="{{ site.logo.url }}" class="logo"/>
</a>
</div>
<div class="navbar-menu">
<div class="navbar-start">
{{ site_regions.topnav }}
</div>
</div>
</div>
</nav>
<div class="container">
<div class="columns">
<main class="column page">
<header class="header">
{% block header %}
<h1 class="title is-1">{% block title %}{% endblock %}</h1>
{% endblock %}
</header>
{% block main %}{% endblock main %}
</main>
<aside class="column is-one-third">
{% block side_nav %}
{% block cover %}
{% if cover is not None %}
<img class="cover" src="{{ cover.url }}" class="cover"/>
{% endif %}
{% endblock %}
{% endblock %}
</aside>
</div>
</div>
</div>
</body>
</html>

View File

@ -4,29 +4,36 @@ 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 page as context_page %}
{% with object.program as program %}
{% diffusion_page object as page %}
{% with object.initial|default:object as initial %}
{% with initial.program as program %}
{% with initial.page as d_page %}
{% with program.page as p_page %}
{% with d_page|default:p_page as c_page %}
<article class="media">
<div class="media-left">
<img src="{% thumbnail page.cover|default:site.logo 128x128 crop=scale %}">
<img src="{% thumbnail c_page.cover|default:site.logo 128x128 crop=scale %}"
class="small-cover">
</div>
<div class="media-content">
<div>
<h4 class="subtitle is-size-4 is-inline-block">
{% if page and context_page != page %}
<a href="{{ page.path }}">{{ page.title }}</a>
{% else %}
{{ page.title|default:program.name }}
{% endif %}
</h4>
<h5 class="subtitle is-size-5 is-inline-block">
{% if d_page %}
<a href="{{ d_page.path }}">{{ d_page.title }}</a>
{% endif %}
<span class="has-text-weight-normal">
{% if object.page is page and context_page != program.page %}
&mdash; <a href="{% url "program-page" slug=program.page.slug %}">{{ program.page.title }}</a>
{% endif %}
{% if not page or p_page != page %}
{% if d_page %} &mdash; {% endif %}
{% if p_page %}
<a href="{{ p_page.path }}" class="has-text-grey-dark">
{{ p_page.title }}</a>
{% else %}
{{ program.name }}
{% endif %}
{% endif %}
</h5>
{% if not hide_schedule %}
<time datetime="{{ object.start|date:"c" }}" title="{{ object.start }}"
@ -44,13 +51,16 @@ Context variables:
{% endif %}
</span>
</div>
{% if not hide_headline %}
<div class="content">
{{ page.headline|default:program.page.headline }}
</p>
</div>
{{ c_page.headline }}
</div>
{% endif %}
</div>
</article>
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}

View File

@ -16,9 +16,8 @@
{{ block.super }}
{% if program %}
<h4 class="subtitle is-size-3">
<a href="{% url "page" path=program.page.path %}">&#10092; {{ program.name }}</a></li>
<a href="{% url "program-page" slug=program.slug %}">&#10092; {{ program.name }}</a></li>
</h4>
{% include "aircox_web/program_header.html" %}
{% endif %}
{% endblock %}
@ -26,9 +25,7 @@
{% block content %}
<section class="section">
{% for object in object_list %}
{% with object.diffusion as object %}
{% include "aircox_web/diffusion_item.html" %}
{% endwith %}
{% endfor %}
</section>

View File

@ -1,8 +0,0 @@
{% extends "aircox_web/page.html" %}
{% block header %}
{{ block.super }}
{% include "aircox_web/program_header.html" %}
{% endblock %}

View 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>
&mdash;
<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>

View File

@ -0,0 +1,38 @@
{% extends "aircox_web/page.html" %}
{% load i18n %}
{% with page.program as program %}
{% block header %}
{{ block.super }}
{% include "aircox_web/program_header.html" %}
{% endblock %}
{% block side_nav %}
{{ block.super }}
{% if diffusions %}
<section>
<h4 class="subtitle is-size-4">{% trans "Last shows" %}</h4>
{% for object in diffusions %}
{% include "aircox_web/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 %}
{% endwith %}