Mercurial > libervia-templates
changeset 0:9a31d2c02f47
SàT templates, initial commit
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 21 Feb 2017 20:31:01 +0100 |
parents | |
children | b13a26d55c64 |
files | __init__.py default/base/base.html default/blog/articles.html default/blog/item.html default/blog/static/style.css |
diffstat | 4 files changed, 81 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/default/base/base.html Tue Feb 21 20:31:01 2017 +0100 @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8" /> + <title>{% block title %}{{C.APP_NAME}}{% endblock %}</title> + {% if css_inline %} + <style type="text/css"> + {{css_content}} + </style> + {% else %} + <link rel='stylesheet' type="text/css" href='static/style.css'> + {% endif %} +</head> +<body> + <div id="body"> + {% block body %} + {% endblock body %} + </div> + <footer>{% block footer %}Powered by {{C.APP_NAME}}{% endblock %}</footer> +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/default/blog/articles.html Tue Feb 21 20:31:01 2017 +0100 @@ -0,0 +1,9 @@ +{% extends 'base/base.html' %} + +{% block body %} +<div id="blog_items"> + {% for item in items %} + {% include 'blog/item.html' %} + {% endfor %} +</div> +{% endblock body %}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/default/blog/item.html Tue Feb 21 20:31:01 2017 +0100 @@ -0,0 +1,15 @@ +{% block item %} +<article> + <header> + {% block header %} + <div class="title">{% block blog_title %}{{ item.title_xhtml or item.title or '' }}{% endblock %}</div> + {% endblock header %} + </header> + + <div class="content"> + {% block content %} + {{ item.content_xhtml or item.content or ''}} + {% endblock content %} + </div> +</article> +{% endblock item %}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/default/blog/static/style.css Tue Feb 21 20:31:01 2017 +0100 @@ -0,0 +1,36 @@ +html { + font-family: sans-serif; +} + +header { + font-weight: bold; + text-align: center; +} + +article { + margin: 2% auto; + width: 80%; + border-style: solid; + border-width: 1px; + border-radius: 3px; + padding: 1%; + background: lightgray; +} + +article div.content { + text-align: justify; + font-size: 0.9em; +} + +article img { + max-width: 100%; +} + +footer { + width: 100%; + text-align: center; + font-size: 0.7em; + font-weight: bold; + position: fixed; + bottom: 5px; +}