diff -r 01f5001304b2 -r 59552ba2015f common/tags.py --- a/common/tags.py Tue Feb 24 17:20:04 2009 +0100 +++ b/common/tags.py Fri Feb 27 16:16:33 2009 +0100 @@ -1,5 +1,13 @@ -from logilab.mtconverter import html_escape +"""helper classes to generate simple (X)HTML tags + +:organization: Logilab +:copyright: 2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr +""" +__docformat__ = "restructuredtext en" + from cubicweb.common.uilib import simple_sgml_tag + class tag(object): def __init__(self, name): self.name = name @@ -14,6 +22,11 @@ img = tag('img') label = tag('label') option = tag('option') +h1 = tag('h1') +h2 = tag('h2') +h3 = tag('h3') +h4 = tag('h4') +h5 = tag('h5') def select(name, id=None, multiple=False, options=[]): attrs = {} @@ -21,8 +34,8 @@ attrs['multiple'] = 'multiple' if id: attrs['id'] = id - html = [u'' % ( + name, ' '.join('%s="%s"' % kv for kv in attrs.items()))] html += options html.append(u'') return u'\n'.join(html)