Example #1
0
    def __call__(self, context):
        terms = []
        levels = [('morning', _(u'Morning')),
                  ('afternon', _(u'Afternon'))]
        for code, text in levels:
            term = (code, code, text)
            terms.append(SimpleVocabulary.createTerm(*term))

        return SimpleVocabulary(terms)
Example #2
0
    def __call__(self, context):
        ''' Talk Types Options '''
        terms = []
        types = [('talk', _(u'Talk')),
                 ('panel', _(u'Panel'))]
        for key, value in types:
            term = (key, key, value)
            terms.append(SimpleVocabulary.createTerm(*term))

        return SimpleVocabulary(terms)
Example #3
0
    def __call__(self, context):
        ''' Genders '''
        terms = []
        genders = [('m', _(u'Male')),
                   ('f', _(u'Female'))]
        for key, value in genders:
            term = (key, key, value)
            terms.append(SimpleVocabulary.createTerm(*term))

        return SimpleVocabulary(terms)
Example #4
0
    def __call__(self, context):
        terms = []
        levels = [('en', _(u'English')),
                  ('pt-br', _(u'Portuguese')),
                  ('es', _(u'Spanish'))]
        for code, text in levels:
            term = (code, code, text)
            terms.append(SimpleVocabulary.createTerm(*term))

        return SimpleVocabulary(terms)
Example #5
0
    def __call__(self, context):
        ''' Talk Types Options '''
        terms = []
        types = [('basic', _(u'Basic')),
                 ('intermediate', _(u'Intermediate')),
                 ('advanced', _(u'Advanced'))]
        for key, value in types:
            term = (key, key, value)
            terms.append(SimpleVocabulary.createTerm(*term))

        return SimpleVocabulary(terms)
Example #6
0
    def __call__(self, context):
        ''' Payment Method Options '''
        terms = []
        types = [('cash', _(u'Cash / At the conference')),
                 ('paypal', _(u'PayPal')),
                 ('pagseguro', _(u'PagSeguro'))]
        for key, value in types:
            term = (key, key, value)
            terms.append(SimpleVocabulary.createTerm(*term))

        return SimpleVocabulary(terms)
Example #7
0
    def __call__(self, context):
        ''' Look for an enclosing program
            list available languages in it '''
        terms = []
        levels = [('basic', _(u'Basic')),
                  ('advanced', _(u'Advanced'))]
        for code, text in levels:
            term = (code, code, text)
            terms.append(SimpleVocabulary.createTerm(*term))

        return SimpleVocabulary(terms)
Example #8
0
    def __call__(self, context):
        ''' Talk Reference Types Options '''
        terms = []
        types = [('article', _(u'Article / Post')),
                 ('presentation', _(u'Presentation')),
                 ('video', _(u'Video'))]
        for key, value in types:
            term = (key, key, value)
            terms.append(SimpleVocabulary.createTerm(*term))

        return SimpleVocabulary(terms)
Example #9
0
    def __call__(self, context):
        ''' Wall Options '''
        terms = []
        types = [('no', _(u'No, thanks')),
                 ('100', _(u'Yes, I support with R$100,00')),
                 ('200', _(u'Yes, I support with R$200,00')),
                 ('400', _(u'Yes, I support with R$400,00'))]
        for key, value in types:
            term = (key, key, value)
            terms.append(SimpleVocabulary.createTerm(*term))

        return SimpleVocabulary(terms)
Example #10
0
    def __call__(self, context):
        ''' Caipirinha Sprint Options'''
        terms = []
        types = [('no', _(u'No! I will not attend.')),
                 ('yes_1', _(u'Yes! Book me a place (R$350,00)')),
                 ('yes_2', _(u'Yes! Book me 2 places (R$700,00)')),
                 ('yes_3', _(u'Yes! Book me 3 places (R$800,00)'))]
        for key, value in types:
            term = (key, key, value)
            terms.append(SimpleVocabulary.createTerm(*term))

        return SimpleVocabulary(terms)
