Exemple #1
0
    def show_page(self):
        user_info = AuthenticatedRequestHandler.authenticate_user(self)
        if user_info:
            my_days = []
            today = datetime.date.today()
            monday = today + datetime.timedelta(days=-today.weekday())
            nickname = user_info[0]

            for i in range(0, 7):
            	date = monday + datetime.timedelta(days=i)
                day = model.get_day(date)

                my_day = dict()
                my_day['date'] = date.strftime('%A, %d %h')
                my_day['options'] = ['Norm','Late','No','?']
                
                if nickname in day['users']:
                    my_day['selected'] = day['users'][nickname]
                else:
                    my_day['selected'] = '?'

                my_days.append(my_day)

            template_values = {
                'title': 'My Schedule',
                'page': 'my',
                'nickname': user_info[0],
                'logout_url': user_info[1],
                'my_days': my_days
            }
            path = os.path.join(os.path.dirname(__file__), 'template.html')
            self.response.out.write(template.render(path, template_values)) 
 def get(self):
     user_info = AuthenticatedRequestHandler.authenticate_user(self)
     if user_info:
         template_values = {
             'title': 'Settings',
             'page': 'settings',
             'nickname': user_info[0],
             'logout_url': user_info[1]
         }
         path = os.path.join(os.path.dirname(__file__), 'template.html')
         self.response.out.write(template.render(path, template_values))        
Exemple #3
0
 def get(self):
     user_info = AuthenticatedRequestHandler.authenticate_user(self)
     if user_info:
         template_values = {
             'title': 'Ticket Prices',
             'page': 'prices',            
             'nickname': user_info[0],
             'logout_url': user_info[1],
             'prices': [{'since': 'start', 'prices': [400, 300, 300]}, {'since': 'June', 'prices': [100, 200, 300]}]
         }
         path = os.path.join(os.path.dirname(__file__), 'template.html')
         self.response.out.write(template.render(path, template_values))        
Exemple #4
0
    def get(self):
        user_info = AuthenticatedRequestHandler.authenticate_user(self)
        if user_info:
            imported = importer.import_data()
            users = imported['users']
            prices = imported['prices']
            days = imported['days']

            template_values = {
                'title': 'Group Schedule',
                'page': 'group',
                'nickname': user_info[0],
                'logout_url': user_info[1],
                'users': users,
                'prices': prices,
                'days': days,
            }

            path = os.path.join(os.path.dirname(__file__), 'template.html')
            self.response.out.write(template.render(path, template_values))