Ejemplo n.º 1
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))
Ejemplo n.º 2
0
 def get(self):
     user = users.get_current_user()
     if user:
         email = user.email()
         subdomain = ops.getDomainFromEmail(email)
         isQualityAssurance = ops.isQA(email)
         isAdmin = ops.isAdmin(email)
         isSuperAdmin = ops.isSuperAdmin(email)
         if subdomain != 'jkuat.ac.ke':
             domain = ops.getDomainFromSubdomain(subdomain)
             if domain != 'jkuat':
                 self.redirect('/unauthorized')
         values = defaultValues()
         values['isQualityAssurance'] = isQualityAssurance
         values['isAdmin'] = isAdmin
         values['isSuperAdmin'] = isSuperAdmin
         wireframe = 'registerDepartment'
     else:
         wireframe = 'unauthorised'
         values = {}
         values['login_url'] = users.create_login_url('/')
     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, 'main.html')
     self.response.out.write(template.render(path, values, debug=_DEBUG))
Ejemplo n.º 3
0
    def get(self):
        view_info = self.request.path_info.split('/')
        values = defaultValues()
        user = users.get_current_user()
        email = user.email()
        values['categories'] = ops.getCategories()
        values['subscribedCategories'] = ops.getSubscribedCategories(email)
        values['isAdministrator'] = ops.isAdministrator(email)
        values['subdomains'] = ops.getSubdomains(ops.getDomainFromEmail(email))

        if len(view_info) < 3:
            return

        view = view_info[2]
        if view == 'create_event':
            values['title'] = 'Create an Event'
            wireframe = 'create_event'
        elif view == 'new_category':
            values['title'] = 'Create a new category'
            wireframe = 'new_category'
        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))
Ejemplo n.º 4
0
 def get(self):
     user = users.get_current_user()
     if user:
         email = user.email()
         subdomain = ops.getDomainFromEmail(email)
         isQualityAssurance = ops.isQA(email)
         isAdmin = ops.isAdmin(email)
         isSuperAdmin = ops.isSuperAdmin(email)
         if subdomain != 'jkuat.ac.ke':
             domain = ops.getDomainFromSubdomain(subdomain)
             if domain != 'jkuat':
                 self.redirect('/unauthorized')
         values = defaultValues()
         values['isQualityAssurance'] =  isQualityAssurance
         values['isAdmin'] = isAdmin
         values['isSuperAdmin'] = isSuperAdmin
         wireframe = 'registerDepartment'
     else :
         wireframe = 'unauthorised'
         values =  {}
         values['login_url'] = users.create_login_url('/')
     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,'main.html')
     self.response.out.write(template.render(path, values, debug=_DEBUG))
Ejemplo n.º 5
0
 def get(self):
     user = users.get_current_user()
     emailAddress = user.email()
     domain = ops.getDomainFromEmail(emailAddress)
     category_name = self.request.get('category_name', None)
     category_description = self.request.get('category_description', None)
     ops.addCategory(domain, category_name, category_description)
     self.redirect('/')
Ejemplo n.º 6
0
 def get(self):
     user = users.get_current_user()
     emailAddress = user.email()
     domain = ops.getDomainFromEmail(emailAddress)
     category_name = self.request.get('category_name',None)
     category_description = self.request.get('category_description',None)
     ops.addCategory(domain,category_name, category_description)
     self.redirect('/')
Ejemplo n.º 7
0
 def get(self):
     mobileNumber = self.request.get('mobileNumber', None)
     firstName = self.request.get('firstName', None)
     secondName = self.request.get('lastName', None)
     countryName = self.request.get('countryName', None)
     orgName = self.request.get('orgName', None)
     user = users.get_current_user()
     emailAddress = user.email()
     domain = ops.getDomainFromEmail(emailAddress)
     ops.signUp(emailAddress,domain,mobileNumber,firstName,secondName,countryName)
     ops.addDomain(orgName, domain)
     ops.addSubdomain(orgName,domain)
     self.redirect('/',)
