forked from rc/aircox
remove old cms, switch to wagtail; move website to cms
This commit is contained in:
51
cms/templates/cms/base_site.html
Normal file
51
cms/templates/cms/base_site.html
Normal file
@ -0,0 +1,51 @@
|
||||
{% load staticfiles %}
|
||||
{% load i18n %}
|
||||
{% load wagtailimages_tags %}
|
||||
{% load wagtailsettings_tags %}
|
||||
{% get_settings %}
|
||||
|
||||
<html>
|
||||
<head>
|
||||
{% block css %}
|
||||
<link rel="stylesheet" href="{% static 'cms/css/layout.css' %}" type="text/css" />
|
||||
<link rel="stylesheet" href="{% static 'cms/css/theme.css' %}" type="text/css" />
|
||||
|
||||
{% block css_extras %}{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
<title>{{ page.title }}</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="top">
|
||||
<nav>
|
||||
<a href="">Grille Horaire</a>
|
||||
<a href="">Programmes</a>
|
||||
<a href="">Contact</a>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="middle">
|
||||
<nav class="left">
|
||||
<img src="{{ settings.cms.WebsiteSettings.logo.file.url }}" class="logo">
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
{% if messages %}
|
||||
<ul class="messages">
|
||||
{% for message in messages %}
|
||||
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>
|
||||
{{ message }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% block title %}
|
||||
<h1>{{ page.title }}</h1>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
38
cms/templates/cms/diffusion_page.html
Normal file
38
cms/templates/cms/diffusion_page.html
Normal file
@ -0,0 +1,38 @@
|
||||
{% extends "cms/publication.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content_extras %}
|
||||
{% with tracks=page.tracks.all %}
|
||||
{% if tracks %}
|
||||
<div class="playlist">
|
||||
<h2>{% trans "Playlist" %}</h2>
|
||||
<ul>
|
||||
{% for track in tracks %}
|
||||
<li><span class="artist">{{ track.artist }}</span>
|
||||
<span class="title">{{ track.title }}</span>
|
||||
{% if track.info %} <span class="info">{{ track.info }}</span>{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<div class="dates">
|
||||
<h2>{% trans "Dates of diffusion" %}</h2>
|
||||
<ul>
|
||||
{% with diffusion=page.diffusion %}
|
||||
<li>{{ diffusion.date|date:"l d F Y, H:i" }}</li>
|
||||
{% for diffusion in diffusion.diffusion_set.all %}
|
||||
<li>{{ diffusion.date|date:"l d F Y, H:i" }}</li>
|
||||
{% endfor %}
|
||||
{% endwith %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{# TODO: podcasts #}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
|
24
cms/templates/cms/event_page.html
Normal file
24
cms/templates/cms/event_page.html
Normal file
@ -0,0 +1,24 @@
|
||||
{% extends "cms/publication.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
<div>
|
||||
<h2>{% trans "Practical information" %}</h2>
|
||||
<ul>
|
||||
{% with start=page.start|date:'l d F H:i' %}
|
||||
{% with end=page.end|date:'l d F H:i' %}
|
||||
<li><b>{% trans "Date" %}</b>:
|
||||
{% transblock %}{{ start }} until {{ end }}{% endtransblock %}
|
||||
</li>
|
||||
<li><b>{% trans "Place" %}</b>: {{ page.address }}</li>
|
||||
{% if page.price %}
|
||||
<li><b>{% trans "Price" %}</b>: {{ page.price }}</li>
|
||||
{% endif %}
|
||||
{% if page.info %}<li>{{ page.info }}</li>{% endif %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
42
cms/templates/cms/index_page.html
Normal file
42
cms/templates/cms/index_page.html
Normal file
@ -0,0 +1,42 @@
|
||||
{% extends "cms/base_site.html" %}
|
||||
{# generic page to display list of articles #}
|
||||
|
||||
{% load i18n %}
|
||||
{% load wagtailimages_tags %}
|
||||
|
||||
|
||||
{% block title %}
|
||||
<h1>
|
||||
{% if search_query %}
|
||||
{% blocktrans %}Search in publications for <i>{{ search_query }}</i>{% endblocktrans %}
|
||||
{% elif tag_query %}
|
||||
{% blocktrans %}Search in publications for <i>{{ search_query }}</i>{% endblocktrans %}
|
||||
{% elif thread_query %}
|
||||
{# should never happen #}
|
||||
{% with title=thread_query.title url=thread_query.url %}
|
||||
{% blocktrans %}
|
||||
Publications in <a href="{{ url }}">{{ title }}</a>{% endblocktrans %}
|
||||
{% endwith %}
|
||||
{% else %}
|
||||
{% blocktrans %}All the publications{% endblocktrans %}
|
||||
{% endif %}
|
||||
</h1>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
{% if thread_query %}
|
||||
<div class="body summary">
|
||||
{% image thread_query.cover fill-128x128 class="cover item_cover" %}
|
||||
{{ thread_query.summary }}
|
||||
<a href="{{ thread_query.url }}">{% trans "More about it" %}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% with list_paginator=paginator %}
|
||||
{% include "cms/list.html" %}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
60
cms/templates/cms/program_page.html
Normal file
60
cms/templates/cms/program_page.html
Normal file
@ -0,0 +1,60 @@
|
||||
{% extends "cms/publication.html" %}
|
||||
{# generic page to display programs #}
|
||||
|
||||
{% load i18n %}
|
||||
{% load wagtailcore_tags %}
|
||||
|
||||
{# TODO message if program is no more active #}
|
||||
|
||||
{% block content_extras %}
|
||||
<div class="schedule">
|
||||
{% if page.program.active %}
|
||||
<h2>{% trans "Schedule" %}</h2>
|
||||
<ul>
|
||||
{% for schedule in page.program.schedule_set.all %}
|
||||
<li>
|
||||
{% with frequency=schedule.get_frequency_display day=schedule.date|date:'l' %}
|
||||
{% with start=schedule.date|date:"H:i" end=schedule.end|date:"H:i" %}
|
||||
{% blocktrans %}
|
||||
{{ day }} {{ start }} until {{ end }}, {{ frequency }}
|
||||
{% endblocktrans %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% if schedule.initial %}
|
||||
<span class="info">{% trans "Rerun" %}</span>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<div class="warning">{% trans "This program is no longer active" %}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block page_nav_extras %}
|
||||
{% if page.program.active %}
|
||||
{% with object_list=page.next_diffs %}
|
||||
{% if object_list %}
|
||||
<div>
|
||||
<h2>{% trans "Next Diffusions" %}</h2>
|
||||
{% include "cms/list.html" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endif %}{# program.active #}
|
||||
|
||||
{% with object_list=page.prev_diffs %}
|
||||
{% if object_list %}
|
||||
<div>
|
||||
<h2>{% trans "Previous Diffusions" %}</h2>
|
||||
{% include "cms/list.html" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
91
cms/templates/cms/publication.html
Normal file
91
cms/templates/cms/publication.html
Normal file
@ -0,0 +1,91 @@
|
||||
{% extends "cms/base_site.html" %}
|
||||
{% load i18n %}
|
||||
{% load wagtailcore_tags %}
|
||||
{% load wagtailimages_tags %}
|
||||
|
||||
{% block content %}
|
||||
{% if object_list %}
|
||||
{# list view #}
|
||||
<div class="body summary">
|
||||
{{ page.summary }}
|
||||
</div>
|
||||
|
||||
{% with list_paginator=paginator %}
|
||||
{% include "cms/snippets/list.html" %}
|
||||
{% endwith %}
|
||||
{% else %}
|
||||
{# detail view #}
|
||||
<div class="content">
|
||||
<img class="cover" src="{{ page.cover.file.url }}">
|
||||
<div class="body">
|
||||
{{ page.body|richtext}}
|
||||
</div>
|
||||
|
||||
{% block content_extras %}
|
||||
{% endblock %}
|
||||
|
||||
{% if page.related_links.all %}
|
||||
<ul class="related">
|
||||
<h3>{% trans "Related links" %}</h3>
|
||||
{% for link in page.related_links.all %}
|
||||
<li>
|
||||
<a href="{{ link.url }}">
|
||||
{% if link.icon %}{% image link.icon fill-size-32x32 %}{% endif %}
|
||||
{{ link.title|default:link.url }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
<div class="comments">
|
||||
{% include "cms/snippets/comments.html" %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% block page_nav %}
|
||||
<nav class="page_nav">
|
||||
{% block metadata %}
|
||||
<div class="meta">
|
||||
<div class="author">
|
||||
{% if page.publish_as %}
|
||||
{% with page.publish_as as item %}
|
||||
{% include "cms/snippets/list_item.html" %}
|
||||
{% endwith %}
|
||||
{% else %}
|
||||
{{ page.owner }}
|
||||
{% endif %}
|
||||
</div>
|
||||
<time datetime="{{ page.first_published_at }}">
|
||||
{% trans "Published on " %}
|
||||
{{ page.first_published_at|date:'l d F, H:i' }}
|
||||
</time>
|
||||
|
||||
<div class="tags">
|
||||
{% for tag in page.tags.all %}
|
||||
{# <a href="{% pageurl page.blog_index %}?tag={{ tag }}">{{ tag }}</a> #}
|
||||
{{ tag }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block page_nav_extras %}
|
||||
{% endblock %}
|
||||
|
||||
{% if page.recents %}
|
||||
<div>
|
||||
<h2>{% trans "Last Publications" %}</h2>
|
||||
{% with object_list=page.recents %}
|
||||
{% include "cms/snippets/list.html" %}
|
||||
{% endwith %}
|
||||
{# TODO: url to complete list of publications #}
|
||||
</div>
|
||||
{% endif %}
|
||||
</nav>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
10
cms/templates/cms/search.html
Normal file
10
cms/templates/cms/search.html
Normal file
@ -0,0 +1,10 @@
|
||||
{% extends "cms/base_site.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
|
||||
{% block title %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
52
cms/templates/cms/snippets/comments.html
Normal file
52
cms/templates/cms/snippets/comments.html
Normal file
@ -0,0 +1,52 @@
|
||||
{% load i18n %}
|
||||
{% load honeypot %}
|
||||
|
||||
{% if comment_form %}
|
||||
{% with comment_form as form %}
|
||||
{{ form.non_field_errors }}
|
||||
<form action="" method="POST">
|
||||
{% csrf_token %}
|
||||
{% render_honeypot_field "hp_website" %}
|
||||
<div>
|
||||
<input type="hidden" name="type" value="comments">
|
||||
{{ form.author.errors }}
|
||||
{{ form.author }}
|
||||
<div>
|
||||
<input type="checkbox" value="1" id="show_more">
|
||||
<label for="show_more">{% trans "show more options" %}</label>
|
||||
<div class="extra">
|
||||
{{ form.email.errors }}
|
||||
{{ form.email }}
|
||||
{{ form.url.errors }}
|
||||
{{ form.url }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
{{ form.content.errors }}
|
||||
{{ form.content }}
|
||||
<button type="submit">{% trans "Post!" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<ul>
|
||||
{% for comment in page.comments %}
|
||||
<li class="comment">
|
||||
<div class="metadata">
|
||||
<a {% if comment.url %}href="{{ comment.url }}" {% endif %}
|
||||
class="author">{{ comment.author }}</a>
|
||||
<time datetime="{{ comment.date }}">
|
||||
{{ comment.date|date:'l d F, H:i' }}
|
||||
</time>
|
||||
</div>
|
||||
<div class="body">{{ comment.content }}</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
9
cms/templates/cms/snippets/list.html
Normal file
9
cms/templates/cms/snippets/list.html
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
<div class="list">
|
||||
{% for page in object_list %}
|
||||
{% with item=page.specific %}
|
||||
{% include "cms/snippets/list_item.html" %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
16
cms/templates/cms/snippets/list_item.html
Normal file
16
cms/templates/cms/snippets/list_item.html
Normal file
@ -0,0 +1,16 @@
|
||||
{% load wagtailimages_tags %}
|
||||
|
||||
<a {% if item.url %}href="{{ item.url }}" {% endif %}class="item page_item">
|
||||
{% image item.cover fill-64x64 class="cover item_cover" %}
|
||||
<h3>{{ item.title }}</h3>
|
||||
<div class="summary">{{ item.summary }}</div>
|
||||
{% if not item.show_in_menus %}
|
||||
{% if item.date %}
|
||||
<time datetime="{{ item.date }}">
|
||||
{{ item.date|date:'l d F, H:i' }}
|
||||
</time>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</a>
|
||||
|
||||
|
Reference in New Issue
Block a user