Beispiel #1
0
    def get(self):
        upload_url = blobstore.create_upload_url('/success')

        template_values = {'upload_url': upload_url}

        template = JINJA_ENVIRONMENT.get_template('upload.html')
        self.response.write(template.render(template_values))
Beispiel #2
0
    def get(self):
        upload_url = blobstore.create_upload_url('/success')

        template_values = {
            'upload_url': upload_url
        }

        template = JINJA_ENVIRONMENT.get_template('upload.html')
        self.response.write(template.render(template_values))
Beispiel #3
0
    def post(self):
        name = self.request.get('name')
        stuyId = self.request.get('id')
        email = self.request.get('email')
        event = self.request.get('event')
        upload = self.get_uploads()
        for photo in upload:
            uploaded_photo = Photo(name=name, stuyId=stuyId, email=email, event=event, blob_key=photo.key())
            db.put(uploaded_photo)
        
        template_values = {
            'event': event
        }

        template = JINJA_ENVIRONMENT.get_template('success.html')
        self.response.write(template.render(template_values))
Beispiel #4
0
 def get(self):
     user = users.get_current_user()
     if user:
         if users.is_current_user_admin():
             template_values = {
                 'user': user.nickname(),
                 'logout_url': users.create_logout_url('/'),
                 'images': fetchMedias()
             }
             template = JINJA_ENVIRONMENT.get_template('admin.html')
             self.response.write(template.render(template_values))
         else:
             self.redirect('/')
     else:
         login_url = users.create_login_url('/admin')
         self.redirect(login_url)
Beispiel #5
0
 def get(self):
     user = users.get_current_user()
     if user:
         if users.is_current_user_admin():
             template_values = {
                 'user': user.nickname(),
                 'logout_url': users.create_logout_url('/'),
                 'images': fetchMedias()
             }
             template = JINJA_ENVIRONMENT.get_template('admin.html')
             self.response.write(template.render(template_values))
         else:
             self.redirect('/')
     else:
         login_url = users.create_login_url('/admin')
         self.redirect(login_url)
Beispiel #6
0
    def post(self):
        name = self.request.get('name')
        stuyId = self.request.get('id')
        email = self.request.get('email')
        event = self.request.get('event')
        upload = self.get_uploads()
        for photo in upload:
            uploaded_photo = Photo(name=name,
                                   stuyId=stuyId,
                                   email=email,
                                   event=event,
                                   blob_key=photo.key())
            db.put(uploaded_photo)

        template_values = {'event': event}

        template = JINJA_ENVIRONMENT.get_template('success.html')
        self.response.write(template.render(template_values))
Beispiel #7
0
 def get(self):
     template = JINJA_ENVIRONMENT.get_template('upload.html')
     self.response.write(template.render({}))
Beispiel #8
0
 def get(self):
     template = JINJA_ENVIRONMENT.get_template("index.html")
     self.response.write(template.render({}))