new template based upon bootstrap

This commit is contained in:
Sean O'Brien authored and James Vasile committed 2012-03-12 14:39:31 -04:00
1 parent d2bcebf676
commit 638b287d1b
26 files changed
+184 -735

No files matched your search

+2 -2
View File
@@ -7,7 +7,7 @@ class Apps(PagePlugin):
def __init__(self, *args, **kwargs):
PagePlugin.__init__(self, *args, **kwargs)
self.register_page("apps")
self.menu = cfg.main_menu.add_item("User Apps", "/apps", 80)
self.menu = cfg.main_menu.add_item("Apps", "/apps", 80)
self.menu.add_item("Photo Gallery", "/apps/photos", 35)
@cherrypy.expose
@@ -27,7 +27,7 @@ class Apps(PagePlugin):
@require()
def photos(self):
return self.fill_template(title="Open ID", main='', sidebar_right="""
<h2>Photo Gallery</h2><p>Your photos might well be the most valuable
<strong>Photo Gallery</strong><p>Your photos might well be the most valuable
digital property you have, so why trust it to companies that have no
investment in the sentimental value of your family snaps? Keep those
photos local, backed up, easily accessed and free from the whims of
+10 -8
View File
@@ -8,7 +8,7 @@ class Help(PagePlugin):
def __init__(self, *args, **kwargs):
PagePlugin.__init__(self, *args, **kwargs)
self.register_page("help")
self.menu = cfg.main_menu.add_item(_("Documentation and FAQ"), "/help", 101)
self.menu = cfg.main_menu.add_item(_("Documentation"), "/help", 101)
self.menu.add_item(_("Where to Get Help"), "/help/index", 5)
self.menu.add_item(_("Developer's Manual"), "/help/view/plinth", 10)
self.menu.add_item(_("FAQ"), "/help/view/faq", 20)
@@ -27,7 +27,7 @@ class Help(PagePlugin):
offer suggestions, edits, and screenshots for completing
it!</p>
<p><a href="http://wiki.debian.org/FreedomBox">A section of
<p><a href="http://wiki.debian.org/FreedomBox" target="_blank">A section of
the Debian wiki</a> is devoted to the %(box)s. At some
point the documentation in the wiki and the documentation in
the manual should dovetail.</p>
@@ -48,8 +48,9 @@ class Help(PagePlugin):
@cherrypy.expose
def about(self):
return self.fill_template(title=_("About the %s" % cfg.box_name), main="""
<p> We live in a world where our use of the network is
mediated by organizations that often do not have our best
<img src="/static/theme/img/freedombox-logo-200px.png" style="float:right;padding:25px;" />
<p>We live in a world where our use of the network is
mediated by those who often do not have our best
interests at heart. By building software that does not rely on
a central service, we can regain control and privacy. By
keeping our data in our homes, we gain useful legal
@@ -62,14 +63,15 @@ class Help(PagePlugin):
runs on must be cheap. The software it runs on must be easy to
install and administrate by anybody. It must be easy to
transition from existing services.</p>
<p>There are a number of projects working to realize a future
<p><a class="btn btn-primary btn-large" href="http://wiki.debian.org/FreedomBox" target="_blank">Learn more &raquo;</a></p>""",
sidebar_right=_("""<strong>Our Goal</strong><p>There are a number of projects working to realize a future
of distributed services; we aim to bring them all together in
a convenient package.</p>
<p>For more information about the Freedom Box project, see the
<p>For more information about the FreedomBox project, see the
<a href="http://wiki.debian.org/FreedomBox">Debian
Wiki</a>.</p>""")
Wiki</a>.</p>
"""))
class View(PagePlugin):
def __init__(self, *args, **kwargs):
+5 -5
View File
@@ -50,9 +50,9 @@ class Form():
quad = [0,0,0,0]
self.text += """ <label>
<span>%(label)s</span>
<input type="text" class="inputtextnowidth" name="%(name)s0" id="%(id)s0" value="%(q0)s" maxlength="3" size="1"/><b>.</b>
<input type="text" class="inputtextnowidth" name="%(name)s1" id="%(id)s1" value="%(q1)s" maxlength="3" size="1"/><b>.</b>
<input type="text" class="inputtextnowidth" name="%(name)s2" id="%(id)s2" value="%(q2)s" maxlength="3" size="1"/><b>.</b>
<input type="text" class="inputtextnowidth" name="%(name)s0" id="%(id)s0" value="%(q0)s" maxlength="3" size="1"/><strong>.</strong>
<input type="text" class="inputtextnowidth" name="%(name)s1" id="%(id)s1" value="%(q1)s" maxlength="3" size="1"/><strong>.</strong>
<input type="text" class="inputtextnowidth" name="%(name)s2" id="%(id)s2" value="%(q2)s" maxlength="3" size="1"/><strong>.</strong>
<input type="text" class="inputtextnowidth" name="%(name)s3" id="%(id)s3" value="%(q3)s" maxlength="3" size="1"/>
</label>""" % {'label':label, 'name':name, 'id':id, 'q0':quad[0], 'q1':quad[1], 'q2':quad[2], 'q3':quad[3]}
@@ -77,7 +77,7 @@ class Form():
self.text += """
<div class="submit">
<label><span></span>
<input type="submit" class="button" value="%s" name="%s" id="%s" />
<input type="submit" class="btn-primary" value="%s" name="%s" id="%s" />
</label></div>\n""" % (label, name, id)
def submit_row(self, buttons):
"""buttons is a list of tuples, each containing label, name, id. Name and id are optional."""
@@ -99,7 +99,7 @@ class Form():
if button_text != '':
button_text += "&nbsp;"
button_text += '<input type="submit" class="button" value="%s" name="%s" id="%s" />\n' % (label, name, id)
button_text += '<input type="submit" class="btn-primary" value="%s" name="%s" id="%s" />\n' % (label, name, id)
self.text += '%s</div></label>' % button_text
def name_or_id(self, name, id):
if not name: name = id
+3 -3
View File
@@ -9,7 +9,7 @@ class Privacy(PagePlugin):
def __init__(self, *args, **kwargs):
PagePlugin.__init__(self, *args, **kwargs)
self.register_page("privacy")
self.menu = cfg.main_menu.add_item("Privacy Controls", "/privacy", 12)
self.menu = cfg.main_menu.add_item("Privacy", "/privacy", 12)
self.menu.add_item("General Config", "/privacy/config", 10)
self.menu.add_item("Ad Blocking", "/privacy/adblock", 20)
self.menu.add_item("TOR", "/privacy/TOR", 30)
@@ -29,7 +29,7 @@ class Privacy(PagePlugin):
is a founding consideration, not an afterthought.</p>
"""
return self.fill_template(title=_("Privacy Control Panel"), main=main,
sidebar_right=_("""<h2>Statement of Principles</h2><p>When we say your
sidebar_right=_("""<strong>Statement of Principles</strong><p>When we say your
privacy is important, it's not just an empty pleasantry. We really
mean it. Your privacy control panel should give you fine-grained
control over exactly who can access your %s and the
@@ -37,6 +37,6 @@ information on it.</p>
<p>Your personal information should not leave this box without your
knowledge and direction. And if companies or government wants this
information, they have to ask <b>you</b> for it. This gives you a
information, they have to ask <strong>you</strong> for it. This gives you a
change to refuse and also tells you who wants your data.</p>
""") % cfg.product_name)
+1 -1
View File
@@ -14,5 +14,5 @@ class Info(PagePlugin):
@require()
def index(self):
return self.fill_template(title="Router Information", main="""
<p> Eventually we will display a bunch of info, graphs and logs about the routing functions here.</p>
<p>Eventually we will display a bunch of info, graphs and logs about the routing functions here.</p>
""")
+5 -5
View File
@@ -11,7 +11,7 @@ class router(PagePlugin):
order = 9 # order of running init in PagePlugins
def __init__(self, *args, **kwargs):
self.register_page("router")
self.menu = cfg.main_menu.add_item("Router Admin", "/router", 10)
self.menu = cfg.main_menu.add_item("Router", "/router", 10)
self.menu.add_item("Wireless", "/router/wireless", 12)
self.menu.add_item("Firewall", "/router/firewall", 18)
self.menu.add_item("Hotspot and Mesh", "/router/hotspot")
@@ -54,7 +54,7 @@ class setup(PagePlugin):
def index(self):
parts = self.forms('/router/setup')
parts['title'] = "General Router Setup"
parts['sidebar_right']="""<h2>Introduction</h2><p>Your %s is a replacement for your
parts['sidebar_right']="""<strong>Introduction</strong><p>Your %s is a replacement for your
wireless router. By default, it should do everything your usual
router does. With the addition of some extra modules, its abilities
can rival those of high-end routers costing hundreds of dollars.</p>
@@ -88,7 +88,7 @@ class wan(FormPlugin, PagePlugin):
url = ["/router/setup"]
order = 10
js = """<script LANGUAGE="JavaScript">
js = """<script type="text/javascript">
<!--
function hideshow_static() {
var d = document.getElementById('connect_type');
@@ -105,7 +105,7 @@ class wan(FormPlugin, PagePlugin):
def sidebar_right(self, *args, **kwargs):
side=''
if cfg.users.expert():
side += """<h2>WAN Connection Type</h2>
side += """<strong>WAN Connection Type</strong>
<h3>DHCP</h3><p>DHCP allows your router to automatically
connect with the upstream network. If you are unsure what
option to choose, stick with DHCP. It is usually
@@ -150,7 +150,7 @@ class wan(FormPlugin, PagePlugin):
form.dotted_quad("Static DNS 2", name="dns2", quad=[dns20, dns21, dns22, dns23])
form.dotted_quad("Static DNS 3", name="dns3", quad=[dns30, dns31, dns32, dns33])
form.html('</div>')
form.html(""" <script LANGUAGE="JavaScript">
form.html(""" <script type="text/javascript">
<!--
hideshow_static();
// -->
+2 -2
View File
@@ -8,7 +8,7 @@ class Services(PagePlugin):
def __init__(self, *args, **kwargs):
PagePlugin.__init__(self, *args, **kwargs)
self.register_page("services")
self.menu = cfg.main_menu.add_item("Other Services", "/services", 90)
self.menu = cfg.main_menu.add_item("Services", "/services", 90)
self.menu.add_item("Open ID", "/services/openid", 35)
@cherrypy.expose
@@ -19,7 +19,7 @@ class Services(PagePlugin):
@require()
def openid(self):
return self.fill_template(title="Open ID", main='', sidebar_right="""
<h2>One Login for Every Site</h2><p>Your %s is also an OpenID
<strong>One Login for Every Site</strong><p>Your %s is also an OpenID
machine. It can generate credentials that allow you to log in to many
websites without the need to remember or enter a separate username and
password at each one.</p>
+3 -3
View File
@@ -10,7 +10,7 @@ class Sharing(PagePlugin):
def __init__(self, *args, **kwargs):
PagePlugin.__init__(self, *args, **kwargs)
self.register_page("sharing")
self.menu = cfg.main_menu.add_item("Resource Sharing", "/sharing", 35)
self.menu = cfg.main_menu.add_item("Sharing", "/sharing", 35)
self.menu.add_item("File Server", "/sharing/files", 10)
@cherrypy.expose
@@ -25,7 +25,7 @@ class Sharing(PagePlugin):
@require()
def files(self):
return self.fill_template(title="File Server", main='', sidebar_right=_("""
<h2>Freedom NAS</h2><p> The %s can make your spare hard drives accessible to your
<strong>Freedom NAS</strong><p> The %s can make your spare hard drives accessible to your
local network, thus acting as a NAS server. We currently support
sharing files via NFS and SMB.
@@ -47,7 +47,7 @@ class PrinterSharing(PagePlugin):
<p>TODO: Setup and install CUPS</p>
"""
return self.fill_template(title="Printer Sharing", main=main, sidebar_right="""
<h2>Share Your Printer</h2><p> The %s can share your printer via Samba and CUPS.</p>
<strong>Share Your Printer</strong><p> The %s can share your printer via Samba and CUPS.</p>
""" % cfg.box_name)
+1 -1
View File
@@ -64,7 +64,7 @@ class general(FormPlugin, PagePlugin):
## only expert users are going to get deep enough to see any timestamps
if not cfg.users.expert():
return ''
return _(#"""<h2>Time Zone</h2>
return _(#"""<strong>Time Zone</strong>
"""<p>Set your timezone to get accurate
timestamps. %(product)s will use this information to set your
%(box)s's systemwide timezone.</p>
+1 -1
View File
@@ -15,7 +15,7 @@ class experts(FormPlugin, PagePlugin):
order = 10
def help(self, *args, **kwargs):
side = _(#"""<h2>Expert Mode</h2>
side = _(#"""<strong>Expert Mode</strong>
"""
<p>The %(box)s can be administered in two modes, 'basic'
and 'expert'. Basic mode hides a lot of features and
+2 -2
View File
@@ -18,7 +18,7 @@ class Sys(PagePlugin):
def __init__(self, *args, **kwargs):
PagePlugin.__init__(self, *args, **kwargs)
self.register_page("sys")
self.menu = cfg.main_menu.add_item(_("%s System" % cfg.product_name), "/sys", 100)
self.menu = cfg.main_menu.add_item(_("System"), "/sys", 100)
self.menu.add_item(_("Configure"), "/sys/config", 10)
self.menu.add_item(_("Package Manager"), "/sys/packages", 20)
self.menu.add_item(_("Users and Groups"), "/sys/users", 15)
@@ -37,7 +37,7 @@ class Sys(PagePlugin):
@require()
def packages(self):
side=_("""
<h2>Help</h2>
<strong>Help</strong>
<p>On this page, you can add or remove %s plugins to your %s.</p>
<p>Plugins are just Debian packages, so Debian's usual package management features should make this job fairly easy.</p>
""" % (cfg.product_name, cfg.box_name))
+7 -7
View File
@@ -24,8 +24,8 @@ class add(FormPlugin, PagePlugin):
order = 30
sidebar_left = ''
sidebar_right = _("""<h2>Add User</h2><p>Adding a user via this
administrative interface <b>might</b> create a system user.
sidebar_right = _("""<strong>Add User</strong><p>Adding a user via this
administrative interface <strong>might</strong> create a system user.
For example, if you provide a user with ssh access, she will
need a system account. If you don't know what that means,
don't worry about it.</p>""")
@@ -70,16 +70,16 @@ class edit(FormPlugin, PagePlugin):
order = 35
sidebar_left = ''
sidebar_right = _("""<h2>Edit Users</h2><p>Click on a user's name to
go to a screen for editing that user's account.</p><h2>Delete
Users</h2><p>Check the box next to a users' names and then click
sidebar_right = _("""<strong>Edit Users</strong><p>Click on a user's name to
go to a screen for editing that user's account.</p><strong>Delete
Users</strong><p>Check the box next to a users' names and then click
"Delete User" to remove users from %s and the %s
system.</p><p>Deleting users is permanent!</p>""" % (cfg.product_name, cfg.box_name))
def main(self, msg=''):
users = cfg.users.keys()
add_form = Form(title=_("Edit or Delete User"), action="/sys/users/edit", message=msg)
add_form.html('<span class="indent"><b>Delete</b><br /></span>')
add_form.html('<span class="indent"><strong>Delete</strong><br /></span>')
for uname in sorted(users.keys()):
add_form.html('<span class="indent">&nbsp;&nbsp;%s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' %
add_form.get_checkbox(name=uname) +
@@ -123,6 +123,6 @@ class edit(FormPlugin, PagePlugin):
return self.fill_template(template="err", title=_("Unnown User"), main=main,
sidebar_left=self.sidebar_left, sidebar_right=sidebar_right)
main = _("""<h2>Edit User '%s'</h2>""" % u['username'])
main = _("""<strong>Edit User '%s'</strong>""" % u['username'])
sidebar_right = ''
return self.fill_template(title="", main=main, sidebar_left=self.sidebar_left, sidebar_right=sidebar_right)
+2 -2
View File
@@ -22,13 +22,13 @@ class wan(FormPlugin, PagePlugin):
end will be reachable from the WAN. If your %(box)s
connects you to the internet, that means you'll be able to log
in to the front end from the internet. This might be
convenient, but it is also <b>dangerous</b>, since it can
convenient, but it is also <strong>dangerous</strong>, since it can
enable attackers to gain access to your %(box)s from the
outside world. All they'll need is your username and
passphrase, which they might guess or they might simply try
every posible combination of letters and numbers until they
get in. If you enable the WAN administration option, you
<b>must</b> use long and complex passphrases.</p>
<strong>must</strong> use long and complex passphrases.</p>
<p>For security reasons, neither WAN Administration nor WAN
SSH is available to the `admin` user account.</p>