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