view.py
changeset 3890 d7a270f50f54
parent 3720 5376aaadd16b
parent 3839 84c9aab84d8c
child 3998 94cc7cad3d2d
equal deleted inserted replaced
3810:5b75fd66c80e 3890:d7a270f50f54
    32  "id          ID            #IMPLIED
    32  "id          ID            #IMPLIED
    33   class       CDATA         #IMPLIED
    33   class       CDATA         #IMPLIED
    34   style       CDATA         #IMPLIED
    34   style       CDATA         #IMPLIED
    35   title       CDATA         #IMPLIED
    35   title       CDATA         #IMPLIED
    36 
    36 
       
    37  cubicweb:accesskey         CDATA   #IMPLIED
       
    38  cubicweb:actualrql         CDATA   #IMPLIED
       
    39  cubicweb:dataurl           CDATA   #IMPLIED
       
    40  cubicweb:displayactions    CDATA   #IMPLIED
       
    41  cubicweb:facetName         CDATA   #IMPLIED
       
    42  cubicweb:facetargs         CDATA   #IMPLIED
       
    43  cubicweb:fallbackvid       CDATA   #IMPLIED
       
    44  cubicweb:fname             CDATA   #IMPLIED
       
    45  cubicweb:initfunc          CDATA   #IMPLIED
       
    46  cubicweb:inputid           CDATA   #IMPLIED
       
    47  cubicweb:inputname         CDATA   #IMPLIED
       
    48  cubicweb:limit             CDATA   #IMPLIED
       
    49  cubicweb:loadtype          CDATA   #IMPLIED
       
    50  cubicweb:loadurl           CDATA   #IMPLIED
       
    51  cubicweb:maxlength         CDATA   #IMPLIED
       
    52  cubicweb:required          CDATA   #IMPLIED
       
    53  cubicweb:rooteid           CDATA   #IMPLIED
       
    54  cubicweb:rql               CDATA   #IMPLIED
       
    55  cubicweb:size              CDATA   #IMPLIED
    37  cubicweb:sortvalue         CDATA   #IMPLIED
    56  cubicweb:sortvalue         CDATA   #IMPLIED
    38  cubicweb:target            CDATA   #IMPLIED
    57  cubicweb:target            CDATA   #IMPLIED
    39  cubicweb:limit             CDATA   #IMPLIED
    58  cubicweb:tindex            CDATA   #IMPLIED
       
    59  cubicweb:tlunit            CDATA   #IMPLIED
    40  cubicweb:type              CDATA   #IMPLIED
    60  cubicweb:type              CDATA   #IMPLIED
    41  cubicweb:loadtype          CDATA   #IMPLIED
    61  cubicweb:uselabel          CDATA   #IMPLIED
       
    62  cubicweb:value             CDATA   #IMPLIED
       
    63  cubicweb:variables         CDATA   #IMPLIED
       
    64  cubicweb:vid               CDATA   #IMPLIED
    42  cubicweb:wdgtype           CDATA   #IMPLIED
    65  cubicweb:wdgtype           CDATA   #IMPLIED
    43  cubicweb:initfunc          CDATA   #IMPLIED
       
    44  cubicweb:inputid           CDATA   #IMPLIED
       
    45  cubicweb:tindex            CDATA   #IMPLIED
       
    46  cubicweb:inputname         CDATA   #IMPLIED
       
    47  cubicweb:value             CDATA   #IMPLIED
       
    48  cubicweb:required          CDATA   #IMPLIED
       
    49  cubicweb:accesskey         CDATA   #IMPLIED
       
    50  cubicweb:maxlength         CDATA   #IMPLIED
       
    51  cubicweb:variables         CDATA   #IMPLIED
       
    52  cubicweb:displayactions    CDATA   #IMPLIED
       
    53  cubicweb:fallbackvid       CDATA   #IMPLIED
       
    54  cubicweb:fname             CDATA   #IMPLIED
       
    55  cubicweb:vid               CDATA   #IMPLIED
       
    56  cubicweb:rql               CDATA   #IMPLIED
       
    57  cubicweb:actualrql         CDATA   #IMPLIED
       
    58  cubicweb:rooteid           CDATA   #IMPLIED
       
    59  cubicweb:dataurl           CDATA   #IMPLIED
       
    60  cubicweb:size              CDATA   #IMPLIED
       
    61  cubicweb:tlunit            CDATA   #IMPLIED
       
    62  cubicweb:loadurl           CDATA   #IMPLIED
       
    63  cubicweb:uselabel          CDATA   #IMPLIED
       
    64  cubicweb:facetargs         CDATA   #IMPLIED
       
    65  cubicweb:facetName         CDATA   #IMPLIED
       
    66   "> ] '''
    66   "> ] '''
    67 
    67 
    68 TRANSITIONAL_DOCTYPE = u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" %s>\n' % CW_XHTML_EXTENSIONS
    68 TRANSITIONAL_DOCTYPE = u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" %s>\n' % CW_XHTML_EXTENSIONS
    69 TRANSITIONAL_DOCTYPE_NOEXT = u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n'
    69 TRANSITIONAL_DOCTYPE_NOEXT = u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n'
    70 STRICT_DOCTYPE = u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" %s>\n' % CW_XHTML_EXTENSIONS
    70 STRICT_DOCTYPE = u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" %s>\n' % CW_XHTML_EXTENSIONS
   303         self.w('\n document.window.href=url;\n')
   303         self.w('\n document.window.href=url;\n')
   304         self.w('}\n-->\n</script>\n')
   304         self.w('}\n-->\n</script>\n')
   305 
   305 
   306     def create_url(self, etype, **kwargs):
   306     def create_url(self, etype, **kwargs):
   307         """ return the url of the entity creation form for a given entity type"""
   307         """ return the url of the entity creation form for a given entity type"""
   308         return self._cw.build_url('add/%s'%etype, **kwargs)
   308         return self._cw.build_url('add/%s' % etype, **kwargs)
   309 
   309 
   310     def field(self, label, value, row=True, show_label=True, w=None, tr=True):
   310     def field(self, label, value, row=True, show_label=True, w=None, tr=True, table=False):
   311         """ read-only field """
   311         """read-only field"""
   312         if w is None:
   312         if w is None:
   313             w = self.w
   313             w = self.w
   314         if row:
   314         if table:
   315             w(u'<div class="row">')
   315             w(u'<tr class="entityfield">')
       
   316         else:
       
   317             w(u'<div class="entityfield">')
   316         if show_label and label:
   318         if show_label and label:
   317             if tr:
   319             if tr:
   318                 label = display_name(self._cw, label)
   320                 label = display_name(self._cw, label)
   319             w(u'<span class="label">%s</span>' % label)
   321             if table:
   320         w(u'<div class="field">%s</div>' % value)
   322                 w(u'<th>%s</th>' % label)
   321         if row:
   323             else:
   322             w(u'</div>')
   324                 w(u'<span>%s</span> ' % label)
       
   325         if table:
       
   326             w(u'<td>%s</td></tr>' % value)
       
   327         else:
       
   328             w(u'<span>%s</span></div>' % value)
   323 
   329 
   324 
   330 
   325 
   331 
   326 # concrete views base classes #################################################
   332 # concrete views base classes #################################################
   327 
   333