Changeset 12247 for main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Timestamp:
- 15 Dec 2014, 13:29:51 (10 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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>
Note: See TracChangeset for help on using the changeset viewer.