154 self._test_richtextfield('''<select id="description_format:%(eid)s" name="description_format:%(eid)s" size="1" style="display: block" tabindex="0"> |
154 self._test_richtextfield('''<select id="description_format:%(eid)s" name="description_format:%(eid)s" size="1" style="display: block" tabindex="0"> |
155 <option value="text/cubicweb-page-template">text/cubicweb-page-template</option> |
155 <option value="text/cubicweb-page-template">text/cubicweb-page-template</option> |
156 <option value="text/html">text/html</option> |
156 <option value="text/html">text/html</option> |
157 <option value="text/plain">text/plain</option> |
157 <option value="text/plain">text/plain</option> |
158 <option selected="selected" value="text/rest">text/rest</option> |
158 <option selected="selected" value="text/rest">text/rest</option> |
159 </select><textarea cols="80" id="description:%(eid)s" name="description:%(eid)s" onkeyup="autogrow(this)" rows="20" tabindex="1"/>''') |
159 </select><textarea cols="80" id="description:%(eid)s" name="description:%(eid)s" onkeyup="autogrow(this)" rows="2" tabindex="1"/>''') |
160 |
160 |
161 |
161 |
162 def test_richtextfield_2(self): |
162 def test_richtextfield_2(self): |
163 self.req.use_fckeditor = lambda: True |
163 self.req.use_fckeditor = lambda: True |
164 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"/>') |
164 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="2" tabindex="0"/>') |
165 |
165 |
166 |
166 |
167 def test_filefield(self): |
167 def test_filefield(self): |
168 class FFForm(EntityFieldsForm): |
168 class FFForm(EntityFieldsForm): |
169 data = FileField(format_field=StringField(name='data_format', max_length=50), |
169 data = FileField(format_field=StringField(name='data_format', max_length=50), |
204 </div> |
204 </div> |
205 <br/> |
205 <br/> |
206 <input name="data:%(eid)s__detach" type="checkbox"/> |
206 <input name="data:%(eid)s__detach" type="checkbox"/> |
207 detach attached file |
207 detach attached file |
208 <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> |
208 <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> |
209 <textarea cols="80" name="data:%(eid)s" onkeyup="autogrow(this)" rows="20" tabindex="3">new widgets system</textarea>''' % {'eid': file.eid}) |
209 <textarea cols="80" name="data:%(eid)s" onkeyup="autogrow(this)" rows="3" tabindex="3">new widgets system</textarea>''' % {'eid': file.eid}) |
210 |
210 |
211 |
211 |
212 def test_passwordfield(self): |
212 def test_passwordfield(self): |
213 class PFForm(EntityFieldsForm): |
213 class PFForm(EntityFieldsForm): |
214 upassword = StringField(widget=PasswordInput) |
214 upassword = StringField(widget=PasswordInput) |