~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/admin/subject.py

  • Committer: Matt Giuca
  • Date: 2010-02-25 01:13:40 UTC
  • Revision ID: matt.giuca@gmail.com-20100225011340-s604qzuvqt73zh6z
Login page: Added a warning that Internet Explorer is unsupported at this time. This checks the UA string for 'MSIE' and a bit more magic. Fixes Launchpad bug #526822.

Show diffs side-by-side

added added

removed removed

Lines of Context:
308
308
 
309
309
        ctx['worksheets'], problems_total, problems_done = (
310
310
            ivle.worksheet.utils.create_list_of_fake_worksheets_and_stats(
311
 
                req.store, req.user, self.context))
 
311
                req.config, req.store, req.user, self.context))
312
312
 
313
313
        ctx['exercises_total'] = problems_total
314
314
        ctx['exercises_done'] = problems_done
385
385
    description = formencode.validators.UnicodeString(
386
386
        if_missing=None, not_empty=False)
387
387
    url = formencode.validators.URL(if_missing=None, not_empty=False)
 
388
    show_worksheet_marks = formencode.validators.StringBoolean(
 
389
        if_missing=False)
388
390
 
389
391
 
390
392
class OfferingAdminSchema(OfferingSchema):
425
427
                        self.context.semester.semester,
426
428
            'url': self.context.url,
427
429
            'description': self.context.description,
 
430
            'show_worksheet_marks': self.context.show_worksheet_marks,
428
431
            }
429
432
 
430
433
    def save_object(self, req, data):
433
436
            self.context.semester = data['semester']
434
437
        self.context.description = data['description']
435
438
        self.context.url = unicode(data['url']) if data['url'] else None
 
439
        self.context.show_worksheet_marks = data['show_worksheet_marks']
436
440
        return self.context
437
441
 
438
442
 
467
471
        new_offering.semester = data['semester']
468
472
        new_offering.description = data['description']
469
473
        new_offering.url = unicode(data['url']) if data['url'] else None
 
474
        new_offering.show_worksheet_marks = data['show_worksheet_marks']
470
475
 
471
476
        req.store.add(new_offering)
472
477
        return new_offering
615
620
        ctx['offering'] = self.context
616
621
        ctx['roles_auth'] = self.context.get_permissions(req.user, req.config)
617
622
        ctx['errors'] = errors
 
623
        # If all of the fields validated, set the global form error.
 
624
        if isinstance(errors, basestring):
 
625
            ctx['error_value'] = errors
618
626
 
619
627
 
620
628
class EnrolmentEditSchema(formencode.Schema):