Ejemplo n.º 1
0
def home():
    events = json.loads(execute_script('mainCal')['response']['result'])
    params = ['1fhYZyb5sCBdjhHmrogAbCRySSa6GGv_OJ9LySangaj4',
              'Updates']  #sheet id, sheet name
    updates = json.loads(
        execute_script('mainGetSheet', params=params)['response']['result'])
    return (render_template("home.html", Events=events, Updates=updates))
Ejemplo n.º 2
0
def rsvp():
    if ('user' in session):
        if ('title' in request.json):
            execute_script('mainRSVP',
                           params=[session['user'], request.json['title']])
            return (json.dumps('Successful RSVP'))
        else:
            return (json.dumps("Invalid Request"))
    else:
        return (json.dumps('Not Signed In'))
Ejemplo n.º 3
0
def status():
    if ('user' in session):
        status = json.loads(
            execute_script('mainUserStatus',
                           params=[session['user']])['response']['result'])
        if (status):
            if (status['sj_status'] == 'COMPLETE'
                    and status['uhp_status'] == 'COMPLETE'):
                combined_status = 'COMPLETE'
            else:
                combined_status = 'INCOMPLETE'
            return (render_template("status.html",
                                    status=combined_status,
                                    uhp_status=status['uhp_status'],
                                    uhp_event=status['uhp_event'],
                                    uhp_date=status['uhp_date'],
                                    sj_status=status['sj_status'],
                                    sj_event=status['sj_event'],
                                    sj_date=status['sj_date'],
                                    member=True))
    return (render_template("status.html",
                            status="",
                            uhp_status="",
                            uhp_event="",
                            uhp_date="",
                            sj_status="",
                            sj_event="",
                            sj_date="",
                            member=False))
Ejemplo n.º 4
0
def event_sign_in():
    if ('user' in session):
        if ('title' in request.json and 'requirement' in request.json
                and 'longitude' in request.json and 'latitude' in request.json
                and 'locationCheck' in request.json):
            execute_script('mainSignIn',
                           params=[
                               session['user'], request.json['title'],
                               request.json['requirement'],
                               request.json['longitude'],
                               request.json['latitude'],
                               request.json['locationCheck']
                           ])
            execute_script('mainTracker',
                           params=[
                               session['user'], request.json['requirement'],
                               request.json['title']
                           ])
            return (json.dumps('Successful Sign In'))
        else:
            return (json.dumps('Invalid post parameters'))
    else:
        return (json.dumps("Not Signed In"))
Ejemplo n.º 5
0
 def setUpdates(self):
     '''A Method that sets updates from Google Apps Script'''
     params = [self.sheet_id, self.sheet_name]
     data = execute_script(self.function_name, params=params)
     self.updates = json.loads(data['response']['result'])
Ejemplo n.º 6
0
 def setEvents(self):
     '''A Method that sets updates from Google Apps Script'''
     data = execute_script(self.function_name)
     self.events = json.loads(data['response']['result'])