Example #11
0
    def __call__(self, context):
        ''' TShirt Sizes '''
        terms = []
        sizes = [('S', _(u'Small')),
                 ('M', _(u'Medium')),
                 ('L', _(u'Large')),
                 ('X', _(u'X-Large'))]
        for key, value in sizes:
            term = (key, key, value)
            terms.append(SimpleVocabulary.createTerm(*term))

        return SimpleVocabulary(terms)
Example #12
0
    def render(self):
        this_attendee = self.context
        trainings_uid = self.request.form.get('trainings_uid', [])
        if isinstance(trainings_uid, str):
            trainings_uid = [trainings_uid, ]
        seat_table = SeatTable(this_attendee)

        # confirmed trainings are always part of the selection
        all_trainings = list(this_attendee.confirmed_trainings())
        for uid in trainings_uid:
            if uid not in all_trainings:
                # was this training already ours
                # OR are there still available seats?
                if uid in this_attendee.trainings or seat_table.available_seats(uid):
                    all_trainings.append(uid)
                else:
                    training = uuidToObject(uid)
                    messages = IStatusMessage(self.request)
                    warning = _(u'This training is already fully booked') + ': ' + training.title
                    messages.addStatusMessage(warning, type="warning")
        # reserve a seat for each training
        seat_table.refresh_attendee_trainings(this_attendee, all_trainings)
        # store the list of trainings of this attendee
        this_attendee.trainings = all_trainings
        this_attendee.reindexObject(idxs=['trainings', ])
        # set the time of this operation for use in liberation of blocked seats
        this_attendee.last_time_trainings_were_set = datetime.now()
        if self.request.get('finish_button'):
            # back to the registration
            return self.request.response.redirect(this_attendee.getParentNode().absolute_url())
        else:
            return self.request.response.redirect(this_attendee.absolute_url())
 def member_registrations(self):
     ''' List registrations made by authenticated member'''
     user = self.context.portal_membership.getAuthenticatedMember().getUserName()
     ct = self._ct
     brains = ct.searchResults(portal_type='registration',
                               Creator=user)
     regs = [r.getObject() for r in brains]
     return [dict(
         href=reg.absolute_url(),
         text=_('Registration for [%s] made in [%s]') % (reg.title, reg.created())) for reg in regs]
 def registration_options(self):
     base = self.context.absolute_url()
     options = [
         {'type': 'apyb',
          'href': '%s/@@registration-apyb' % base,
          'text': _(u'Register as an APyB Member'), },
         {'type': 'student',
          'href': '%s/@@registration-student' % base,
          'text': _(u'Register as a student'), },
         {'type': 'individual',
          'href': '%s/@@registration-individual' % base,
          'text': _(u'Register as an Individual'), },
         {'type': 'group',
          'href': '%s/@@registration-group' % base,
          'text': _(u'Register members of a group or organization '
                    u'(Group registration)'), },
         {'type': 'government',
          'href': '%s/@@registration-gov' % base,
          'text': _(u'Register member(s) of Brazilian Government'), }, ]
     return options
Example #15
0
    def __call__(self, context):
        ''' Registration Types'''
        terms = []
        types = [('apyb', _(u'APyB Members')),
                 ('student', _(u'Student')),
                 ('individual', _(u'Individual')),
                 ('government', _(u'Government')),
                 ('group', _(u'Group/Corporate')),
                 ('speaker', _(u'Speaker')),
                 ('speaker_c', _(u'Speaker')),
                 ('sponsor', _(u'Sponsor')),
                 ('organizer', _(u'Organization'))]
        for key, value in types:
            term = (key, key, value)
            terms.append(SimpleVocabulary.createTerm(*term))

        return SimpleVocabulary(terms)
