def render_viewSelector(self, context, data): args = inevow.IRequest(context).args view = args.get('view', ['view'])[0] if view == 'view': selector = "View | ", tags.a(href=here.add('view','edit'))[ "Edit" ] editor = '' else: selector = tags.a(href=here.add('view','view'))["View"], " | Edit" editor = context.onePattern('edit')() # get one copy of the edit pattern viewer = context.onePattern('view')() # get one copy of the view pattern return selector, viewer, editor
def render_viewSelector(self, context, data): args = inevow.IRequest(context).args view = args.get("view", ["view"])[0] if view == "view": selector = "View | ", tags.a(href=here.add("view", "edit"))["Edit"] editor = "" else: selector = tags.a(href=here.add("view", "view"))["View"], " | Edit" editor = context.onePattern("edit")() # get one copy of the edit pattern viewer = context.onePattern("view")() # get one copy of the view pattern return selector, viewer, editor
def genheaders(): for i, head in enumerate(headers): badge, description = head if currentView == description: klas = 'tab-selected' else: klas = 'tab' yield T.a(href=here.add('currentView', description))[ T.span(_class="%s" % klas)[ T.img(src="/images/%s.png" % badge, style="margin-right: 5px;"), description]]