예제 #1
0
    def _delete(self, id):
        c.proposal_type = ProposalType.find_by_id(id)
        meta.Session.delete(c.proposal_type)
        meta.Session.commit()

        h.flash("Proposal type has been deleted.")
        redirect_to("index")
예제 #2
0
 def __before__(self, **kwargs):
     c.proposal_types = ProposalType.find_all()
     c.target_audiences = TargetAudience.find_all()
     c.accommodation_assistance_types = AccommodationAssistanceType.find_all()
     c.travel_assistance_types = TravelAssistanceType.find_all()
     c.proposal_event_targets = ProposalEventTarget.find_all()
     log.debug("event target list: %s", c.proposal_event_targets)
예제 #3
0
    def new(self):
        # call for miniconfs has closed
        if c.cfmini_status == 'closed':
            return render("proposal/closed_mini.mako")
        elif c.cfmini_status == 'not_open':
            return render("proposal/not_open_mini.mako")

        c.proposal_type = ProposalType.find_by_name('Miniconf')
        c.person = h.signed_in_person()
        h.check_for_incomplete_profile(c.person)

        defaults = {
            'proposal.type': c.proposal_type.id,
            'proposal.technical_requirements': "",
            'proposal.accommodation_assistance': 1,
            'proposal.travel_assistance': 1,
            'proposal.video_release': 0,
            'proposal.slides_release': 0,
            'person.name': c.person.firstname + " " + c.person.lastname,
            'person.mobile': c.person.mobile,
            'person.experience': c.person.experience,
            'person.bio': c.person.bio,
        }

        form = render("proposal/new_mini.mako")
        return htmlfill.render(form, defaults)
예제 #4
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)
예제 #5
0
    def new(self):
        # call for miniconfs has closed
        if c.cfmini_status == 'closed':
            return render("proposal/closed_mini.mako")
        elif c.cfmini_status == 'not_open':
            return render("proposal/not_open_mini.mako")

        c.proposal_type = ProposalType.find_by_name('Miniconf')
        c.person = h.signed_in_person()
        h.check_for_incomplete_profile(c.person)

        defaults = {
            'proposal.type': c.proposal_type.id,
            'proposal.technical_requirements': "",
            'proposal.accommodation_assistance': 1,
            'proposal.travel_assistance': 1,
            'proposal.video_release': 0,
            'proposal.slides_release': 0,
            'person.name' : c.person.firstname + " " + c.person.lastname,
            'person.mobile' : c.person.mobile,
            'person.experience' : c.person.experience,
            'person.bio' : c.person.bio,
        }
 
        form = render("proposal/new_mini.mako")
        return htmlfill.render(form, defaults)
예제 #6
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)
예제 #7
0
    def _delete(self, id):
        c.proposal_type = ProposalType.find_by_id(id)
        meta.Session.delete(c.proposal_type)
        meta.Session.commit()

        h.flash("Proposal type has been deleted.")
        redirect_to('index')
예제 #8
0
파일: review.py 프로젝트: Secko/zookeepr
    def index(self):
        c.proposal_type_collection = ProposalType.find_all()

        c.review_collection_by_type = {}
        for proposal_type in c.proposal_type_collection:
            query = Review.by_reviewer(h.signed_in_person().id).join(Proposal).filter_by(proposal_type_id=proposal_type.id)
            c.review_collection_by_type[proposal_type] = query.all()
        return render('/review/list.mako')
예제 #9
0
    def latex(self):
        c.proposal_type = ProposalType.find_all()

        for type in c.proposal_type:
            print type

        response.headers['Content-type'] = 'text/plain; charset=utf-8'

        return render('/proposal/latex.mako')
예제 #10
0
    def latex(self):
        c.proposal_type = ProposalType.find_all()

        for type in c.proposal_type:
          print type

        response.headers['Content-type']='text/plain; charset=utf-8'

        return render('/proposal/latex.mako')
예제 #11
0
    def latex(self):
        c.proposal_type = ProposalType.find_all()

        for type in c.proposal_type:
            print type

        response.headers["Content-type"] = "text/plain; charset=utf-8"

        return render("/proposal/latex.mako")
예제 #12
0
    def delete(self, id):
        """Delete the proposal type

        GET will return a form asking for approval.

        POST requests will delete the item.
        """
        c.proposal_type = ProposalType.find_by_id(id)
        return render('/proposal_type/confirm_delete.mako')
예제 #13
0
    def delete(self, id):
        """Delete the proposal type

        GET will return a form asking for approval.

        POST requests will delete the item.
        """
        c.proposal_type = ProposalType.find_by_id(id)
        return render("/proposal_type/confirm_delete.mako")
예제 #14
0
    def _new(self):
        results = self.form_result['proposal_type']

        c.proposal_type = ProposalType(**results)
        meta.Session.add(c.proposal_type)
        meta.Session.commit()

        h.flash("Proposal type created")
        redirect_to(action='view', id=c.proposal_type.id)
예제 #15
0
    def _edit(self, id):
        proposal_type = ProposalType.find_by_id(id)

        for key in self.form_result["proposal_type"]:
            setattr(proposal_type, key, self.form_result["proposal_type"][key])

        # update the objects with the validated form data
        meta.Session.commit()
        h.flash("Proposal type has been updated successfully.")
        redirect_to(action="view", id=id)
예제 #16
0
    def _edit(self, id):
        proposal_type = ProposalType.find_by_id(id)

        for key in self.form_result['proposal_type']:
            setattr(proposal_type, key, self.form_result['proposal_type'][key])

        # update the objects with the validated form data
        meta.Session.commit()
        h.flash("Proposal type has been updated successfully.")
        redirect_to(action='view', id=id)
예제 #17
0
    def index(self):
        c.proposal_type_collection = ProposalType.find_all()

        c.review_collection_by_type = {}
        for proposal_type in c.proposal_type_collection:
            query = Review.by_reviewer(
                h.signed_in_person()).join(Proposal).filter_by(
                    proposal_type_id=proposal_type.id)
            c.review_collection_by_type[proposal_type] = query.all()
        return render('/review/list.mako')
예제 #18
0
 def __before__(self, **kwargs):
     c.proposal_types = ProposalType.find_all()
     c.target_audiences = TargetAudience.find_all()
     c.accommodation_assistance_types = AccommodationAssistanceType.find_all(
     )
     c.travel_assistance_types = TravelAssistanceType.find_all()
예제 #19
0
 def index(self):
     c.proposal_type_collection = ProposalType.find_all()
     return render('/proposal_type/list.mako')
예제 #20
0
 def __before__(self, **kwargs):
     c.proposal_types = ProposalType.find_all()
     c.target_audiences = TargetAudience.find_all()
     c.accommodation_assistance_types = AccommodationAssistanceType.find_all()
     c.travel_assistance_types = TravelAssistanceType.find_all()
예제 #21
0
 def _to_python(self, value, state):
     return ProposalType.find_by_id(value)
예제 #22
0
 def view(self, id):
     c.proposal_type = ProposalType.find_by_id(id)
     return render('/proposal_type/view.mako')
예제 #23
0
 def index(self):
     c.proposal_type_collection = ProposalType.find_all()
     return render("/proposal_type/list.mako")
예제 #24
0
 def _to_python(self, value, state):
     return ProposalType.find_by_id(value)
예제 #25
0
 def view(self, id):
     c.proposal_type = ProposalType.find_by_id(id)
     return render("/proposal_type/view.mako")