Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 171 lines (134 sloc) 5.646 kb
4553583 @alobbs WIP: Page Download
alobbs authored
1 # -*- Mode: python; coding: utf-8 -*-
2
3 #
4 # Cherokee Web Site
5 #
6 # Authors:
7 # Alvaro Lopez Ortega <alvaro@alobbs.com>
8 #
9 # Copyright (C) 2001-2011 Alvaro Lopez Ortega
10 #
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of version 2 of the GNU General Public
13 # License as published by the Free Software Foundation.
14 #
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 # 02110-1301, USA.
24 #
4564f93 @alobbs New branch
alobbs authored
25
26 import CTK
27 import Page
a9315b9 @alobbs Show latest SVN commits
alobbs authored
28 import Twitter
c60c62d @alobbs Show latest SVN commits
alobbs authored
29 import Commits
6d66d2f @alobbs WIP: Latest version on the front-page
alobbs authored
30 import Downloads
d84a5e3 @alobbs Adds mailing list support to the mix
alobbs authored
31 import MailingList
4564f93 @alobbs New branch
alobbs authored
32
a9315b9 @alobbs Show latest SVN commits
alobbs authored
33
c6638ee @alobbs WIP
alobbs authored
34 class Top_Banner (CTK.Box):
35 H1 = "Evolved Web Infrastructure Software"
36 P1 = "Cherokee is an innovative, feature rich, and yet easy to configure open source Web Server."
37
38 def __init__ (self):
39 CTK.Box.__init__ (self, {'id': 'sprint'})
40
41 # Banner body
42 box = CTK.Box ({'id': 'mainmsg'})
43 box += CTK.RawHTML ('<h1>%s</h1>'%(self.H1))
44 box += CTK.RawHTML ('<p>%s</p>'%(self.P1))
45
46 # Download
ceeb8c2 @ionmx WIP Beta
ionmx authored
47 link = CTK.Link ("/overview.html", props={'id': "overview"})
48 link += CTK.RawHTML ("Learn More")
49 box += link
50
51 self += box
52
53 class Download_Box (CTK.Box):
54 def __init__ (self):
55 CTK.Box.__init__ (self, {'id': 'download-box'})
56
57 latest_version = Downloads.get_latest_version()
58 # Download
59 box = CTK.Box ({'id': 'download-msg'})
c52d0ae @alobbs WIP: SVN page
alobbs authored
60 link = CTK.Link ("/downloads.html", props={'id': "download"})
c6638ee @alobbs WIP
alobbs authored
61 link += CTK.RawHTML ("<span>Get Cherokee</span><br/>Download Cherokee %(latest_version)s"%(locals()))
62 box += link
63
64 self += box
65
66
d844a14 @alobbs WIP
alobbs authored
67 class Highlights (CTK.Container):
68 H2 = "Features Highlights"
69
70 FEATURES = {
71 'Modern Technologies': "Cherokee supports the most widespread Web technologies: FastCGI, SCGI, PHP, uWSGI, SSI, CGI, LDAP, TLS/SSL, HTTP proxying, Video streaming, Content caching, Traffic Shaping, etc.",
72 'Cross Platform': "Cherokee runs on Linux, MacOS X, Solaris, and BSD. A native Windows port is on the works.",
73 'User friendly': "All the configuration is done through Cherokee-Admin, a beautiful and powerful Web interface.",
74 'Web Apps repository': "Cherokee allows to deploy Web Apps optimally, in seconds, with just a few mouse clicks."
75 }
76
77 class Feature (CTK.Container):
78 def __init__ (self, name, description):
79 CTK.Container.__init__ (self)
80 self += CTK.RawHTML ('<strong>%(name)s</strong><br/><span>%(description)s</span>'%(locals()))
81
82 def __init__ (self):
83 CTK.Container.__init__ (self)
84 self += CTK.RawHTML('<h2>%s</h2>' %(self.H2))
85
86 l = CTK.List ({'class': 'list'})
87 for k in self.FEATURES:
88 l += self.Feature (k, self.FEATURES[k])
89
90 box = CTK.Box ({'id': 'features'})
91 box += l
92 self += box
93
ceeb8c2 @ionmx WIP Beta
ionmx authored
94 class Sidebox (CTK.Container):
95 ELEMENTS = {
96 'download': {
97 'icon': '/static/images/o.png',
98 'url': '/downloads.html',
99 'title': 'Download Cherokee Web Server',
100 'hint': 'LATEST'
101 },
102 'documentation': {
103 'icon': '/static/images/o.png',
104 'url': '/documentation.html',
105 'title': 'Read the Documentation',
106 'hint': 'Tutorials, recipes, etc'
107 },
108 'contruibute': {
109 'icon': '/static/images/o.png',
110 'url': '/contribute.html',
111 'title': 'Contribute to the project',
112 'hint': 'Help us to develop the greatest Web Server'
113 }
114 }
115
116 class Element (CTK.Container):
117 def __init__ (self, url, icon, title, hint):
118 CTK.Container.__init__ (self)
119 self += CTK.RawHTML ('<img src="%(icon)s" title="%(title)s"><a href="%(url)s">%(title)s</a><br/><span>%(hint)s</span>'%(locals()))
120
121 def __init__ (self):
122 CTK.Container.__init__ (self)
123
124 l = CTK.List ()
125 for k in self.ELEMENTS:
126 url = self.ELEMENTS[k]['url']
127 icon = self.ELEMENTS[k]['icon']
128 title = self.ELEMENTS[k]['title']
129 hint = self.ELEMENTS[k]['hint']
130 l += self.Element (url, icon, title, hint)
131
132 box = CTK.Box ({'id': 'main-links'})
133 box += l
134 self += box
135
136
d844a14 @alobbs WIP
alobbs authored
137
4564f93 @alobbs New branch
alobbs authored
138 class Home:
139 def __call__ (self):
c6638ee @alobbs WIP
alobbs authored
140 page = Page.Page_Menu()
8d46299 @ionmx Layout changes, WIP.
ionmx authored
141 page.banner += Top_Banner()
c17738d @ionmx WIP
ionmx authored
142
ceeb8c2 @ionmx WIP Beta
ionmx authored
143 main_box = CTK.Box ({'id': 'index-main'})
c17738d @ionmx WIP
ionmx authored
144 main_box += Highlights()
145 page += main_box
146
ceeb8c2 @ionmx WIP Beta
ionmx authored
147 side_box = CTK.Box ({'id': 'index-sidebox'})
148 side_box += Sidebox()
c17738d @ionmx WIP
ionmx authored
149 page += side_box
b824872 @ionmx Style index sidebar
ionmx authored
150
151 page += CTK.Box({'class': 'clr'})
7cd4096 @alobbs WIP: Caching, SVN page
alobbs authored
152
ceeb8c2 @ionmx WIP Beta
ionmx authored
153 bar3 = CTK.Box ({'class': 'bar3'})
154 bar3 += Twitter.Latest_Tweets()
155 page += bar3
156
157 bar3 = CTK.Box ({'class': 'bar3'})
158 bar3 += Commits.Latest_SVN_Commits()
159 page += bar3
160
161 bar3 = CTK.Box ({'class': 'bar3'})
162 bar3 += MailingList.Latest_Mailing_List()
163 page += bar3
164
165 page += CTK.Box({'class': 'clr'})
166
7cd4096 @alobbs WIP: Caching, SVN page
alobbs authored
167 return CTK.HTTP_Cacheable (10, body=page.Render())
4564f93 @alobbs New branch
alobbs authored
168
169
170 CTK.publish ('^/(index)?$', Home)
Something went wrong with that request. Please try again.