merge tls-sprint
authorsylvain.thenault@logilab.fr
Wed, 13 May 2009 17:01:42 +0200
branchtls-sprint
changeset 1796 2cb2c96c82d9
parent 1792 9eadf34fd860 (current diff)
parent 1795 abffc24f93c5 (diff)
child 1797 c2a80130b06d
merge
--- a/web/formfields.py	Wed May 13 17:01:25 2009 +0200
+++ b/web/formfields.py	Wed May 13 17:01:42 2009 +0200
@@ -247,6 +247,8 @@
     def render(self, form, renderer):
         format_field = self.get_format_field(form)
         if format_field:
+            # XXX we want both fields to remain vertically aligned
+            format_field.widget.attrs['style'] = 'display: block'
             result = format_field.render(form, renderer)
         else:
             result = u''
--- a/web/test/unittest_form.py	Wed May 13 17:01:25 2009 +0200
+++ b/web/test/unittest_form.py	Wed May 13 17:01:42 2009 +0200
@@ -109,7 +109,7 @@
 
     def test_richtextfield_1(self):
         self.req.use_fckeditor = lambda: False
-        self._test_richtextfield('''<select id="description_format:%(eid)s" name="description_format:%(eid)s" size="1" tabindex="0">
+        self._test_richtextfield('''<select id="description_format:%(eid)s" name="description_format:%(eid)s" size="1" style="display: block" tabindex="0">
 <option value="text/cubicweb-page-template">text/cubicweb-page-template</option>
 <option value="text/html">text/html</option>
 <option value="text/plain">text/plain</option>
@@ -119,7 +119,7 @@
 
     def test_richtextfield_2(self):
         self.req.use_fckeditor = lambda: True
-        self._test_richtextfield('<input name="description_format:%(eid)s" type="hidden" value="text/rest"/><textarea cols="80" cubicweb:type="wysiwyg" id="description:%(eid)s" name="description:%(eid)s" onkeypress="autogrow(this)" rows="20" tabindex="0"/>')
+        self._test_richtextfield('<input name="description_format:%(eid)s" style="display: block" type="hidden" value="text/rest"/><textarea cols="80" cubicweb:type="wysiwyg" id="description:%(eid)s" name="description:%(eid)s" onkeypress="autogrow(this)" rows="20" tabindex="0"/>')
 
 
     def test_filefield(self):
--- a/web/views/basecontrollers.py	Wed May 13 17:01:25 2009 +0200
+++ b/web/views/basecontrollers.py	Wed May 13 17:01:42 2009 +0200
@@ -399,7 +399,8 @@
             rset = self.req.execute('Any X,N WHERE X eid %%(x)s, X %s N' % rtype,
                                     {'x': eid}, 'x')
             entity = rset.get_entity(0, 0)
-            return (success, args, entity.printable_value(rtype))
+            value = entity.printable_value(rtype)
+            return (success, args, value or self.req._('not specified'))
         else:
             return (success, args, None)