give more space to labels in forms tls-sprint
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Tue, 21 Apr 2009 11:35:31 +0200
branchtls-sprint
changeset 1412 f3361e29d91f
parent 1409 f4dee84a618f
child 1414 448c9802d7df
give more space to labels in forms
web/data/cubicweb.form.css
web/formrenderers.py
--- a/web/data/cubicweb.form.css	Mon Apr 20 19:54:36 2009 +0200
+++ b/web/data/cubicweb.form.css	Tue Apr 21 11:35:31 2009 +0200
@@ -56,7 +56,8 @@
 table.attributeForm {
   border: 1px solid #E4EAD8;
   margin-bottom: 1em;
-  padding: 0.8em;
+  padding: 0.8em 1.2em;
+  width: 100%;
 }
 
 fieldset.subentity table td {
@@ -77,11 +78,12 @@
 
 table.attributeForm th,
 table.attributeForm td {
-  padding : 0px 2px;
+  padding : .7em 2px;
 }
 
 table.attributeForm th {
-  text-align: right;
+  text-align: left;
+  width: 12em;
 }
 
 table.attributeForm div#comfirmPsw {
@@ -100,7 +102,7 @@
 
 table.attributeForm label,
 .entityForm .label {
-  padding : 0.2em  10px 0.2em 0.4em;
+  padding : 0.2em  1em 0.2em 0;
 }
 
 table.attributeForm label.required {
--- a/web/formrenderers.py	Mon Apr 20 19:54:36 2009 +0200
+++ b/web/formrenderers.py	Tue Apr 21 11:35:31 2009 +0200
@@ -171,17 +171,17 @@
         return fields
     
     def _render_fields(self, fields, w, form):
-        w(u'<table class="attributeForm" style="width:100%;">')
+        w(u'<table class="attributeForm">')
         for field in fields:
             w(u'<tr>')
             if self.display_label:
                 w(u'<th class="labelCol">%s</th>' % self.render_label(form, field))
             error = form.form_field_error(field)
             if error:
-                w(u'<td class="error" style="width:100%;">')
+                w(u'<td class="error">')
                 w(error)
             else:
-                w(u'<td style="width:100%;">')
+                w(u'<td>')
             w(field.render(form, self))
             if self.display_help:
                 w(self.render_help(form, field))