143 self._test_richtextfield('''<select id="description_format:%(eid)s" name="description_format:%(eid)s" size="1" style="display: block" tabindex="0"> |
143 self._test_richtextfield('''<select id="description_format:%(eid)s" name="description_format:%(eid)s" size="1" style="display: block" tabindex="0"> |
144 <option value="text/cubicweb-page-template">text/cubicweb-page-template</option> |
144 <option value="text/cubicweb-page-template">text/cubicweb-page-template</option> |
145 <option value="text/html">text/html</option> |
145 <option value="text/html">text/html</option> |
146 <option value="text/plain">text/plain</option> |
146 <option value="text/plain">text/plain</option> |
147 <option selected="selected" value="text/rest">text/rest</option> |
147 <option selected="selected" value="text/rest">text/rest</option> |
148 </select><textarea cols="60" id="description:%(eid)s" name="description:%(eid)s" onkeypress="autogrow(this)" rows="5" tabindex="1"/>''') |
148 </select><textarea cols="60" id="description:%(eid)s" name="description:%(eid)s" onkeyup="autogrow(this)" rows="5" tabindex="1"/>''') |
149 |
149 |
150 |
150 |
151 def test_richtextfield_2(self): |
151 def test_richtextfield_2(self): |
152 self.req.use_fckeditor = lambda: True |
152 self.req.use_fckeditor = lambda: True |
153 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"/>') |
153 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" onkeyup="autogrow(this)" rows="20" tabindex="0"/>') |
154 |
154 |
155 |
155 |
156 def test_filefield(self): |
156 def test_filefield(self): |
157 class FFForm(EntityFieldsForm): |
157 class FFForm(EntityFieldsForm): |
158 data = FileField(format_field=StringField(name='data_format', max_length=50), |
158 data = FileField(format_field=StringField(name='data_format', max_length=50), |
193 </div> |
193 </div> |
194 <br/> |
194 <br/> |
195 <input name="data:%(eid)s__detach" type="checkbox"/> |
195 <input name="data:%(eid)s__detach" type="checkbox"/> |
196 detach attached file |
196 detach attached file |
197 <p><b>You can either submit a new file using the browse button above, or choose to remove already uploaded file by checking the "detach attached file" check-box, or edit file content online with the widget below.</b></p> |
197 <p><b>You can either submit a new file using the browse button above, or choose to remove already uploaded file by checking the "detach attached file" check-box, or edit file content online with the widget below.</b></p> |
198 <textarea cols="80" name="data:%(eid)s" onkeypress="autogrow(this)" rows="20" tabindex="3">new widgets system</textarea>''' % {'eid': file.eid}) |
198 <textarea cols="80" name="data:%(eid)s" onkeyup="autogrow(this)" rows="20" tabindex="3">new widgets system</textarea>''' % {'eid': file.eid}) |
199 |
199 |
200 |
200 |
201 def test_passwordfield(self): |
201 def test_passwordfield(self): |
202 class PFForm(EntityFieldsForm): |
202 class PFForm(EntityFieldsForm): |
203 upassword = StringField(widget=PasswordInput) |
203 upassword = StringField(widget=PasswordInput) |