]> git.ipfire.org Git - people/shoehn/ipfire.org.git/blame - www/web/elements.py
Add translation page.
[people/shoehn/ipfire.org.git] / www / web / elements.py
CommitLineData
dba657a8
MT
1#!/usr/bin/python
2
1ebd9fc1 3from web import Data
dba657a8
MT
4from banners import Banners
5from info import Info
6
7class Box(Data):
8 def __init__(self, headline, subtitle=""):
9 Data.__init__(self)
c50922dd 10 self.w("""<div class="post"><a name="%s"></a><h3>%s</h3>""" % (headline,headline,))
dba657a8
MT
11 if subtitle:
12 self.w("""<div class="post_info">%s</div>""" % (subtitle,))
13
14 def __call__(self):
15 self.w("""<br class="clear" /></div>""")
16 return Data.__call__(self)
17
18class Sidebar(Data):
19 def __init__(self):
20 Data.__init__(self)
21
22 def content(self, lang):
23 banners = Banners()
24 self.w("""<h4>%(title)s</h4><a href="%(link)s" target="_blank">
25 <img class="banner" src="%(uri)s" /></a>""" % banners.random())
26
27 def __call__(self, lang):
28 self.content(lang)
29 return Data.__call__(self)
30
31class Releases(Data):
32 def __init__(self):
33 Data.__init__(self)
34
35 def content(self, lang):
36 info = Info()
37 if lang == "de":
38 self.write("""<h4><span>release</span> informationen</h4>
39 <p><strong>Aktuelle Version</strong>:<br />%(stable)s</p>
40 <p><strong>Testversionen</strong>:<br />%(testing)s</p>
41 """ % info["releases"])
42 else:
43 self.write("""<h4><span>info</span>rmation</h4>
44 <p><strong>Current version</strong>:<br />%(stable)s</p>
45 <p><strong>Current unstables</strong>:<br />%(testing)s</p>
46 """ % info["releases"])
47
48 def __call__(self, lang):
49 self.content(lang)
50 return Data.__call__(self)
3a205dfe
MT
51
52class DevelopmentSidebar(Sidebar):
53 def __init__(self):
54 Sidebar.__init__(self)
55
56 def __call__(self, lang):
57 return Sidebar.__call__(self, lang)
58
59 def content(self, lang):
60 self.w("""<h4>Development Ressources</h4>
61 <p> - <a href="cluster">Cluster</a> Monitoring<br />
62 - Nightly <a href="builds">Builds</a><br />
7c9e9ae0
MT
63 - <a href="source">Source</a> Code<br />
64 - Pakfire <a href="pakfire3">Repositories</a><br />
65 - <a href="translate">Localization</a> Status</p>
3a205dfe 66 """)