Modèles plus cleans et templates principaux

This commit is contained in:
Evarin 2017-08-19 01:32:26 +02:00
parent 66fc364739
commit f5778fed2a
17 changed files with 522 additions and 94 deletions

View file

@ -0,0 +1,31 @@
{% load static menu_tags wagtailuserbar %}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>{% block title %}Association des élèves de l'ENS Ulm{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="{% static "cofcms/css/screen.css" %}"/>
</head>
<body>
<header>
<section class="top-menu">
<h1 class="cof"><a href="/">COF</a></h1>
<nav>
{% flat_menu "cof-nav-ext" template="cofcms/base_nav.html" %}
</nav>
</section>
<section class="bottom-menu">
<nav>
{% flat_menu "cof-nav-int" template="cofcms/base_nav.html" apply_active_classes=True %}
</nav>
</section>
</header>
<div class="container">
{% block content %}{% endblock %}
</div>
{% wagtailuserbar %}
</body>
</html>

View file

@ -0,0 +1,9 @@
<ul class="menu">
{% for item in menu_items %}
<li class="{{ item.active_class }}">
<a href="{{ item.href }}">
{{ item.text }}
</a>
</li>
{% endfor %}
</ul>

View file

@ -0,0 +1,18 @@
{% extends "cofcms/base.html" %}
{% load wagtailimages_tags cofcms_tags %}
{% block content %}
<section class="intro">
<h1>{{ page.title }}</h1>
<div>{{ page.introduction|safe }}</div>
</section>
<section class="actulist">
{% for actu in page.actus %}
<article class="actu">
<h2>{{ actu.title }}</h2>
{{ actu.body|safe }}
</article>
{% endfor %}
</section>
{% endblock %}

View file

@ -0,0 +1,34 @@
{% extends "cofcms/base.html" %}
{% load wagtailimages_tags cofcms_tags %}
{% block content %}
<section class="intro">
<h1>{{ page.title }}</h1>
<div>{{ page.introduction|safe }}</div>
</section>
<section class="directory">
{% for entry in page.entries %}
<article class="entry" id="{{ entry.slug }}">
<h2>{{ entry.title }}</h2>
{% if entry.image %}
{% image entry.image width-400 class="entry-img" %}
{% endif %}
<div class="desc">{{ entry.body|safe }}</div>
{% if entry.links %}
<ul class="links">
{% for block in entry.links %}
<li>
{% if block.block_type == "lien" %}
<a href="{{ block.value.url }}">{{ block.value.texte }}</a>
{% else %}
{{ block.value.texte }} : <button data-mref="{{ block.value.email|obfuscate_mail }}" class="mail-contact">Afficher l'adresse mail</a>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
</article>
{% endfor %}
</section>
{% endblock %}

View file

@ -0,0 +1,23 @@
{% extends "cofcms/base.html" %}
{% load wagtailimages_tags cofcms_tags %}
{% block content %}
<section class="intro">
<h1>{{ page.title }}</h1>
<div>{{ page.introduction|safe }}</div>
</section>
<section class="pagecontent">
{% for block in page.body %}
{% if block.block_type == "heading" %}
<h2>{{ block.value }}</h2>
{% else %}{% if block.block_type == "paragraph" %}
<article class="paragraph">
{{ block.value|safe }}
</article>
{% else %}{% if block.block_type == "image" %}
{% image block.value width-400 %}
{% endif %}{% endif %}{% endif %}
{% endfor %}
</section>
{% endblock %}

View file

@ -0,0 +1,2 @@
{% extends "cofcms/base.html" %}