def render_options(self, depth=0): r = TemplateIO(html=True) if self.options: pfx = ' '*depth r += H('%s<span class="options">\n') % pfx for url,link,title,selected,extra in self.options: t = title and (H('title="%s"') % title) or '' if extra is None: extra = {} r += H('%(pfx)s <a %(title)s class="%(sel)s" href="%(url)s" %(extra)s>%(link)s</a>\n') % { 'pfx': pfx, 'title': t, 'sel': selected and 'selected' or '', 'url': url, 'link': link, 'extra': page.join_extra(extra) } r += H('%s</span>\n') % pfx return r.getvalue()
def search_kw_link(self, kw, d=None, extra=None): if extra: extra = page.join_extra(extra) return H('<a %s href="%s">%s</a>') % (extra or '', self.kw.path([ kw ], d), kw)