From ef7da7527d959311b2525358608374e7e57a9657 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 8 May 2014 11:04:43 +0530 Subject: [PATCH] Convert sharing pages to templates --- modules/installed/sharing/sharing.py | 21 ++++--------------- .../installed/sharing/templates/sharing.html | 15 +++++++++++++ .../sharing/templates/sharing_printer.html | 19 +++++++++++++++++ 3 files changed, 38 insertions(+), 17 deletions(-) create mode 100644 modules/installed/sharing/templates/sharing.html create mode 100644 modules/installed/sharing/templates/sharing_printer.html diff --git a/modules/installed/sharing/sharing.py b/modules/installed/sharing/sharing.py index 675c3412a..81e004c20 100644 --- a/modules/installed/sharing/sharing.py +++ b/modules/installed/sharing/sharing.py @@ -26,14 +26,9 @@ class Sharing(PagePlugin): @cherrypy.expose @require() def files(self): - return util.render_template(title="File Server", main='', - sidebar_right=_(""" -Freedom NAS

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. + return util.render_template(template='sharing', + title=_('File Server')) -TODO: this is not true. We currently support no sharing.

-""" % cfg.box_name)) #TODO: move PrinterSharing to another file, as it should be an optional module (most people don't care about printer sharing) class PrinterSharing(PagePlugin): @@ -45,13 +40,5 @@ class PrinterSharing(PagePlugin): @cherrypy.expose @require() def index(self): - main = """ -

TODO: Setup and install SAMBA

-

TODO: Setup and install CUPS

-""" - return util.render_template(title="Printer Sharing", main=main, - sidebar_right=""" -Share Your Printer

The %s can share your printer via Samba and CUPS.

-""" % cfg.box_name) - - + return util.render_template(template='sharing_printer', + title=_('Printer Sharing')) diff --git a/modules/installed/sharing/templates/sharing.html b/modules/installed/sharing/templates/sharing.html new file mode 100644 index 000000000..92b01cfd7 --- /dev/null +++ b/modules/installed/sharing/templates/sharing.html @@ -0,0 +1,15 @@ +{% extends "login_nav.html" %} + +{% block sidebar_right_block %} + + + +{% endblock %} diff --git a/modules/installed/sharing/templates/sharing_printer.html b/modules/installed/sharing/templates/sharing_printer.html new file mode 100644 index 000000000..3c6c4bd6d --- /dev/null +++ b/modules/installed/sharing/templates/sharing_printer.html @@ -0,0 +1,19 @@ +{% extends "login_nav.html" %} + +{% block main_block %} + +

TODO: Setup and install SAMBA

+

TODO: Setup and install CUPS

+ +{% endblock %} + +{% block sidebar_right_block %} + + + +{% endblock %}