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)
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_zkpylons_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)
def edit(self, id): c.proposal_status = ProposalStatus.find_by_id(id) defaults = h.object_to_defaults(c.proposal_status, 'proposal_status') form = render('/proposal_status/edit.mako') return htmlfill.render(form, defaults)
def edit(self, id): c.travel = Travel.find_by_id(id) defaults = h.object_to_defaults(c.travel, "travel") form = render("/travel/edit.mako") return htmlfill.render(form, defaults)
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)
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)
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)
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)
def edit(self, id): c.travel = Travel.find_by_id(id) defaults = h.object_to_defaults(c.travel, 'travel') form = render('/travel/edit.mako') return htmlfill.render(form, defaults)
def offer(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_zkpylons_user(id), h.auth.has_reviewer_role, h.auth.has_organiser_role)): # Raise a no_auth error h.auth.no_role() c.person = Person.find_by_id(id) c.offers = c.person.proposal_offers c.travel_assistance = reduce( lambda a, b: a or ('Travel' in b.status.name), c.offers, False) or False c.accommodation_assistance = reduce( lambda a, b: a or ('Accommodation' in b.status.name), c.offers, False) or False # Set initial form defaults defaults = { 'status': 'accept', } if c.person.travel: defaults.update(h.object_to_defaults(c.person.travel, 'travel')) form = render('person/offer.mako') return htmlfill.render(form, defaults)
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)
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)
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)
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)
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)
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)
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)
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)
def edit(self, id): c.fulfilment_group = FulfilmentGroup.find_by_id(id) defaults = h.object_to_defaults(c.fulfilment_group, 'fulfilment_group') defaults['fulfilment_group.person'] = c.fulfilment_group.person_id form = render('/fulfilment_group/edit.mako') return htmlfill.render(form, defaults)
def edit(self, id): c.fulfilment_status = FulfilmentStatus.find_by_id(id) defaults = h.object_to_defaults(c.fulfilment_status, 'fulfilment_status') defaults['fulfilment_status.types'] = [t.id for t in c.fulfilment_status.types] form = render('/fulfilment_status/edit.mako') return htmlfill.render(form, defaults)
def edit(self, id): c.fulfilment_type = FulfilmentType.find_by_id(id) defaults = h.object_to_defaults(c.fulfilment_type, 'fulfilment_type') defaults['fulfilment_type.initial_status'] = c.fulfilment_type.initial_status_id defaults['fulfilment_type.status'] = [s.id for s in c.fulfilment_type.status] form = render('/fulfilment_type/edit.mako') return htmlfill.render(form, defaults)
def edit(self, id): c.fulfilment = Fulfilment.find_by_id(id) defaults = h.object_to_defaults(c.fulfilment, 'fulfilment') defaults['fulfilment.person'] = c.fulfilment.person_id defaults['fulfilment.type'] = c.fulfilment.type_id defaults['fulfilment.status'] = c.fulfilment.status_id form = render('/fulfilment/edit.mako') return htmlfill.render(form, defaults)
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_zkpylons_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.proposal_editing == 'closed' and not h.auth.authorized( h.auth.has_late_submitter_role): return render("proposal/editing_closed.mako") elif c.proposal_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)
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)
def edit(self, id): c.rego_room = RegoRoom.find_by_id(id) defaults = h.object_to_defaults(c.rego_room, 'rego_room') # Rename some fields to match form names defaults["rego_room.rego"] = defaults["rego_room.rego_id"] defaults["rego_room.by"] = defaults["rego_room.by_id"] form = render('rego_room/edit.mako') return htmlfill.render(form, defaults)
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)
def finish_signup(self): c.form = 'finish_signup' c.person = h.signed_in_person() c.social_networks = SocialNetwork.find_all() c.person.fetch_social_networks() defaults = h.object_to_defaults(c.person, 'person') if not defaults['person.country']: defaults['person.country'] = 'AUSTRALIA' form = render('/person/finish_signup.mako') return htmlfill.render(form, defaults)
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 if c.product.fulfilment_type: defaults['product.fulfilment_type'] = c.product.fulfilment_type.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)
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') 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') form = render('/time_slot/edit.mako') return htmlfill.render(form, defaults)
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)
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_zkpylons_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') if not defaults['person.country']: defaults['person.country'] = 'AUSTRALIA' form = render('/person/edit.mako') return htmlfill.render(form, defaults)
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'] defaults[ 'db_content.publish_date'] = c.db_content.publish_timestamp.strftime( '%d/%m/%y') defaults[ 'db_content.publish_time'] = c.db_content.publish_timestamp.strftime( '%H:%M:%S') form = render('/db_content/edit.mako') return htmlfill.render(form, defaults)