Changeset 7708 for main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Timestamp:
- 27 Feb 2012, 11:52:23 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r7687 r7708 147 147 148 148 form_fields = grok.AutoFields( 149 IApplicantsContainerAdd).omit('code').omit('title' )149 IApplicantsContainerAdd).omit('code').omit('title', 'description_dict') 150 150 form_fields['startdate'].custom_widget = FriendlyDateWidget('le') 151 151 form_fields['enddate'].custom_widget = FriendlyDateWidget('le') … … 222 222 pnav = 3 223 223 224 form_fields = grok.AutoFields(IApplicantsContainer).omit('title') 224 form_fields = grok.AutoFields(IApplicantsContainer).omit( 225 'title', 'description_dict') 225 226 form_fields['startdate'].custom_widget = FriendlyDateDisplayWidget('le') 226 227 form_fields['enddate'].custom_widget = FriendlyDateDisplayWidget('le') 227 228 form_fields['description'].custom_widget = ReSTDisplayWidget 229 230 @property 231 def introduction(self): 232 portal_language = getUtility(ISIRPUtils).PORTAL_LANGUAGE 233 lang = self.request.cookies.get('sirp.language', portal_language) 234 html = self.context.description_dict.get(lang,'') 235 if html =='': 236 html = self.context.description_dict.get(portal_language,'') 237 if html =='': 238 return '' 239 else: 240 return html 228 241 229 242 @property … … 235 248 grok.name('manage') 236 249 grok.template('applicantscontainermanagepage') 237 form_fields = grok.AutoFields(IApplicantsContainer).omit('title') 250 form_fields = grok.AutoFields(IApplicantsContainer).omit( 251 'title', 'description_dict') 238 252 taboneactions = ['Save','Cancel'] 239 253 tabtwoactions = ['Add applicant', 'Remove selected','Cancel'] … … 277 291 return get_users_with_local_roles(self.context) 278 292 293 def _description(self): 294 view = ApplicantsContainerPage( 295 self.context,self.request) 296 view.setUpWidgets() 297 return view.widgets['description']() 298 279 299 @action('Save', style='primary') 280 300 def save(self, **data): 281 301 self.applyData(self.context, **data) 302 self.context.description_dict = self._description() 282 303 self.flash('Form has been saved.') 283 304 return -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/applicantscontainerpage.pt
r7477 r7708 1 <span tal:replace="structure view/widgets/description">Description</span> 2 3 <br /> 1 <span tal:condition="view/introduction" tal:omit-tag=""> 2 <span tal:content="structure view/introduction">INTRODUCTION</span> 3 <br /> 4 </span> 4 5 5 6 <table class="form-table" tal:condition="layout/isAuthenticated"> -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py
r7688 r7708 32 32 from waeup.sirp.interfaces import ( 33 33 ISIRPObject, year_range, validate_email, academic_sessions_vocab) 34 from waeup.sirp.interfaces import MessageFactory as _ 34 35 from waeup.sirp.university.vocabularies import ( 35 36 course_levels, AppCatSource) … … 194 195 195 196 code = schema.TextLine( 196 title = u'Code',197 title = _(u'Code'), 197 198 default = u'-', 198 199 required = True, … … 201 202 202 203 title = schema.TextLine( 203 title = u'Title',204 title = _(u'Title'), 204 205 required = True, 205 206 default = u'-', … … 208 209 209 210 prefix = schema.Choice( 210 title = u'Application Target',211 title = _(u'Application Target'), 211 212 required = True, 212 213 default = None, … … 216 217 217 218 entry_level = schema.Choice( 218 title = u'Entry Level',219 title = _(u'Entry Level'), 219 220 vocabulary = course_levels, 220 221 default = 100, … … 223 224 224 225 year = schema.Choice( 225 title = u'Year of Entrance',226 title = _(u'Year of Entrance'), 226 227 required = True, 227 228 default = None, … … 231 232 232 233 provider = schema.Choice( 233 title = u'Applicants Container Type',234 title = _(u'Applicants Container Type'), 234 235 required = True, 235 236 default = None, … … 247 248 248 249 application_category = schema.Choice( 249 title = u'Category for the grouping of certificates',250 title = _(u'Category for the grouping of certificates'), 250 251 required = True, 251 252 default = None, … … 254 255 255 256 description = schema.Text( 256 title = u'Human readable description in reST format',257 title = _(u'Human readable description in reST format'), 257 258 required = False, 258 259 default = u'''This text can been seen by anonymous users. 259 Here we put information about the study courses provided, the application procedure and deadlines.''' 260 Here we put mult-lingual information about the study courses provided, the application procedure and deadlines. 261 >>de<< 262 Dieser Text kann von anonymen Benutzern gelesen werden. 263 Hier koennen mehrsprachige Informationen fuer Antragsteller hinterlegt werden.''' 264 ) 265 266 description_dict = schema.Dict( 267 title = u'Content as language dictionary with values in html format', 268 required = False, 269 default = {}, 260 270 ) 261 271 262 272 startdate = schema.Date( 263 title = u'Application Start Date',273 title = _(u'Application Start Date'), 264 274 required = False, 265 275 default = None, … … 267 277 268 278 enddate = schema.Date( 269 title = u'Application Closing Date',279 title = _(u'Application Closing Date'), 270 280 required = False, 271 281 default = None, … … 273 283 274 284 strict_deadline = schema.Bool( 275 title = u'Forbid additions after deadline (enddate)',285 title = _(u'Forbid additions after deadline (enddate)'), 276 286 required = True, 277 287 default = True, … … 312 322 """ 313 323 prefix = schema.Choice( 314 title = u'Application Target',324 title = _(u'Application Target'), 315 325 required = True, 316 326 default = None, … … 320 330 321 331 year = schema.Choice( 322 title = u'Year of Entrance',332 title = _(u'Year of Entrance'), 323 333 required = True, 324 334 default = None, … … 328 338 329 339 provider = schema.Choice( 330 title = u'Applicants Container Type',340 title = _(u'Applicants Container Type'), 331 341 required = True, 332 342 default = None, … … 356 366 357 367 applicant_id = schema.TextLine( 358 title = u'Applicant Id',368 title = _(u'Applicant Id'), 359 369 required = False, 360 370 readonly = False, 361 371 ) 362 372 reg_number = TextLineChoice( 363 title = u'JAMB Registration Number',373 title = _(u'JAMB Registration Number'), 364 374 readonly = False, 365 375 required = True, … … 373 383 # ) 374 384 firstname = schema.TextLine( 375 title = u'First Name',385 title = _(u'First Name'), 376 386 required = True, 377 387 ) 378 388 middlename = schema.TextLine( 379 title = u'Middle Name',389 title = _(u'Middle Name'), 380 390 required = False, 381 391 ) 382 392 lastname = schema.TextLine( 383 title = u'Last Name (Surname)',393 title = _(u'Last Name (Surname)'), 384 394 required = True, 385 395 ) 386 396 date_of_birth = schema.Date( 387 title = u'Date of Birth',397 title = _(u'Date of Birth'), 388 398 required = True, 389 399 ) 390 400 lga = schema.Choice( 391 401 source = lgas_vocab, 392 title = u'State/LGA',402 title = _(u'State/LGA'), 393 403 default = 'foreigner', 394 404 required = True, 395 405 ) 396 406 sex = schema.Choice( 397 title = u'Sex',407 title = _(u'Sex'), 398 408 source = GenderSource(), 399 409 default = u'm', … … 401 411 ) 402 412 email = schema.ASCIILine( 403 title = u'Email Address',413 title = _(u'Email Address'), 404 414 required = True, 405 415 constraint=validate_email, 406 416 ) 407 417 phone = schema.TextLine( 408 title = u'Phone',418 title = _(u'Phone'), 409 419 description = u'', 410 420 required = False, 411 421 ) 412 422 course1 = schema.Choice( 413 title = u'1st Choice Course of Study',423 title = _(u'1st Choice Course of Study'), 414 424 source = CertificateSource(), 415 425 required = True, 416 426 ) 417 427 course2 = schema.Choice( 418 title = u'2nd Choice Course of Study',428 title = _(u'2nd Choice Course of Study'), 419 429 source = CertificateSource(), 420 430 required = False, … … 425 435 # 426 436 screening_score = schema.Int( 427 title = u'Screening Score',437 title = _(u'Screening Score'), 428 438 required = False, 429 439 ) 430 440 screening_venue = schema.TextLine( 431 title = u'Screening Venue',441 title = _(u'Screening Venue'), 432 442 required = False, 433 443 ) 434 444 course_admitted = schema.Choice( 435 title = u'Admitted Course of Study',445 title = _(u'Admitted Course of Study'), 436 446 source = CertificateSource(), 437 447 default = None, … … 439 449 ) 440 450 notice = schema.Text( 441 title = u'Notice',451 title = _(u'Notice'), 442 452 required = False, 443 453 ) … … 461 471 462 472 student_id = schema.TextLine( 463 title = u'Student Id',473 title = _(u'Student Id'), 464 474 required = False, 465 475 readonly = False, 466 476 ) 467 477 locked = schema.Bool( 468 title = u'Form locked',478 title = _(u'Form locked'), 469 479 default = False, 470 480 ) … … 491 501 492 502 course1 = schema.Choice( 493 title = u'1st Choice Course of Study',503 title = _(u'1st Choice Course of Study'), 494 504 source = AppCatCertificateSource(), 495 505 required = True, 496 506 ) 497 507 course2 = schema.Choice( 498 title = u'2nd Choice Course of Study',508 title = _(u'2nd Choice Course of Study'), 499 509 source = AppCatCertificateSource(), 500 510 required = False, 501 511 ) 502 512 screening_score = schema.Int( 503 title = u'Screening Score',513 title = _(u'Screening Score'), 504 514 required = False, 505 515 readonly = True, 506 516 ) 507 517 screening_venue = schema.TextLine( 508 title = u'Screening Venue',518 title = _(u'Screening Venue'), 509 519 required = False, 510 520 readonly = True, 511 521 ) 512 522 course_admitted = schema.Choice( 513 title = u'Admitted Course of Study',523 title = _(u'Admitted Course of Study'), 514 524 source = CertificateSource(), 515 525 default = None, … … 518 528 ) 519 529 notice = schema.Text( 520 title = u'Notice',530 title = _(u'Notice'), 521 531 required = False, 522 532 readonly = True, … … 545 555 """ 546 556 p_year = schema.Choice( 547 title = u'Payment Session',557 title = _(u'Payment Session'), 548 558 source = academic_sessions_vocab, 549 559 required = False,
Note: See TracChangeset for help on using the changeset viewer.