Ejemplo n.º 8
0
 def get(self):
     mobileNumber = self.request.get('mobileNumber', None)
     firstName = self.request.get('firstName', None)
     secondName = self.request.get('lastName', None)
     countryName = self.request.get('countryName', None)
     orgName = self.request.get('orgName', None)
     user = users.get_current_user()
     emailAddress = user.email()
     domain = ops.getDomainFromEmail(emailAddress)
     ops.signUp(emailAddress,domain,mobileNumber,firstName,secondName,countryName)
     ops.addDomain(orgName, domain)
     ops.addSubdomain(orgName,domain)
     self.redirect('/',)
Ejemplo n.º 9
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))
Ejemplo n.º 10
0
    def get(self):
        #ops.addPeriod('2015-3','2015-3')
        #ops.flagApplicant('cs282-9398/2331')
        values = {}
        user = users.get_current_user()
        values['isSuperAdmin'] = False
        values['isAuthorised'] = False
        values['isLogged'] = False
        values['hasApplied'] = False
        values['statusMessage'] = 'No Reapplication'

        if ops.reAppIsOpen():
            values['statusMessage'] = 'Reapplication Open'

        if user:
            email = user.email()
            subdomain = ops.getDomainFromEmail(email)
            isAdmin = ops.isAdmin(email)
            isSuperAdmin = ops.isSuperAdmin(email)
            if subdomain != 'ku.ac.ke':
                domain = ops.getDomainFromSubdomain(subdomain)
                if domain != 'ku':
                    self.redirect('/unauthorized')
            values = defaultValues()
            values['isAdmin'] = isAdmin
            values['isSuperAdmin'] = isSuperAdmin
            values['isAuthorised'] = True
            values['isLogged'] = True
            values['hasApplied'] = ops.hasApplied(email)

            wireframe = 'home'
        else:
            wireframe = 'unauthorised'
            values = {}
            values['login_url'] = users.create_login_url('/')

        if ops.reAppIsOpen():
            values['statusMessage'] = 'Reapplication Open'
        else:
            values['statusMessage'] = 'No Reapplication'

        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, 'index.html')
        self.response.out.write(template.render(path, values, debug=_DEBUG))
Ejemplo n.º 11
0
 def get(self):
     #ops.addPeriod('2015-3','2015-3')
     #ops.flagApplicant('cs282-9398/2331')        
     values =  {}
     user = users.get_current_user()
     values['isSuperAdmin'] = False
     values['isAuthorised'] = False
     values['isLogged'] = False
     values['hasApplied'] = False
     values['statusMessage'] = 'No Reapplication'
     
     if ops.reAppIsOpen():
         values['statusMessage'] = 'Reapplication Open'
     
     if user:
         email = user.email()
         subdomain = ops.getDomainFromEmail(email)
         isAdmin = ops.isAdmin(email)
         isSuperAdmin = ops.isSuperAdmin(email)
         if subdomain != 'ku.ac.ke':
             domain = ops.getDomainFromSubdomain(subdomain)
             if domain != 'ku':
                 self.redirect('/unauthorized')
         values = defaultValues()
         values['isAdmin'] = isAdmin
         values['isSuperAdmin'] = isSuperAdmin
         values['isAuthorised'] = True
         values['isLogged'] = True
         values['hasApplied'] = ops.hasApplied(email)
         
         wireframe = 'home'
     else :
         wireframe = 'unauthorised'
         values =  {}
         values['login_url'] = users.create_login_url('/')
     
     if ops.reAppIsOpen():
         values['statusMessage'] = 'Reapplication Open'
     else:
         values['statusMessage'] = 'No Reapplication'
         
     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,'index.html')
     self.response.out.write(template.render(path, values, debug=_DEBUG))
Ejemplo n.º 12
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))
Ejemplo n.º 13
0
 def get(self):
     view_info = self.request.path_info.split('/')
     values = defaultValues()
     user = users.get_current_user()
     email = user.email()
     values['categories'] = ops.getCategories()
     values['subscribedCategories'] = ops.getSubscribedCategories(email)
     values['isAdministrator'] = ops.isAdministrator(email)
     values['subdomains'] = ops.getSubdomains(ops.getDomainFromEmail(email))
     
     if len(view_info) < 3:
         return
     
     view = view_info[2]
     if view == 'create_event':
         values['title'] = 'Create an Event'
         wireframe = 'create_event'
     elif view == 'new_category':
         values['title'] = 'Create a new category'
         wireframe = 'new_category'
     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))
Ejemplo n.º 14
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))