Remove unnecessary layer of abstraction over template rendering

This commit is contained in:
Sunil Mohan Adapa committed 2014-05-05 00:08:58 +05:30
1 parent 851536ffbe
commit 4b44741c68
23 files changed
+136 -105

No files matched your search

+4 -1
View File
@@ -2,6 +2,8 @@ import cherrypy
from modules.auth import require
from plugin_mount import PagePlugin
import cfg
import util
class FileExplorer(PagePlugin):
def __init__(self, *args, **kwargs):
@@ -32,4 +34,5 @@ href="http://blogfreakz.com/jquery/web-based-filemanager/">FileManager</a>.
It appears to be mostly javascript with some bindings to make it
python-friendly.</p>
"""
return self.fill_template(title="File Explorer", main=main, sidebar_right='')
return util.render_template(title="File Explorer", main=main,
sidebar_right='')
+6 -2
View File
@@ -3,6 +3,8 @@ from gettext import gettext as _
from modules.auth import require
from plugin_mount import PagePlugin
import cfg
import util
class Sharing(PagePlugin):
order = 9 # order of running init in PagePlugins
@@ -24,7 +26,8 @@ class Sharing(PagePlugin):
@cherrypy.expose
@require()
def files(self):
return self.fill_template(title="File Server", main='', sidebar_right=_("""
return util.render_template(title="File Server", main='',
sidebar_right=_("""
<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.
@@ -46,7 +49,8 @@ class PrinterSharing(PagePlugin):
<p>TODO: Setup and install SAMBA</p>
<p>TODO: Setup and install CUPS</p>
"""
return self.fill_template(title="Printer Sharing", main=main, sidebar_right="""
return util.render_template(title="Printer Sharing", main=main,
sidebar_right="""
<strong>Share Your Printer</strong><p> The %s can share your printer via Samba and CUPS.</p>
""" % cfg.box_name)