def _get_menu_items(self): entries = menu_entries_for_event(self.event) visible_entries = [e for e in itertools.chain(entries, *(e.children for e in entries)) if e.is_visible] for entry in visible_entries: if entry.type == MenuEntryType.page: self._get_custom_page(entry.page) elif entry.type == MenuEntryType.internal_link: self._get_builtin_page(entry)
def _get_layout_params(self): bg_color = layout_settings.get(self.event, 'header_background_color').replace('#', '').lower() text_color = layout_settings.get(self.event, 'header_text_color').replace('#', '').lower() announcement = '' if layout_settings.get(self.event, 'show_announcement'): announcement = layout_settings.get(self.event, 'announcement') return { 'menu': menu_entries_for_event(self.event), 'active_menu_item': self.sidemenu_option, 'bg_color_css': 'background: #{0}; border-color: #{0};'.format(bg_color) if bg_color else '', 'text_color_css': 'color: #{};'.format(text_color) if text_color else '', 'announcement': announcement }
def _process(self): custom_menu_enabled = layout_settings.get(self._conf, 'use_custom_menu') menu = menu_entries_for_event(self._conf) if custom_menu_enabled else None return WPMenuEdit.render_template('menu_edit.html', self._conf, event=self._conf, MenuEntryType=MenuEntryType, menu=menu, custom_menu_enabled=custom_menu_enabled)
def _render_menu_entries(event, connect_menu=False): tpl = get_template_module('events/layout/_menu.html') return tpl.menu_entries(menu_entries_for_event(event), connect_menu=connect_menu)