- Timestamp:
- 15 Dec 2014, 13:29:51 (10 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r12191 r12247 4 4 1.3dev (unreleased) 5 5 =================== 6 7 * Remove deprecated HTML and REST widgets and use html2dict instead. 6 8 7 9 * Do not import codes with spaces. -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r11874 r12247 34 34 IApplicantRegisterUpdate, ISpecialApplicant 35 35 ) 36 from waeup.kofa.utils.helpers import html2dict 36 37 from waeup.kofa.applicants.container import ( 37 38 ApplicantsContainer, VirtualApplicantsExportJobContainer) … … 60 61 FriendlyDateDisplayWidget, 61 62 FriendlyDatetimeDisplayWidget) 62 from waeup.kofa.widgets.htmlwidget import HTMLDisplayWidget63 63 64 64 grok.context(IKofaObject) # Make IKofaObject the default context … … 72 72 grok.require('waeup.Public') 73 73 form_fields = grok.AutoFields(IApplicantsRoot) 74 form_fields['description'].custom_widget = HTMLDisplayWidget75 74 label = _('Application Section') 76 75 pnav = 3 … … 189 188 return del_local_roles(self,3,**data) 190 189 191 def _description(self):192 view = ApplicantsRootPage(193 self.context,self.request)194 view.setUpWidgets()195 return view.widgets['description']()196 197 190 @action(_('Save'), style='primary') 198 191 def save(self, **data): 199 192 self.applyData(self.context, **data) 200 self.context.description_dict = self._description() 193 description = getattr(self.context, 'description', None) 194 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 195 self.context.description_dict = html2dict(description, portal_language) 201 196 self.flash(_('Form has been saved.')) 202 197 return … … 302 297 @property 303 298 def form_fields(self): 304 form_fields = grok.AutoFields(IApplicantsContainer).omit( 'title')305 form_fields['description'].custom_widget = HTMLDisplayWidget299 form_fields = grok.AutoFields(IApplicantsContainer).omit( 300 'title', 'description') 306 301 form_fields[ 307 302 'startdate'].custom_widget = FriendlyDatetimeDisplayWidget('le') … … 368 363 return get_users_with_local_roles(self.context) 369 364 370 def _description(self):371 view = ApplicantsContainerPage(372 self.context,self.request)373 view.setUpWidgets()374 return view.widgets['description']()375 376 365 @action(_('Save'), style='primary') 377 366 def save(self, **data): … … 381 370 else: 382 371 changed_fields = [] 383 self.context.description_dict = self._description() 372 description = getattr(self.context, 'description', None) 373 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 374 self.context.description_dict = html2dict(description, portal_language) 384 375 # Always refresh title. So we can change titles 385 376 # if APP_TYPES_DICT has been edited. -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicantscontainerpage.pt
r10101 r12247 2 2 <tbody> 3 3 <tal:block repeat="widget view/widgets"> 4 <tal:condition condition="python:widget.name != 'form.description'">5 4 <tr> 6 5 <td class="fieldname"> … … 11 10 </td> 12 11 </tr> 13 </tal:condition>14 12 </tal:block> 15 13 </tbody> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r12104 r12247 64 64 from waeup.kofa.utils.batching import VirtualExportJobContainer 65 65 from waeup.kofa.utils.helpers import get_current_principal, to_timezone, now 66 from waeup.kofa.widgets.restwidget import ReSTDisplayWidget67 66 from waeup.kofa.students.interfaces import ( 68 67 IStudentsContainer, IStudent,
Note: See TracChangeset for help on using the changeset viewer.