add support for locked site

This commit is contained in:
Frédéric Péters 2011-04-21 13:24:57 +02:00
parent 913182d31d
commit 7761922bdf
2 changed files with 12 additions and 0 deletions

View File

@ -89,3 +89,6 @@ def can_logo():
def can_theme():
return get_boolean_quota('x-asec-can-theme')
def is_locked():
return get_boolean_quota('x-asec-locked')

View File

@ -79,6 +79,8 @@ class RootDirectory(wcs.root.RootDirectory):
if not hasattr(response, 'breadcrumb'):
response.breadcrumb = [ ('', _('Home')) ]
response.filter['logo_url'] = boconfig.get_logo_url()
if quota.is_locked() and (len(path) == 0 or not path[0] in ['themes', 'robots.txt']):
return TextsDirectory.get_html_text('asec-locked-site')
return Directory._q_traverse(self, path)
def _q_index [html] (self):
@ -139,4 +141,11 @@ Welcome on your new site. It is currently empty, you should go to the
</p>
'''))
TextsDirectory.register('asec-locked-site',
N_('Text displayed when the site is locked'),
default=N_('''<p>
This site has been locked.
</p>
'''))