diff themes/default/templates.py @ 703:1a19ee7d8d8a

server_side: add default theme
author souliane <souliane@mailoo.org>
date Thu, 04 Jun 2015 11:56:34 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/themes/default/templates.py	Thu Jun 04 11:56:34 2015 +0200
@@ -0,0 +1,111 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+# Libervia: a Salut à Toi frontend
+# Copyright (C) 2011, 2012, 2013, 2014, 2015 Jérôme Poisson <goffi@goffi.org>
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+ERROR = u"""
+<html>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <link rel='stylesheet' href='{styles}/blog.css'>
+    <link rel="icon" type="image/png" href="{images}/sat_logo_16.png">
+
+    <head profile="http://www.w3.org/2005/10/profile">
+        <title>MICROBLOG ERROR</title>
+    </head>
+
+    <body>
+        <h1 class="error">{message}</h1>
+    </body>
+</html>
+"""
+
+HEADER = u"""
+<html>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <meta name="keywords" content="{keywords}">
+    <meta name="description" content="{description}">
+    <link rel="alternate" type="application/atom+xml" href="{base_url}/atom.xml"/>
+    <link rel='stylesheet' href='{styles}/blog.css'>
+    <link rel="icon" type="image/png" href="{favicon}">
+
+    <head profile="http://www.w3.org/2005/10/profile">
+        <title>{title}</title>
+    </head>
+
+    <body>
+        <div class="mblog_title"><a href="{base_url}">{banner_elt}{title_elt}</a></div>
+
+        <div class="header">
+	        <div class="header_content">
+                {later_message}
+                {later_messages}
+	            {older_message}
+	        </div>
+        </div>
+"""
+
+BANNER = u"""<img src="{url}" alt="{alt}"/>{suffix}"""
+
+NAV_LINK = u"""<a href="{link}" class="{class}">{text}</a>"""
+
+MICRO_MESSAGE = u"""
+<div class="mblog_entry {extra_style}">
+    <a href="{message_link}" class="item_link">
+        <div class="mblog_header mblog_header_main">
+            <div class="mblog_metadata">
+                <div class="mblog_author">{author}</div>
+                <div class="mblog_timestamp">{date}</div>
+            </div>
+        </div>
+    </a>
+    <span class="mblog_content">{content}</span>
+    <a href="{message_link}" class="item_link">
+        <div class="mblog_footer mblog_footer_main">
+            <div class="mblog_metadata">
+                <div class="mblog_comments">{comments_count} {comments_text}</div>
+            </div>
+        </div>
+    </a>
+</div>
+<a href="{comments_link}" class="comments_link">{previous_comments}</a>
+"""
+
+MICRO_COMMENT = u"""
+<div class="mblog_entry {extra_style}">
+    <div class="mblog_header">
+        <div class="mblog_metadata">
+            <div class="mblog_author">{author}</div>
+            <div class="mblog_timestamp">{date}</div>
+        </div>
+    </div>
+    <span class="mblog_content">{content}</span>
+</div>
+"""
+
+message_title = u"""<h1><a href="{message_link}" class="item_link">{message_title}</a></h1>{content}"""
+MESSAGE = MICRO_MESSAGE.replace('{content}', message_title)
+COMMENT = MICRO_COMMENT.replace('{content}', message_title)
+
+FOOTER = u"""
+        <div class="footer">
+            <div class="footer_content">
+                {older_messages}
+            </div>
+        </div>
+    </body>
+</html>
+"""