remove option to include user details on all pages (#4717)

This is best left to the template and with user variables they can now do that
kind of thing without any special support.
This commit is contained in:
Frédéric Péters 2014-04-18 15:39:23 +02:00
parent d404c21546
commit ae63a0a450
3 changed files with 4 additions and 17 deletions

View File

@ -9,7 +9,6 @@
<div id="page">
<div id="top"> <h1>[if-any title][title][else][site_name][end]</h1> </div>
<div id="main-content">
[prelude]
[if-any breadcrumb]<p id="breadcrumb">Vous &ecirc;tes ici : [breadcrumb]</p>[end]
[body]
</div>

View File

@ -593,9 +593,6 @@ class SettingsDirectory(QommonSettingsDirectory):
form.add(CheckboxWidget, 'do-not-token',
title = _('Do not show anything about identification tokens'),
value = misc_cfg.get('do-not-token', False))
form.add(CheckboxWidget, 'include-user-details',
title = _('Show user details on public pages'),
value = misc_cfg.get('include-user-details', False))
form.add(WidgetDict, 'namespaces',
title = _('Namespaces for prefilling'),
value = misc_cfg.get('namespaces', {}))
@ -612,7 +609,7 @@ class SettingsDirectory(QommonSettingsDirectory):
r += form.render()
return r.getvalue()
else:
cfg_submit(form, 'misc', ('do-not-token', 'include-user-details','namespaces'))
cfg_submit(form, 'misc', ('do-not-token', 'namespaces'))
return redirect('.')
def export(self):

View File

@ -133,7 +133,6 @@ DEFAULT_TEMPLATE_EZT = """<!DOCTYPE html>
<div id="page">
<div id="top"> <h1>[if-any title][title][else][site_name][end]</h1> </div>
<div id="main-content">
[prelude]
[if-any breadcrumb]<p id="breadcrumb">[breadcrumb]</p>[end]
[body]
</div>
@ -151,7 +150,6 @@ DEFAULT_IFRAME_EZT = """<!DOCTYPE html>
</head>
<body[if-any onload] onload="[onload]"[end]>
<div id="main-content">
[prelude]
[if-any breadcrumb]<p id="breadcrumb">[breadcrumb]</p>[end]
[body]
</div>
@ -312,7 +310,6 @@ def decorate(body, response):
current_theme = get_cfg('branding', {}).get('theme', get_publisher().default_theme)
include_user = get_cfg('misc', {}).get('include-user-details', False)
if kwargs.get('title'):
title = kwargs.get('title')
page_title = '%s - %s' % (site_name, title)
@ -364,16 +361,10 @@ def decorate(body, response):
else:
css = root_url + 'themes/%s/%s.css' % (current_theme, get_publisher().APP_NAME)
# this variable is kept in locals() as it was once part of the default
# template and existing installations may have template changes that
# still have it.
prelude = ''
if include_user and not kwargs.get('force_ignore_user'):
session = get_session()
if session and session.user and not str(session.user).startswith(str('anonymous-')):
try:
user = get_publisher().user_class.get(session.user)
except (KeyError, ValueError):
pass
else:
prelude = '<p id="prelude">%s</p>' % (_('Logged in as %s.') % user.name)
template_ezt = get_cfg('branding', {}).get('template')
if response.page_template_key or not template_ezt: