Minor: Fixed return value
[biaweb_qt.git] / biaweb_strings.py
1 # BiaWeb Website content manager (c) 2010 V.Harishankar
2 # Strings class
3
4 template_main = """<?xml version="1.0" encoding="UTF-8"?>
5 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7 <head>
8 <title>${site_title}</title>
9 <base href="${site_url}" />
10 <meta name="generator" content="BiaWeb"/>
11 <meta name="keywords" content="${meta_keywords}"/>
12 <meta name="description" content="${meta_description}"/>
13 <link rel="StyleSheet" type="text/css" href="style.css" />
14 <link rel="alternate" type="application/rss+xml" title="Entries RSS 2.0" href="subscribe.xml" />
15 </head>
16 <body>
17 <div id="head">
18 <h1><a href="${site_url}">${page_title}</a></h1>
19 <div class="headerdesc">${page_desc}</div>
20 </div>
21 <div id="main">
22 ${contents_bit}
23 </div>
24 <div id="sidebar">
25 <h2>Categories</h2>
26 ${list_of_categories}
27 <h2>Best rated</h2>
28 ${list_best_rated}
29 <h2>Subscribe</h2>
30 <a href="subscribe.xml">Latest articles (RSS)</a>
31 <h2>Search</h2>
32 <form action="cgi-bin/search.py" method="post" enctype="multipart/form-data">
33 <p><input type="text" name="query" maxlength="255" style="width:142px;border: 1px inset #5A5A5A; color:#5A5A5A; background-color:#FFFFFF;" value="" /><br />
34 <input type="submit" value="Search" /><br />
35 <input type="hidden" name="fromsearch" value="fromsearch" />
36 <input type="radio" name="criteria" value="1" checked="checked" />All words<br />
37 <input type="radio" name="criteria" value="2" />Any word</p>
38 </form>
39 </div>
40 <div id="footer">${copyright}<br />Site generated by
41 <a href=\"http://harishankar.org/software/biaweb_qt.php\">BiaWeb Qt</a> created by V. Harishankar</div>
42 </body>
43 </html>"""
44
45 template_article_bit = """<h2>${article_title}</h2>
46 <div class="modified">Created: ${article_cdate} | Last modified: ${article_mdate}</div>
47 <div class="rating">Rating: ${rating}</div>
48 <div class="content">${article_contents}</div>
49 """
50
51 template_news_item_bit = """<h3><a href="${news_link}">${news_title}</a></h3>
52 <div class="modified">${news_datetime}</div>
53 <div class="content">${news_description}</div>
54 """
55
56 template_index_bit = """<h2>Welcome to ${site_name}</h2>
57 <div class="content">
58 Welcome to my site, ${site_name}.
59 </div>
60 <h2>Latest Articles</h2>
61 ${news_updates}
62 """
63
64 template_table_bit = """<h2>${category_title}</h2>
65 <p>${category_desc}</p>
66 <table class="categorytable">
67 <thead>
68 <tr>
69 <td style="width:50%">Title</td>
70 <td>Created on</td>
71 <td>Rated</td>
72 </tr>
73 </thead>
74 <tbody>
75 ${table_rows}
76 </tbody>
77 </table>
78 """
79
80 template_tablerow_bit = """<tr>
81 <td style="width:50%"><a href="${article_url}">${title}</a></td>
82 <td>${created}</td>
83 <td>${rating}</td>
84 </tr>
85 """
86
87 template_style = """body {
88 font-family: "Bitstream Vera Sans", Verdana, Arial, Sans Serif;
89 font-size: 0.9em;
90 background-color: #ffffff;
91 color: #000000;
92 margin: auto
93 }
94 #head {
95 width: 98%;
96 background-color: #efefef;
97 padding: 1%;
98 text-align: center;
99 }
100
101 #main {
102 width: 73%;
103 padding: 1%;
104 float: left;
105 }
106
107 #sidebar {
108 width: 23%;
109 padding: 1%;
110 float: right;
111 }
112
113 #footer {
114 width: 100%;
115 padding-top: 5px;
116 padding-bottom: 5px;
117 font-size: 0.9em;
118 text-align: center;
119 float: left;
120 background-color: #efefef;
121 }
122
123 .headerdesc {
124 font-variant: small-caps;
125 font-size: 1.1em;
126 }
127
128 .content {
129 text-align: justify;
130 line-height: 1.1em;
131 }
132
133 .categorytable {
134 width: 100%;
135 }
136
137 .categorytable thead {
138 font-weight: bold;
139 }
140
141 .modified {
142 font-size: 0.8em;
143 color: #666666;
144 }
145
146 .rating {
147 font-size: 0.8em;
148 color: #666666;
149 }
150
151 h1, h2, h3 {
152 font-family: "Bitstream Vera Serif", Serif;
153 padding: 0;
154 margin: 0;
155 margin-top: 5px;
156 margin-bottom: 5px;
157 }
158
159 hr {
160 border: 0;
161 border-bottom: 1px solid;
162 border-color: #888888;
163 }
164
165 h1 {
166 font-size: 2.4em;
167 color: #000099;
168
169 }
170 h1 a, h1 a:hover, h1 a:visited, h2 a:active {
171 text-decoration: none;
172 }
173 h2 {
174 font-size: 1.4em;
175 background-color: #efefef;
176 }
177 h2 a, h2 a:hover, h2 a:visited, h2 a:active {
178 text-decoration: none;
179 }
180 h3 {
181 font-size: 1.2em;
182 a {
183 color: #0000dd;
184 }
185 a:visited {
186 color: #0000aa;
187 }
188 a:active, a:hover {
189 color: #0000ff;
190 }"""
191
192 template_rss = """<?xml version="1.0"?>
193 <rss version="2.0">
194 <channel>
195 <title>${title}</title>
196 <link>${link}</link>
197 <description>${description}</description>
198 <generator>BiaWeb</generator>
199 ${rss_items}
200 </channel>
201 </rss>"""
202
203 template_rss_item = """
204 <item>
205 <title>${item_title}</title>
206 <link>${item_link}</link>
207 <description>${description}</description>
208 <guid>${item_link}</guid>
209 </item>
210 """
211
212 stopwords = """$
213 0
214 1
215 2
216 3
217 4
218 5
219 6
220 7
221 8
222 9
223 a
224 able
225 about
226 after
227 again
228 all
229 almost
230 already
231 also
232 although
233 am
234 an
235 and
236 another
237 any
238 are
239 are
240 around
241 as
242 at
243 b
244 based
245 be
246 because
247 been
248 before
249 being
250 between
251 both
252 bring
253 but
254 by
255 c
256 came
257 can
258 com
259 come
260 comes
261 could
262 d
263 did
264 do
265 does
266 doing
267 done
268 e
269 each
270 eight
271 else
272 etc
273 even
274 every
275 f
276 five
277 for
278 four
279 from
280 g
281 get
282 gets
283 getting
284 go
285 going
286 got
287 h
288 had
289 has
290 have
291 he
292 he
293 her
294 here
295 him
296 himself
297 his
298 how
299 however
300 href
301 http
302 i
303 if
304 in
305 including
306 into
307 is
308 it
309 it
310 its
311 j
312 just
313 k
314 kb
315 know
316 l
317 like
318 looks
319 m
320 mailto
321 make
322 making
323 many
324 may
325 mb
326 me
327 means
328 might
329 more
330 more
331 most
332 move
333 mr
334 much
335 must
336 my
337 n
338 need
339 needs
340 never
341 nice
342 nine
343 no
344 not
345 now
346 o
347 of
348 often
349 oh
350 ok
351 on
352 on
353 one
354 only
355 or
356 org
357 other
358 our
359 out
360 over
361 own
362 p
363 piece
364 q
365 r
366 rather
367 re
368 really
369 s
370 said
371 same
372 say
373 says
374 see
375 seven
376 several
377 she
378 should
379 since
380 single
381 six
382 so
383 so
384 some
385 something
386 still
387 stuff
388 such
389 t
390 take
391 ten
392 than
393 that
394 the
395 their
396 them
397 them
398 then
399 there
400 there
401 these
402 they
403 they
404 thing
405 things
406 this
407 those
408 three
409 through
410 to
411 too
412 took
413 two
414 u
415 under
416 up
417 us
418 use
419 used
420 using
421 usual
422 v
423 ve
424 very
425 via
426 w
427 want
428 was
429 way
430 we
431 we
432 well
433 were
434 what
435 when
436 where
437 whether
438 which
439 while
440 whilst
441 who
442 why
443 will
444 with
445 within
446 would
447 x
448 y
449 yes
450 yet
451 you
452 your
453 z""".split ("\n")
454
455 searchindex_htaccess = """<Files searchwords.idx>
456 order allow,deny
457 deny from all
458 </Files>"""