mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
Remove unnecessary layer of abstraction over template rendering
This commit is contained in:
1 parent
851536ffbe
commit
4b44741c68
23 files changed
+136
-105
No files matched your search
@@ -2,6 +2,8 @@ import cherrypy
|
||||
from modules.auth import require
|
||||
from plugin_mount import PagePlugin
|
||||
import cfg
|
||||
import util
|
||||
|
||||
|
||||
class Services(PagePlugin):
|
||||
order = 9 # order of running init in PagePlugins
|
||||
@@ -18,7 +20,8 @@ class Services(PagePlugin):
|
||||
@cherrypy.expose
|
||||
@require()
|
||||
def openid(self):
|
||||
return self.fill_template(title="Open ID", main='', sidebar_right="""
|
||||
return util.render_template(title="Open ID", main='',
|
||||
sidebar_right="""
|
||||
<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
|
||||
|
||||
@@ -6,7 +6,8 @@ import cfg
|
||||
from forms import Form
|
||||
import actions
|
||||
import service
|
||||
from util import Message
|
||||
import util
|
||||
|
||||
|
||||
class xmpp(PagePlugin):
|
||||
def __init__(self, *args, **kwargs):
|
||||
@@ -32,7 +33,7 @@ class xmpp(PagePlugin):
|
||||
main = "<p>XMPP Server Accounts and Configuration</p>"
|
||||
sidebar_right = '<strong><a href="'+cfg.server_dir+'/services/xmpp/configure">Configure XMPP Server</a></strong><br />'
|
||||
sidebar_right = sidebar_right + '<strong><a href="'+cfg.server_dir+'/services/xmpp/register">Register XMPP Account</a></strong>'
|
||||
return self.fill_template(title="XMPP Server", main=main, sidebar_right=sidebar_right)
|
||||
return util.render_template(title="XMPP Server", main=main, sidebar_right=sidebar_right)
|
||||
|
||||
class configure(FormPlugin, PagePlugin):
|
||||
url = ["/services/xmpp/configure"]
|
||||
@@ -78,7 +79,7 @@ class configure(FormPlugin, PagePlugin):
|
||||
actions.run("xmpp-setup", opts)
|
||||
|
||||
main = self.main(checkedinfo['inband_enable'])
|
||||
return self.fill_template(title="XMPP Server Configuration", main=main, sidebar_left=self.sidebar_left, sidebar_right=self.sidebar_right)
|
||||
return util.render_template(title="XMPP Server Configuration", main=main, sidebar_left=self.sidebar_left, sidebar_right=self.sidebar_right)
|
||||
|
||||
class register(FormPlugin, PagePlugin):
|
||||
url = ["/services/xmpp/register"]
|
||||
@@ -97,7 +98,7 @@ class register(FormPlugin, PagePlugin):
|
||||
return form.render()
|
||||
|
||||
def process_form(self, username=None, password=None, **kwargs):
|
||||
msg = Message()
|
||||
msg = util.Message()
|
||||
|
||||
if not username: msg.add = _("Must specify a username!")
|
||||
if not password: msg.add = _("Must specify a password!")
|
||||
@@ -115,7 +116,7 @@ class register(FormPlugin, PagePlugin):
|
||||
|
||||
cfg.log(msg.text)
|
||||
main = self.main(username, msg=msg.text)
|
||||
return self.fill_template(
|
||||
return util.render_template(
|
||||
title="XMPP Server Configuration",
|
||||
main=main,
|
||||
sidebar_left=self.sidebar_left,
|
||||
|
||||
Reference in new issue
Block a user