[enh] move to template inheritance to avoid redudency

This commit is contained in:
Laurent Peuch 2016-02-09 22:03:18 +01:00
parent ef55e9baf2
commit 64c96f5122
3 changed files with 76 additions and 90 deletions

View File

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link type="text/css" rel="stylesheet" href="static/css/fonts.css" media="screen,projection"/>
<link type="text/css" rel="stylesheet" href="static/css/style.css" media="screen,projection"/>
{% block css %}
{% endblock %}
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>{{ settings.title }}</title>
</head>
<body>
<div class="gallery-header">
<img id="logo" src="static/img/logo.svg" />
<h1>{{ settings.title }}</h1>
{% if settings.sub_title -%}<h4>{{ settings.sub_title }}</h4>{% endif -%}
<hr>
{% if settings.menu -%}
{% include 'menu.html' %}
{% endif -%}
</div>
{% block content %}
{% endblock %}
<footer>
<p>Generated using <a href="https://github.com/psycojoker/prosopopee">Prosopopée</a> · content under <a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a> · atom logo by <a href="https://thenounproject.com/jjjon/">Jonathan Li</a> under <a href="https://creativecommons.org/licenses/by/3.0/">CC-BY</a></p>
</footer>
</body>
</html>

View File

@ -1,28 +1,6 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link type="text/css" rel="stylesheet" href="static/css/fonts.css" media="screen,projection"/>
<link type="text/css" rel="stylesheet" href="static/css/style.css" media="screen,projection"/>
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>{{ settings.title }}</title>
</head>
<body>
<div class="gallery-header">
<img id="logo" src="static/img/logo.svg" />
<h1>{{ settings.title }}</h1>
{% if settings.sub_title -%}<h4>{{ settings.sub_title }}</h4>{% endif -%}
<hr>
{% if settings.menu -%}
{% include 'menu.html' %}
{% endif -%}
</div>
{% extends "base.html" %}
{% block content %}
<div class="galleries-grid">
{% for galleries_line in galleries|reverse|batch(3)|reverse %}
<div class="galleries-line covers-{{ galleries_line|length }}">
@ -45,9 +23,4 @@
</div>
<p style="visibility: hidden">.</p>
<footer>
<p>Generated using <a href="https://github.com/psycojoker/prosopopee">Prosopopée</a> · content under <a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a> · atom logo by <a href="https://thenounproject.com/jjjon/">Jonathan Li</a> under <a href="https://creativecommons.org/licenses/by/3.0/">CC-BY</a></p>
</footer>
</body>
</html>
{% endblock %}

View File

@ -1,27 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link type="text/css" rel="stylesheet" href="static/css/fonts.css" media="screen,projection"/>
<link type="text/css" rel="stylesheet" href="static/css/style.css" media="screen,projection"/>
{% extends "base.html" %}
{% block css %}
<link type="text/css" rel="stylesheet" href="static/css/style-page.css" media="screen,projection"/>
{% endblock %}
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>{{ settings.title }}</title>
</head>
<body>
<div class="gallery-header static-header">
<img id="logo" src="static/img/logo.svg" />
<h1>{{ settings.title }}</h1>
{% if settings.sub_title -%}<h4>{{ settings.sub_title }}</h4>{% endif -%}
<hr>
{% if settings.menu -%}
{% include 'menu.html' %}
{% endif -%}
</div>
{% block content %}
<section class="text">
<h2>{{ pages.title }}</h2>
</section>
@ -40,9 +23,4 @@
</div>
<script type="text/javascript" src="static/js/jquery-2.1.4.min.js" charset="utf-8"></script>
<footer>
<p>Generated using <a href="https://github.com/psycojoker/prosopopee">Prosopopée</a> · content under <a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a> · atom logo by <a href="https://thenounproject.com/jjjon/">Jonathan Li</a> under <a href="https://creativecommons.org/licenses/by/3.0/">CC-BY</a></p>
</footer>
</body>
</html>
{% endblock %}