diff --git a/INSTALL b/INSTALL index d62bc8835..f848445b4 100644 --- a/INSTALL +++ b/INSTALL @@ -4,7 +4,7 @@ Install the pandoc, python-augeas, and bjsonrpc: -apt-get install augeas-tools libpython2.7 pandoc psmisc python2.7 python-augeas python-bcrypt python-bjsonrpc python-cherrypy3 python-django python-passlib python-simplejson python-bootstrapform sudo +apt-get install augeas-tools libpython2.7 pandoc psmisc python2.7 python-augeas python-bcrypt python-bjsonrpc python-cherrypy3 python-django python-passlib python-simplejson python-bootstrapform libjs-twitter-bootstrap sudo Unzip and untar the source into a directory. Change to the directory containing the program. Run: @@ -40,6 +40,8 @@ The documentation has some dependencies too. * *GNU Make* processes /doc/Makefile. +* *libjs-twitter-bootstrap* - A responsive, mobile first front-end framework + * *python-bootstrapform* - Render django forms for Twitter Bootstrap ## Building the Documentation diff --git a/LICENSES b/LICENSES index 1b5b8d8b5..ab1641ef1 100644 --- a/LICENSES +++ b/LICENSES @@ -85,8 +85,6 @@ specified and linked otherwise. - themes/default/FreedomBox-Logo.7z :: [[http://thread.gmane.org/gmane.linux.debian.freedombox.user/4124/focus=4439][GPL3+/CC-BY-SA]] - themes/default/readme.md :: [[file:themes/default/readme.md::This%20theme%20is%20free%20software%20offered%20to%20you%20under%20the%20terms%20of%20the%20GNU%20Affero%20General%20Public%20License,%20Version%203%20or%20later:][GNU Affero General Public License Version 3]] - themes/default/screenshot.png :: - -- themes/default/css/bootstrap.css :: [[file:themes/default/css/bootstrap.css::*%20Licensed%20under%20the%20Apache%20License%20v2.0][Apache License v2.0]] -- themes/default/css/bootstrap-responsive.css :: [[file:themes/default/css/bootstrap-responsive.css::*%20Licensed%20under%20the%20Apache%20License%20v2.0][Apache License v2.0]] - themes/default/img/apple-touch-icon-114px-precomposed.png :: - - themes/default/img/apple-touch-icon-57px-precomposed.png :: - - themes/default/img/apple-touch-icon-72px-precomposed.png :: - @@ -109,23 +107,5 @@ specified and linked otherwise. - themes/default/img/freedombox-logotype.png :: - - themes/default/img/glyphicons-halflings.png :: - - themes/default/img/glyphicons-halflings-white.png :: - -- themes/default/js/functions.js :: - -- themes/default/js/menu.js :: - -- themes/default/js/plinth.js :: - -- themes/default/js/plugins.js :: [[file:themes/default/js/plugins.js::/%20paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/][CC0]] - themes/default/js/libs/jquery.min.js :: Symlink to external target: [[file:themes/default/js/libs/jquery.min.js::*%20Dual%20licensed%20under%20the%20MIT%20or%20GPL%20Version%202%20licenses.][MIT/GPL2]] - themes/default/js/libs/modernizr.min.js :: Symlink to external target: MIT -- themes/default/js/libs/bootstrap/alert.js :: [[file:themes/default/js/libs/bootstrap/alert.js::*%20Licensed%20under%20the%20Apache%20License,%20Version%202.0%20(the%20"License")%3B][Apache License v2.0]] -- themes/default/js/libs/bootstrap/bootstrap.js :: [[file:themes/default/js/libs/bootstrap/bootstrap.js::*%20Licensed%20under%20the%20Apache%20License,%20Version%202.0%20(the%20"License")%3B][Apache License v2.0]] -- themes/default/js/libs/bootstrap/bootstrap.min.js :: - -- themes/default/js/libs/bootstrap/button.js :: [[file:themes/default/js/libs/bootstrap/button.js::*%20Licensed%20under%20the%20Apache%20License,%20Version%202.0%20(the%20"License")%3B][Apache License v2.0]] -- themes/default/js/libs/bootstrap/carousel.js :: [[file:themes/default/js/libs/bootstrap/carousel.js::*%20Licensed%20under%20the%20Apache%20License,%20Version%202.0%20(the%20"License")%3B][Apache License v2.0]] -- themes/default/js/libs/bootstrap/collapse.js :: [[file:themes/default/js/libs/bootstrap/collapse.js::*%20Licensed%20under%20the%20Apache%20License,%20Version%202.0%20(the%20"License")%3B][Apache License v2.0]] -- themes/default/js/libs/bootstrap/dropdown.js :: [[file:themes/default/js/libs/bootstrap/dropdown.js::*%20Licensed%20under%20the%20Apache%20License,%20Version%202.0%20(the%20"License")%3B][Apache License v2.0]] -- themes/default/js/libs/bootstrap/modal.js :: [[file:themes/default/js/libs/bootstrap/modal.js::*%20Licensed%20under%20the%20Apache%20License,%20Version%202.0%20(the%20"License")%3B][Apache License v2.0]] -- themes/default/js/libs/bootstrap/popover.js :: [[file:themes/default/js/libs/bootstrap/popover.js::*%20Licensed%20under%20the%20Apache%20License,%20Version%202.0%20(the%20"License")%3B][Apache License v2.0]] -- themes/default/js/libs/bootstrap/scrollspy.js :: [[file:themes/default/js/libs/bootstrap/scrollspy.js::*%20Licensed%20under%20the%20Apache%20License,%20Version%202.0%20(the%20"License")%3B][Apache License v2.0]] -- themes/default/js/libs/bootstrap/tab.js :: [[file:themes/default/js/libs/bootstrap/tab.js::*%20Licensed%20under%20the%20Apache%20License,%20Version%202.0%20(the%20"License")%3B][Apache License v2.0]] -- themes/default/js/libs/bootstrap/tooltip.js :: [[file:themes/default/js/libs/bootstrap/tooltip.js::*%20Licensed%20under%20the%20Apache%20License,%20Version%202.0%20(the%20"License")%3B][Apache License v2.0]] -- themes/default/js/libs/bootstrap/transition.js :: [[file:themes/default/js/libs/bootstrap/transition.js::*%20Licensed%20under%20the%20Apache%20License,%20Version%202.0%20(the%20"License")%3B][Apache License v2.0]] -- themes/default/js/libs/bootstrap/typeahead.js :: [[file:themes/default/js/libs/bootstrap/typeahead.js::*%20Licensed%20under%20the%20Apache%20License,%20Version%202.0%20(the%20"License")%3B][Apache License v2.0]] diff --git a/Makefile b/Makefile index a5a050b85..428c03780 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,5 @@ MAKE=make -CSS=$(wildcard *.css) -CSS=$(subst .tiny,,$(shell find themes -type f -name '*.css')) -COMPRESSED_CSS := $(patsubst %.css,%.tiny.css,$(CSS)) PWD=`pwd` # hosting variables @@ -13,11 +10,11 @@ DATADIR=/usr/share/plinth PYDIR=$(DATADIR)/python/plinth ## Catch-all targets -default: config dirs css docs +default: config dirs docs all: default predepend: - sudo sh -c "apt-get install augeas-tools libpython2.7 pandoc psmisc python2.7 python-augeas python-bcrypt python-bjsonrpc python-cherrypy3 python-django python-passlib python-simplejson python-bootstrapform sudo" + sudo sh -c "apt-get install augeas-tools libpython2.7 pandoc psmisc python2.7 python-augeas python-bcrypt python-bjsonrpc python-cherrypy3 python-django python-passlib python-simplejson python-bootstrapform libjs-twitter-bootstrap sudo" git submodule init git submodule update touch predepend @@ -54,10 +51,6 @@ dirs: config: Makefile @test -f plinth.config || cp plinth.sample.config plinth.config -%.tiny.css: %.css - @cat $< | python -c 'import re,sys;print re.sub("\s*([{};,:])\s*", "\\1", re.sub("/\*.*?\*/", "", re.sub("\s+", " ", sys.stdin.read())))' > $@ -css: $(COMPRESSED_CSS) - docs: @$(MAKE) -s -C doc doc: docs @@ -67,7 +60,6 @@ html: clean: @rm -f cherrypy.config data/cherrypy_sessions/* - @find themes -name "*.tiny.css" -exec rm {} \; @find . -name "*~" -exec rm {} \; @find . -name ".#*" -exec rm {} \; @find . -name "#*" -exec rm {} \; diff --git a/doc/style.css b/doc/style.css index 1d1829961..499266614 120000 --- a/doc/style.css +++ b/doc/style.css @@ -1 +1 @@ -../static/theme/style.css \ No newline at end of file +../static/theme/css/bootstrap.min.css \ No newline at end of file diff --git a/fabfile.py b/fabfile.py index 5a4633004..8844179be 100644 --- a/fabfile.py +++ b/fabfile.py @@ -150,7 +150,7 @@ def apache(): @task def deps(): "Basic plinth dependencies" - sudo('apt-get install --no-install-recommends -y python make pandoc python-simplejson python-pyme python-augeas python-bjsonrpc python-django python-bootstrapform') + sudo('apt-get install --no-install-recommends -y python make pandoc python-simplejson python-pyme python-augeas python-bjsonrpc python-django python-bootstrapform libjs-twitter-bootstrap') @task def update(): diff --git a/menu.py b/menu.py index 93860dcdb..84b26c19d 100644 --- a/menu.py +++ b/menu.py @@ -1,19 +1,16 @@ from urlparse import urlparse -try: - import simplejson as json -except ImportError: - import json import cherrypy import cfg + class Menu(): """One menu item.""" def __init__(self, label="", icon="", url="#", order=50): """label is the text that is displayed on the menu. - icon is the icon to be displayed next to the label. - Choose from the Glyphicon set: - http://twitter.github.com/bootstrap/base-css.html#icons + icon is the icon to be displayed next to the label. + Choose from the Glyphicon set: + http://twitter.github.com/bootstrap/base-css.html#icons url is the url location that will be activated when the menu item is selected. @@ -35,11 +32,13 @@ class Menu(): def sort_items(self): """Sort the items in self.items by order.""" self.items = sorted(self.items, key=lambda x: x.order, reverse=False) + def add_item(self, label, icon, url, order=50, basehref=True): """This method creates a menu item with the parameters, adds that menu item to this menu, and returns the item. - If BASEHREF is true and url start with a slash, prepend the cfg.server_dir to it""" + If BASEHREF is true and url start with a slash, prepend the + cfg.server_dir to it""" if basehref and url.startswith("/"): url = cfg.server_dir + url @@ -62,27 +61,3 @@ class Menu(): for item in self.items: if path.startswith(item.url): return item - - def serializable(self, render_subs=False): - """Return the items in self.items as a serializable object we can pass to json. - Note: this doesn't serialize all the data in this object.""" - - so = [] - for item in self.items: - i = { 'label':item.label, 'icon':item.icon, 'url':item.url} - if item.active_p(): - i['active']=True - if item.items and render_subs: - i['subs'] = item.serializable() - so.append(i) - return so - def encode(self, name="", render_subs=False): - """return a string containing a javascript data structure - assigned to the menu name - - if render_subs is True, we render submenus too""" - - return ('') diff --git a/modules/installed/router/templates/router_setup.html b/modules/installed/router/templates/router_setup.html index 34fd9c0ae..c484c5585 100644 --- a/modules/installed/router/templates/router_setup.html +++ b/modules/installed/router/templates/router_setup.html @@ -63,31 +63,36 @@ {% block sidebar_right_block %} -

Introduction

+ {% endblock %} diff --git a/modules/installed/system/templates/firewall.html b/modules/installed/system/templates/firewall.html index 5ef2fa972..19c165a46 100644 --- a/modules/installed/system/templates/firewall.html +++ b/modules/installed/system/templates/firewall.html @@ -43,35 +43,47 @@ firewalld'

{% else %} -