Example #1
0
 def layout_fields(self): 
     section_name = self.section_spec[0]
     section_id = self.section_spec[1]
     link_id = "%s_display" % section_id
     self.add(div(
         attr(style="text-align: right; padding-right: 1em;"),
         a(
             "hide", 
             attr(href="JavaScript:void();"), 
             onclick="show_hide('%s', '%s');" % (section_id, link_id),
             id=link_id)))
     self.add(table(tagid("table"), id=section_id))
     self.add(legend(section_name))
     fields_in_section = self.get_fields()
     hidden_fields = []
     for field in fields_in_section:
         if field.is_hidden:
             hidden_fields.append(field)
             continue
         label_str = self.get_label_name(field)
         errors = self.form.errors.get(field.name_orig, None)
         self.table.add(tr(
             td(label_str),
             td(errors, field)))
     self.add(hidden_fields)
Example #2
0
 def layout_fields(self): 
     self.add(table(tagid("table")))
     self.add(legend(self.section_spec[0]))
     fields_in_section = self.get_fields()
     hidden_fields = []
     for field in fields_in_section:
         if field.is_hidden:
             hidden_fields.append(field)
             continue
         label_str = self.get_label_name(field)
         errors = self.form.errors.get(field.name_orig, None)
         self.table.add(tr(
             td(label_str),
             td(errors, field)))
     self.add(hidden_fields)
Example #3
0
 def layout_start(self):
     section_name = self.section_spec[0]
     section_id = self.section_spec[1]
     link_id = "%s_display" % section_id
     if section_name:
         self.add(legend(section_name))
     self.add(div(
         attr(style="text-align: right; padding-right: 1em;"),
         a(
             "hide", 
             attr(href="JavaScript:void();"), 
             onclick="show_hide('%s', '%s');" % (section_id, link_id),
             id=link_id, 
             title="Click to show or hide the fieldset contents.")))
     self.add(table(
         tagid('table'), attr(cssc="form_table"), id=section_id))
Example #4
0
 def layout_start(self):
     section_name = self.section_spec[0]
     if section_name:
         self.add(legend(section_name))
     self.add(table(tagid('table'), attr(cssc="form_table")))