mobile: only display formdefs marked with the 'mobile' keyword (#7121)

This commit is contained in:
Frédéric Péters 2015-04-30 21:12:21 +02:00
parent 553c0def5c
commit c8c673e8ef
1 changed files with 5 additions and 0 deletions

View File

@ -933,6 +933,11 @@ class AlternateRootDirectory(OldRootDirectory):
all_formdefs = FormDef.select(lambda x: not x.is_disabled() or x.disabled_redirection,
order_by = 'name')
if get_response().page_template_key == 'mobile':
# if we are in 'mobile' mode, and some formdefs have a 'mobile'
# keyword, we limit the display to those
if any((x for x in all_formdefs if x.keywords and 'mobile' in x.keywords)):
all_formdefs = [x for x in all_formdefs if x.keywords and 'mobile' in x.keywords]
if position:
t = self.display_list_of_formdefs(