forked from rc/aircox
work on website
This commit is contained in:
69
aircox_web/templates/aircox_web/base.html
Normal file
69
aircox_web/templates/aircox_web/base.html
Normal 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>
|
||||
|
||||
|
@ -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 %}
|
||||
— <a href="{% url "program-page" slug=program.page.slug %}">{{ program.page.title }}</a>
|
||||
{% endif %}
|
||||
{% if not page or p_page != page %}
|
||||
{% if d_page %} — {% 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 %}
|
||||
|
||||
|
@ -16,9 +16,8 @@
|
||||
{{ block.super }}
|
||||
{% if program %}
|
||||
<h4 class="subtitle is-size-3">
|
||||
<a href="{% url "page" path=program.page.path %}">❬ {{ program.name }}</a></li>
|
||||
<a href="{% url "program-page" slug=program.slug %}">❬ {{ 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>
|
||||
|
||||
|
@ -1,8 +0,0 @@
|
||||
{% extends "aircox_web/page.html" %}
|
||||
|
||||
{% block header %}
|
||||
{{ block.super }}
|
||||
{% include "aircox_web/program_header.html" %}
|
||||
{% endblock %}
|
||||
|
||||
|
25
aircox_web/templates/aircox_web/program_header.html
Normal file
25
aircox_web/templates/aircox_web/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>
|
||||
|
38
aircox_web/templates/aircox_web/program_page.html
Normal file
38
aircox_web/templates/aircox_web/program_page.html
Normal 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 %}
|
||||
|
Reference in New Issue
Block a user