From 577dbb4fc5769a488ecce1e22453b9af295d12a5 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 8 May 2014 10:44:53 +0530 Subject: [PATCH] Convert apps pages to templates --- modules/installed/apps/apps.py | 25 ++++---------------- modules/installed/apps/templates/apps.html | 13 ++++++++++ modules/installed/apps/templates/photos.html | 11 +++++++++ 3 files changed, 29 insertions(+), 20 deletions(-) create mode 100644 modules/installed/apps/templates/apps.html create mode 100644 modules/installed/apps/templates/photos.html diff --git a/modules/installed/apps/apps.py b/modules/installed/apps/apps.py index bf982f86f..43f8fcafd 100644 --- a/modules/installed/apps/apps.py +++ b/modules/installed/apps/apps.py @@ -2,7 +2,6 @@ import cherrypy from gettext import gettext as _ from modules.auth import require from plugin_mount import PagePlugin -from forms import Form import cfg import util @@ -12,30 +11,16 @@ class Apps(PagePlugin): PagePlugin.__init__(self, *args, **kwargs) self.register_page("apps") self.menu = cfg.main_menu.add_item("Apps", "icon-download-alt", "/apps", 80) - self.menu.add_item("Chat", "icon-comment", "/../jwchat", 30) + self.menu.add_item("Chat", "icon-comment", "/../jwchat", 30) self.menu.add_item("Photo Gallery", "icon-picture", "/apps/photos", 35) @cherrypy.expose def index(self): - main = """ -

User Applications are web apps hosted on your %s.

- -

Eventually this box could be your photo sharing site, your - instant messaging site, your social networking site, your news - site. Remember web portals? We can be one of those too. - Many of the services you use on the web could soon be on site - and under your control!

- """ % (cfg.product_name) - return util.render_template(title="User Applications", main=main) + return util.render_template(template='apps', + title=_('User Applications')) @cherrypy.expose @require() def photos(self): - return util.render_template(title="Photo Gallery", main='', - sidebar_right=""" -Photo Gallery

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 -some other websites business model.

-""") + return util.render_template(template='photos', + title=_('Photo Gallery')) diff --git a/modules/installed/apps/templates/apps.html b/modules/installed/apps/templates/apps.html new file mode 100644 index 000000000..49c750786 --- /dev/null +++ b/modules/installed/apps/templates/apps.html @@ -0,0 +1,13 @@ +{% extends 'login_nav.html' %} + +{% block main_block %} + +

User Applications are web apps hosted on your +{{ cfg.product_name }}.

+ +

Eventually this box could be your photo sharing site, your instant +messaging site, your social networking site, your news site. Remember +web portals? We can be one of those too. Many of the services you +use on the web could soon be on site and under your control!

+ +{% endblock %} diff --git a/modules/installed/apps/templates/photos.html b/modules/installed/apps/templates/photos.html new file mode 100644 index 000000000..d4f6fd280 --- /dev/null +++ b/modules/installed/apps/templates/photos.html @@ -0,0 +1,11 @@ +{% extends 'login_nav.html' %} + +{% block main_block %} + +

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 some other +websites business model.

+ +{% endblock %}