Example #16
0
    def __call__(self, context):
        ''' Activity duration '''
        terms = []
        durations = [
            ('30 min.', _(u'30 Minutes')),
            ('45 min.', _(u'45 Minutes')),
            ('60 min.', _(u'60 Minutes')),
            ('4 hours', _(u'4 Hours')),
            ('8 hours', _(u'8 Hours')),
            ('16 hours', _(u'16 Hours')),
        ]
        for key, value in durations:
            term = (key, key, value)
            terms.append(SimpleVocabulary.createTerm(*term))

        return SimpleVocabulary(terms)
Example #17
0
WALL = {'no': 0,
        '100': 10000,
        '200': 20000,
        '400': 40000}

GROUP_DISCOUNTS = {
    'student': [
        (7, 0.25),
        (10, 0.27),
        (15, 0.32)],
    'group': [
        (7, 0.25),
        (10, 0.27),
        (15, 0.32)]}

REVIEW_STATE = {
    'confirmed': 'Confirmado',
    'pending': 'Pendente',
}

SPONSOR_LEVELS = [('diamond', _(u'Diamond')),
                  ('platinum', _(u'Platinum')),
                  ('gold', _(u'Gold')),
                  ('silver', _(u'Silver')),
                  ('bronze', _(u'Bronze')),
                  ('a_la_carte', _(u'À la Carte')),
                  ('supporting', _(u'Supporting')),
                  ('midia', _(u'Media Support')),
                  ('foss', _(u'Free and Open Source')),
                  ('organizers', _(u'Organization'))]
Example #18
0
 def addressInvariant(data):
     check = check_apyb_membership(data.email)
     if check == 'invalid':
         raise Invalid(_(u"The email address you provided does not match any APyB merbership account."))
     elif check == 'inactive':
         raise Invalid(_(u"Your APyB merbership is inactive and needs to be renewed."))
Example #19
0
    def __call__(self, context):
        terms = []
        levels = [('cloud_system_administration_networks',
                   _(u'Cloud, System Administration and Networks')),
                  ('community_education', _(u'Community and Education')),
                  ('django', _(u'Django')),
                  ('enterprise_management', _(u'Enterprise and Management')),
                  ('media_networks', _(u'Media and Networks')),
                  ('mobility_embedded_systems',
                   _(u'Mobility and Embedded Systems')),
                  ('plone', _(u'Plone')),
                  ('pyramid', _(u'Pyramid')),
                  ('scipy', _(u'Scipy')),
                  ('web_wevelopment', _(u'Web Development')),
                  ('other', _(u'Other'))]
        for code, text in levels:
            term = (code, code, text)
            terms.append(SimpleVocabulary.createTerm(*term))

        return SimpleVocabulary(terms)
Example #20
0
    def __call__(self, context):
        ''' Conference rooms Options '''
        terms = []
        rooms = [
            ('dorneles-tremea', _(u'Dorneles Treméa Auditorium')),
            ('cleese', _(u'John Cleese Room')),
            ('idle', _(u'Eric Idle Room')),
            ('gillian', _(u'Terry Gilliam Room')),
            ('palin', _(u'Michael Palin Room')),
            ('chapman', _(u'Graham Chapman Room')),
            ('jones', _(u'Terry Jones Room')),
            ('esaf-bt-1', _(u'ESAF BT 1')),
            ('esaf-bt-2', _(u'ESAF BT 2')),
            ('esaf-bt-3', _(u'ESAF BT 3')),
            ('esaf-bt-4', _(u'ESAF BT 4')),
            ('esaf-bt-5', _(u'ESAF BT 5')),
            ('esaf-bt-6', _(u'ESAF BT 6')),
            ('esaf-ct-1', _(u'ESAF CT 1')),
            ('esaf-ct-2', _(u'ESAF CT 2')),
            ('esaf-ct-3', _(u'ESAF CT 3')),
        ]
        for key, value in rooms:
            term = (key, key, value)
            terms.append(SimpleVocabulary.createTerm(*term))

        return SimpleVocabulary(terms)