annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
703
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
1 #!/usr/bin/python
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
2 # -*- coding: utf-8 -*-
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
3
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
4 # Libervia: a Salut à Toi frontend
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
5 # Copyright (C) 2011, 2012, 2013, 2014, 2015 Jérôme Poisson <goffi@goffi.org>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
6
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
7 # This program is free software: you can redistribute it and/or modify
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
8 # it under the terms of the GNU Affero General Public License as published by
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
9 # the Free Software Foundation, either version 3 of the License, or
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
10 # (at your option) any later version.
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
11
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
12 # This program is distributed in the hope that it will be useful,
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
15 # GNU Affero General Public License for more details.
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
16
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
17 # You should have received a copy of the GNU Affero General Public License
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
19
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
20 ERROR = u"""
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
21 <html>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
22 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
23 <link rel='stylesheet' href='{styles}/blog.css'>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
24 <link rel="icon" type="image/png" href="{images}/sat_logo_16.png">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
25
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
26 <head profile="http://www.w3.org/2005/10/profile">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
27 <title>MICROBLOG ERROR</title>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
28 </head>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
29
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
30 <body>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
31 <h1 class="error">{message}</h1>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
32 </body>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
33 </html>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
34 """
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
35
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
36 HEADER = u"""
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
37 <html>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
38 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
39 <meta name="keywords" content="{keywords}">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
40 <meta name="description" content="{description}">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
41 <link rel="alternate" type="application/atom+xml" href="{base_url}/atom.xml"/>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
42 <link rel='stylesheet' href='{styles}/blog.css'>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
43 <link rel="icon" type="image/png" href="{favicon}">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
44
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
45 <head profile="http://www.w3.org/2005/10/profile">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
46 <title>{title}</title>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
47 </head>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
48
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
49 <body>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
50 <div class="mblog_title"><a href="{base_url}">{banner_elt}{title_elt}</a></div>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
51
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
52 <div class="header">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
53 <div class="header_content">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
54 {later_message}
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
55 {later_messages}
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
56 {older_message}
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
57 </div>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
58 </div>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
59 """
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
60
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
61 BANNER = u"""<img src="{url}" alt="{alt}"/>{suffix}"""
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
62
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
63 NAV_LINK = u"""<a href="{link}" class="{class}">{text}</a>"""
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
64
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
65 MICRO_MESSAGE = u"""
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
66 <div class="mblog_entry {extra_style}">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
67 <a href="{message_link}" class="item_link">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
68 <div class="mblog_header mblog_header_main">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
69 <div class="mblog_metadata">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
70 <div class="mblog_author">{author}</div>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
71 <div class="mblog_timestamp">{date}</div>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
72 </div>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
73 </div>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
74 </a>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
75 <span class="mblog_content">{content}</span>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
76 <a href="{message_link}" class="item_link">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
77 <div class="mblog_footer mblog_footer_main">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
78 <div class="mblog_metadata">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
79 <div class="mblog_comments">{comments_count} {comments_text}</div>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
80 </div>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
81 </div>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
82 </a>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
83 </div>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
84 <a href="{comments_link}" class="comments_link">{previous_comments}</a>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
85 """
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
86
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
87 MICRO_COMMENT = u"""
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
88 <div class="mblog_entry {extra_style}">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
89 <div class="mblog_header">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
90 <div class="mblog_metadata">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
91 <div class="mblog_author">{author}</div>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
92 <div class="mblog_timestamp">{date}</div>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
93 </div>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
94 </div>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
95 <span class="mblog_content">{content}</span>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
96 </div>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
97 """
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
98
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
99 message_title = u"""<h1><a href="{message_link}" class="item_link">{message_title}</a></h1>{content}"""
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
100 MESSAGE = MICRO_MESSAGE.replace('{content}', message_title)
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
101 COMMENT = MICRO_COMMENT.replace('{content}', message_title)
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
102
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
103 FOOTER = u"""
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
104 <div class="footer">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
105 <div class="footer_content">
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
106 {older_messages}
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
107 </div>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
108 </div>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
109 </body>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
110 </html>
1a19ee7d8d8a server_side: add default theme
souliane <souliane@mailoo.org>
parents:
diff changeset
111 """