コード例 #1
0
ファイル: landing.py プロジェクト: pabloodero/GTangaza
 def get(self):
     view_info = self.request.path_info.split('/')
     values = defaultValues()
     user = users.get_current_user()
     email = user.email()
     domain = ops.getDomainFromEmail(email)
     isAdministrator = ops.isAdministrator(email)
     values['isAdministrator'] = isAdministrator
     values['subdomains'] = ops.getSubdomains(ops.getDomainFromEmail(email))
     if len(view_info)<3:
         return
     view = view_info[2]
     if view == 'events':
         category = self.request.get('q',None)
         wireframe = 'events'
         values['events'] = ops.getEvents(domain,category)
         values['categories'] = ops.getCategories()
         values['subscribedCategories'] = ops.getSubscribedCategories(email)
         values['title'] = 'Events:  %s ' % category
     elif view == 'search_events':
         eventTitle = self.request.get('q',None)
         wireframe = 'events'
         values['events'] = ops.getEventsFromTitle(domain, eventTitle)
         values['categories'] = ops.getCategories()
         values['title'] = 'Event: %s ' % eventTitle
     elif view =='settings':
         values['categories'] = ops.getCategories()
         values['subscribedCategories'] = ops.getSubscribedCategories(email)
         values['title'] = 'Change Settings'
         values['mobileNumber'] = ops.getMobileNumber(email)
         wireframe = 'settings'
     app_path = os.path.join(DIRECTORY, os.path.join('templates', '%s.html' % wireframe))
     values['app'] = template.render(app_path, values, debug=_DEBUG)
     path = os.path.join(TEMPLATES_PATH,'page.html')
     self.response.out.write(template.render(path, values, debug=_DEBUG))
コード例 #2
0
ファイル: landing.py プロジェクト: pabloodero/GTangaza
 def get(self):
     category = self.request.get('q',None)
     user = users.get_current_user()
     email = user.email()
     domain = ops.getDomainFromEmail(email)
     isAdministrator = ops.isAdministrator(email)
     if ops.isDomainRegistered(domain):
         values = defaultValues()
         values['isAdministrator']= isAdministrator
         values['events'] = ops.getEvents(domain,category)
         values['categories'] = ops.getCategories()
         values['subscribedCategories'] = ops.getSubscribedCategories(email)
         wireframe = 'events'
         app_path = os.path.join(DIRECTORY, os.path.join('templates', '%s.html' % wireframe))
         values['app'] = template.render(app_path, values, debug=_DEBUG)
         path = os.path.join(TEMPLATES_PATH,'page.html')
         self.response.out.write(template.render(path, values, debug=_DEBUG))
     else:
         values = defaultValues()
         path = os.path.join(TEMPLATES_PATH,'signup.html')
         self.response.out.write(template.render(path, values, debug=_DEBUG))
コード例 #3
0
 def get(self):
     view_info = self.request.path_info.split('/')
     values = defaultValues()
     user = users.get_current_user()
     email = user.email()
     domain = ops.getDomainFromEmail(email)
     isAdministrator = ops.isAdministrator(email)
     values['isAdministrator'] = isAdministrator
     values['subdomains'] = ops.getSubdomains(ops.getDomainFromEmail(email))
     if len(view_info) < 3:
         return
     view = view_info[2]
     if view == 'events':
         category = self.request.get('q', None)
         wireframe = 'events'
         values['events'] = ops.getEvents(domain, category)
         values['categories'] = ops.getCategories()
         values['subscribedCategories'] = ops.getSubscribedCategories(email)
         values['title'] = 'Events:  %s ' % category
     elif view == 'search_events':
         eventTitle = self.request.get('q', None)
         wireframe = 'events'
         values['events'] = ops.getEventsFromTitle(domain, eventTitle)
         values['categories'] = ops.getCategories()
         values['title'] = 'Event: %s ' % eventTitle
     elif view == 'settings':
         values['categories'] = ops.getCategories()
         values['subscribedCategories'] = ops.getSubscribedCategories(email)
         values['title'] = 'Change Settings'
         values['mobileNumber'] = ops.getMobileNumber(email)
         wireframe = 'settings'
     app_path = os.path.join(
         DIRECTORY, os.path.join('templates', '%s.html' % wireframe))
     values['app'] = template.render(app_path, values, debug=_DEBUG)
     path = os.path.join(TEMPLATES_PATH, 'page.html')
     self.response.out.write(template.render(path, values, debug=_DEBUG))
コード例 #4
0
 def get(self):
     category = self.request.get('q', None)
     user = users.get_current_user()
     email = user.email()
     domain = ops.getDomainFromEmail(email)
     isAdministrator = ops.isAdministrator(email)
     if ops.isDomainRegistered(domain):
         values = defaultValues()
         values['isAdministrator'] = isAdministrator
         values['events'] = ops.getEvents(domain, category)
         values['categories'] = ops.getCategories()
         values['subscribedCategories'] = ops.getSubscribedCategories(email)
         wireframe = 'events'
         app_path = os.path.join(
             DIRECTORY, os.path.join('templates', '%s.html' % wireframe))
         values['app'] = template.render(app_path, values, debug=_DEBUG)
         path = os.path.join(TEMPLATES_PATH, 'page.html')
         self.response.out.write(template.render(path, values,
                                                 debug=_DEBUG))
     else:
         values = defaultValues()
         path = os.path.join(TEMPLATES_PATH, 'signup.html')
         self.response.out.write(template.render(path, values,
                                                 debug=_DEBUG))