Ejemplo n.º 1
0
    def edit(self, id):
        c.event_type = EventType.find_by_id(id)

        defaults = h.object_to_defaults(c.event_type, 'event_type')

        form = render('/event_type/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 2
0
    def edit(self, id):
        c.product_category = ProductCategory.find_by_id(id)

        defaults = h.object_to_defaults(c.product_category, 'product_category')

        form = render('/product_category/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 3
0
 def edit(self, id):
     # A person can only volunteer once
     c.form = "edit"
     c.volunteer = Volunteer.find_by_id(id)
     defaults = h.object_to_defaults(c.volunteer, "volunteer")
     form = render("/volunteer/edit.mako")
     return htmlfill.render(form, defaults)
Ejemplo n.º 4
0
    def edit(self, id):
        c.funding_type = FundingType.find_by_id(id)

        defaults = h.object_to_defaults(c.funding_type, 'funding_type')

        form = render('/funding_type/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 5
0
    def edit(self, id):
        # We need to recheck auth in here so we can pass in the id
        if not h.auth.authorized(h.auth.Or(h.auth.is_same_zookeepr_funding_submitter(id), h.auth.has_organiser_role)):
            # Raise a no_auth error
            h.auth.no_role()

        if not h.auth.authorized(h.auth.has_organiser_role):
            if c.funding_editing == 'closed':
                return render("funding/editing_closed.mako")
            elif c.funding_editing == 'not_open':
                return render("funding/editing_not_open.mako")

        c.funding = Funding.find_by_id(id)

        defaults = {}
        defaults.update(h.object_to_defaults(c.funding, 'funding'))
        # This is horrible, don't know a better way to do it
        if c.funding.type:
            defaults['funding.type'] = defaults['funding.funding_type_id']
        if c.funding.male:
            defaults['funding.male'] = 1
        else:
            defaults['funding.male'] = 0

        form = render('/funding/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 6
0
    def edit(self, id):
        c.stream = Stream.find_by_id(id)

        defaults = h.object_to_defaults(c.stream, 'stream')

        form = render('/stream/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 7
0
 def edit(self, id):
     # A person can only volunteer once
     c.form = 'edit'
     c.volunteer = Volunteer.find_by_id(id)
     defaults = h.object_to_defaults(c.volunteer, 'volunteer')
     form = render('/volunteer/edit.mako')
     return htmlfill.render(form, defaults)
Ejemplo n.º 8
0
    def edit(self, id):
        c.social_network = SocialNetwork.find_by_id(id)

        defaults = h.object_to_defaults(c.social_network, 'social_network')

        form = render('/social_network/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 9
0
    def edit(self, id):
        c.rego_note = RegoNote.find_by_id(id)

        defaults = h.object_to_defaults(c.rego_note, 'rego_note')

        form = render('rego_note/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 10
0
    def edit(self, id):
        c.event_type = EventType.find_by_id(id)

        defaults = h.object_to_defaults(c.event_type, 'event_type')

        form = render('/event_type/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 11
0
    def edit(self, id):
        c.special_offer = SpecialOffer.find_by_id(id)

        defaults = h.object_to_defaults(c.special_offer, 'special_offer')

        form = render('/special_offer/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 12
0
    def edit(self, id):
        c.rego_room = RegoRoom.find_by_id(id)

        defaults = h.object_to_defaults(c.rego_room, 'rego_room')

        form = render('rego_room/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 13
0
    def edit(self, id):
        c.social_network = SocialNetwork.find_by_id(id)

        defaults = h.object_to_defaults(c.social_network, 'social_network')

        form = render('/social_network/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 14
0
    def edit(self, id):
        c.proposal_type = ProposalType.find_by_id(id)

        defaults = h.object_to_defaults(c.proposal_type, 'proposal_type')

        form = render('/proposal_type/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 15
0
    def edit(self, id):
        c.location = Location.find_by_id(id)

        defaults = h.object_to_defaults(c.location, 'location')

        form = render('/location/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 16
0
    def edit(self, id):
        c.proposal_type = ProposalType.find_by_id(id)

        defaults = h.object_to_defaults(c.proposal_type, "proposal_type")

        form = render("/proposal_type/edit.mako")
        return htmlfill.render(form, defaults)
Ejemplo n.º 17
0
    def edit(self, id):
        c.product_category = ProductCategory.find_by_id(id)

        defaults = h.object_to_defaults(c.product_category, 'product_category')

        form = render('/product_category/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 18
0
    def edit(self, id):
        c.vote = Vote.find_by_id(id)

        defaults = h.object_to_defaults(c.vote, 'vote')

        form = render('vote/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 19
0
    def edit(self, id):
        c.special_offer = SpecialOffer.find_by_id(id)

        defaults = h.object_to_defaults(c.special_offer, 'special_offer')

        form = render('/special_offer/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 20
0
    def edit(self, id):
        # We need to recheck auth in here so we can pass in the id
        if not h.auth.authorized(
                h.auth.Or(h.auth.is_same_zookeepr_funding_submitter(id),
                          h.auth.has_organiser_role)):
            # Raise a no_auth error
            h.auth.no_role()

        if not h.auth.authorized(h.auth.has_organiser_role):
            if c.funding_editing == 'closed':
                return render("funding/editing_closed.mako")
            elif c.funding_editing == 'not_open':
                return render("funding/editing_not_open.mako")

        c.funding = Funding.find_by_id(id)

        defaults = {}
        defaults.update(h.object_to_defaults(c.funding, 'funding'))
        # This is horrible, don't know a better way to do it
        if c.funding.type:
            defaults['funding.type'] = defaults['funding.funding_type_id']
        if c.funding.male:
            defaults['funding.male'] = 1
        else:
            defaults['funding.male'] = 0

        form = render('/funding/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 21
0
    def edit(self, id):
        c.rego_note = RegoNote.find_by_id(id)

        defaults = h.object_to_defaults(c.rego_note, "rego_note")

        form = render("rego_note/edit.mako")
        return htmlfill.render(form, defaults)
Ejemplo n.º 22
0
    def edit(self, id):
        c.form = 'edit'
        c.role = Role.find_by_id(id)
        
        defaults = h.object_to_defaults(c.role, 'role')

        form = render('/role/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 23
0
    def edit(self, id):
        c.db_content = DbContent.find_by_id(id)

        defaults = h.object_to_defaults(c.db_content, 'db_content')
        # This is horrible, don't know a better way to do it
        if c.db_content.type:
            defaults['db_content.type'] = defaults['db_content.type_id']

        form = render('/db_content/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 24
0
    def edit(self, id):
        c.db_content = DbContent.find_by_id(id)

        defaults = h.object_to_defaults(c.db_content, 'db_content')
        # This is horrible, don't know a better way to do it
        if c.db_content.type:
            defaults['db_content.type'] = defaults['db_content.type_id']
        
        form = render('/db_content/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 25
0
    def edit(self, id):
        # We need to recheck auth in here so we can pass in the id
        if not h.auth.authorized(
                h.auth.Or(h.auth.is_same_zookeepr_submitter(id),
                          h.auth.has_organiser_role)):
            # Raise a no_auth error
            h.auth.no_role()

        if not h.auth.authorized(h.auth.has_organiser_role):
            if c.paper_editing == 'closed' and not h.auth.authorized(
                    h.auth.has_late_submitter_role):
                return render("proposal/editing_closed.mako")
            elif c.paper_editing == 'not_open':
                return render("proposal/editing_not_open.mako")

        c.proposal = Proposal.find_by_id(id)

        c.person = c.proposal.people[0]
        for person in c.proposal.people:
            if h.signed_in_person() == person:
                c.person = person

        defaults = h.object_to_defaults(c.proposal, 'proposal')
        defaults.update(h.object_to_defaults(c.person, 'person'))
        defaults['person.name'] = c.person.firstname + " " + c.person.lastname
        # This is horrible, don't know a better way to do it
        if c.proposal.type:
            defaults['proposal.type'] = defaults['proposal.proposal_type_id']
        if c.proposal.travel_assistance:
            defaults['proposal.travel_assistance'] = defaults[
                'proposal.travel_assistance_type_id']
        if c.proposal.accommodation_assistance:
            defaults['proposal.accommodation_assistance'] = defaults[
                'proposal.accommodation_assistance_type_id']
        if c.proposal.audience:
            defaults['proposal.audience'] = defaults[
                'proposal.target_audience_id']

        defaults['person_to_edit'] = c.person.id
        defaults['name'] = c.person.firstname + " " + c.person.lastname
        c.miniconf = (c.proposal.type.name == 'Miniconf')
        form = render('/proposal/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 26
0
    def edit(self, id):
        c.time_slot = TimeSlot.find_by_id(id)

        defaults = h.object_to_defaults(c.time_slot, 'time_slot')
        defaults['time_slot.start_date'] = c.time_slot.start_time.strftime('%d/%m/%y')
        defaults['time_slot.start_time'] = c.time_slot.start_time.strftime('%H:%M:%S')
        defaults['time_slot.end_date'] = c.time_slot.end_time.strftime('%d/%m/%y')
        defaults['time_slot.end_time'] = c.time_slot.end_time.strftime('%H:%M:%S')

        form = render('/time_slot/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 27
0
    def edit(self, id):
        c.event = Event.find_by_id(id)
        if c.event.proposal:
            c.proposals.append(c.event.proposal)

        defaults = h.object_to_defaults(c.event, 'event')
        defaults['event.type'] = c.event.type_id
        defaults['event.proposal'] = c.event.proposal_id

        form = render('/event/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 28
0
    def edit(self, id):
        c.event = Event.find_by_id(id)
        if c.event.proposal:
            c.proposals.append(c.event.proposal)

        defaults = h.object_to_defaults(c.event, 'event')
        defaults['event.type'] = c.event.type_id
        defaults['event.proposal'] = c.event.proposal_id

        form = render('/event/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 29
0
    def edit(self, id):
        c.product = Product.find_by_id(id)

        defaults = h.object_to_defaults(c.product, 'product')
        defaults['product.category'] = c.product.category.id

        defaults['product.ceilings'] = []
        for ceiling in c.product.ceilings:
            defaults['product.ceilings'].append(ceiling.id)

        form = render('/product/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 30
0
    def edit(self, id):
        c.product = Product.find_by_id(id)

        defaults = h.object_to_defaults(c.product, 'product')
        defaults['product.category'] = c.product.category.id

        defaults['product.ceilings'] = []
        for ceiling in c.product.ceilings:
            defaults['product.ceilings'].append(ceiling.id)

        form = render('/product/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 31
0
    def edit(self, id):
        c.form = 'edit'
        c.review = Review.find_by_id(id)
        self._is_reviewer()

        c.proposal = c.review.proposal
        defaults = h.object_to_defaults(c.review, 'review')
        if defaults['review.score'] == 1 or defaults['review.score'] == 2:
            defaults['review.score'] = '+%s'  % defaults['review.score']

        c.signed_in_person = h.signed_in_person()
        form = render('/review/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 32
0
    def edit(self, id):
        c.form = 'edit'
        c.review = Review.find_by_id(id)
        self._is_reviewer()

        c.proposal = c.review.proposal
        defaults = h.object_to_defaults(c.review, 'review')
        if defaults['review.score'] == 1 or defaults['review.score'] == 2:
            defaults['review.score'] = '+%s' % defaults['review.score']

        c.signed_in_person = h.signed_in_person()
        form = render('/review/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 33
0
    def edit(self, id):
        c.time_slots = TimeSlot.find_all()
        c.locations = Location.find_all()
        c.events = Event.find_all()
        c.schedule = Schedule.find_by_id(id)


        defaults = h.object_to_defaults(c.schedule, 'schedule')
        defaults['schedule.time_slot'] = c.schedule.time_slot_id
        defaults['schedule.location'] = c.schedule.location_id
        defaults['schedule.event'] = c.schedule.event_id

        form = render('/schedule/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 34
0
    def edit(self, id):
        # We need to recheck auth in here so we can pass in the id
        if not h.auth.authorized(h.auth.Or(h.auth.is_same_zookeepr_submitter(id), h.auth.has_organiser_role)):
            # Raise a no_auth error
            h.auth.no_role()

        if not h.auth.authorized(h.auth.has_organiser_role):
            if c.paper_editing == 'closed' and not h.auth.authorized(h.auth.has_late_submitter_role):
                return render("proposal/editing_closed.mako")
            elif c.paper_editing == 'not_open':
                return render("proposal/editing_not_open.mako")

        c.proposal = Proposal.find_by_id(id)

        c.person = c.proposal.people[0]
        for person in c.proposal.people:
            if h.signed_in_person() == person:
                c.person = person

        defaults = h.object_to_defaults(c.proposal, 'proposal')
        defaults.update(h.object_to_defaults(c.person, 'person'))
        defaults['person.name'] = c.person.firstname + " " + c.person.lastname
        # This is horrible, don't know a better way to do it
        if c.proposal.type:
            defaults['proposal.type'] = defaults['proposal.proposal_type_id']
        if c.proposal.travel_assistance:
            defaults['proposal.travel_assistance'] = defaults['proposal.travel_assistance_type_id']
        if c.proposal.accommodation_assistance:
            defaults['proposal.accommodation_assistance'] = defaults['proposal.accommodation_assistance_type_id']
        if c.proposal.audience:
            defaults['proposal.audience'] = defaults['proposal.target_audience_id']

        defaults['person_to_edit'] = c.person.id
        defaults['name'] = c.person.firstname + " " + c.person.lastname
        c.miniconf = (c.proposal.type.name == 'Miniconf')
        form = render('/proposal/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 35
0
    def edit(self, id):
        c.form = "edit"
        c.review = FundingReview.find_by_id(id)
        self._is_reviewer()

        c.funding = c.review.funding
        defaults = h.object_to_defaults(c.review, "review")
        if defaults["review.score"] == None:
            defaults["review.score"] = "null"
        if defaults["review.score"] == 1 or defaults["review.score"] == 2:
            defaults["review.score"] = "+%s" % defaults["review.score"]

        c.signed_in_person = h.signed_in_person()
        form = render("/funding_review/edit.mako")
        return htmlfill.render(form, defaults)
Ejemplo n.º 36
0
    def edit(self, id):
        # We need to recheck auth in here so we can pass in the id
        if not h.auth.authorized(h.auth.Or(h.auth.is_same_zookeepr_user(id), h.auth.has_organiser_role)):
            # Raise a no_auth error
            h.auth.no_role()
        c.form = 'edit'
        c.person = Person.find_by_id(id)
        c.social_networks = SocialNetwork.find_all()
        c.person.fetch_social_networks()

        defaults = h.object_to_defaults(c.person, 'person')
        defaults['person.email_address2'] = c.person.email_address

        form = render('/person/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 37
0
    def edit(self, id):
        c.time_slot = TimeSlot.find_by_id(id)

        defaults = h.object_to_defaults(c.time_slot, 'time_slot')
        defaults['time_slot.start_date'] = c.time_slot.start_time.strftime(
            '%d/%m/%y')
        defaults['time_slot.start_time'] = c.time_slot.start_time.strftime(
            '%H:%M:%S')
        defaults['time_slot.end_date'] = c.time_slot.end_time.strftime(
            '%d/%m/%y')
        defaults['time_slot.end_time'] = c.time_slot.end_time.strftime(
            '%H:%M:%S')

        form = render('/time_slot/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 38
0
    def edit(self, id):
        c.form = 'edit'
        c.review = FundingReview.find_by_id(id)
        self._is_reviewer()

        c.funding = c.review.funding
        defaults = h.object_to_defaults(c.review, 'review')
        if defaults['review.score'] == None:
            defaults['review.score'] = 'null'
        if defaults['review.score'] == 1 or defaults['review.score'] == 2:
            defaults['review.score'] = '+%s' % defaults['review.score']

        c.signed_in_person = h.signed_in_person()
        form = render('/funding_review/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 39
0
    def edit(self, id):
        c.ceiling = Ceiling.find_by_id(id)

        defaults = h.object_to_defaults(c.ceiling, 'ceiling')

        defaults['ceiling.products'] = []
        for product in c.ceiling.products:
            defaults['ceiling.products'].append(product.id)
        if c.ceiling.available_from:
            defaults['ceiling.available_from'] = c.ceiling.available_from.strftime('%d/%m/%y')
        if c.ceiling.available_until:
            defaults['ceiling.available_until'] = c.ceiling.available_until.strftime('%d/%m/%y')

        form = render('/ceiling/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 40
0
    def edit(self, id):
        # We need to recheck auth in here so we can pass in the id
        if not h.auth.authorized(
                h.auth.Or(h.auth.is_same_zookeepr_user(id),
                          h.auth.has_organiser_role)):
            # Raise a no_auth error
            h.auth.no_role()
        c.form = 'edit'
        c.person = Person.find_by_id(id)
        c.social_networks = SocialNetwork.find_all()
        c.person.fetch_social_networks()

        defaults = h.object_to_defaults(c.person, 'person')
        defaults['person.email_address2'] = c.person.email_address

        form = render('/person/edit.mako')
        return htmlfill.render(form, defaults)
Ejemplo n.º 41
0
 def new(self):
     if len(c.db_content_types) is 0:
         h.flash("Configuration Error: Please make sure at least one content type exists.", 'error')
     if DbContentType.find_by_name("News") is None:
         h.flash("Configuration Error: Please make sure the 'News' content type exists for full functionality.", 'error')
     if DbContentType.find_by_name("In the press") is None:
         h.flash("Configuration Error: Please make sure the 'In the press' content type exists for full functionality.", 'error')
     c.db_content = DbContent()
     defaults = h.object_to_defaults(c.db_content, 'db_content')
     if request.GET.has_key('url'):
         defaults['db_content.type'] = 1 # This is bad... we're assuming we have #1 as new page
         if request.GET['url'].startswith('/'):
             defaults['db_content.url'] = str(request.GET['url'])[1:]
         else:
             defaults['db_content.url'] = request.GET['url']
     form = render('/db_content/new.mako')
     return htmlfill.render(form, defaults)
Ejemplo n.º 42
0
    def edit(self, id):
        c.ceiling = Ceiling.find_by_id(id)

        defaults = h.object_to_defaults(c.ceiling, 'ceiling')

        defaults['ceiling.products'] = []
        for product in c.ceiling.products:
            defaults['ceiling.products'].append(product.id)
        if c.ceiling.available_from:
            defaults[
                'ceiling.available_from'] = c.ceiling.available_from.strftime(
                    '%d/%m/%y')
        if c.ceiling.available_until:
            defaults[
                'ceiling.available_until'] = c.ceiling.available_until.strftime(
                    '%d/%m/%y')

        form = render('/ceiling/edit.mako')
        return htmlfill.render(form, defaults)