Exemplo n.º 1
0
 def get(self):
     uid, insession = attemptlogin(self.request)
     emailid = extractkeyfromrequest(self.request, 'e')
     if emailid is None:
         emailid = ''
     zipcode = extractkeyfromrequest(self.request, 'z')
     if zipcode is None:
         zipcode = ''
     returnvalue = extractkeyfromrequest(self.request, 'r')
     if returnvalue is None:
         returnvalue = 0
     returnvalue = int(returnvalue)
     template_values = {
         'emailid': emailid,
         'zipcode': zipcode,
         'returnvalue': returnvalue,
     }
     header_template_values = buildheadertemplatevalues(insession, uid)
     template_values.update(header_template_values)
     channelpartnersservice = ChannelPartnersService()
     channelpartners = channelpartnersservice.getchannelpartners()
     channelpartner_template_values = buildchannelpartnertemplatevalues(
         insession, channelpartners)
     template_values.update(channelpartner_template_values)
     template = JINJA_ENVIRONMENT.get_template('signup.html')
     self.response.write(template.render(template_values))
Exemplo n.º 2
0
 def _done(self):
     uid, insession = attemptlogin(self.request)
     c = extractkeyfromrequest(self.request, 'c')
     cc = extractkeyfromrequest(self.request, 'cc')
     if c and cc and uid:
         self.redirect('/coursecontent?c=' + str(c) + '&cc=' + str(cc) +
                       '&u=' + uid)
Exemplo n.º 3
0
 def post(self):
     emailid = self.request.get('e')
     uid, insession = attemptlogin(self.request)
     if uid:
         self.redirect('/?u=' + str(uid))
     else:
         self.redirect('/signin?e=' + str(emailid) + '&x=1')
Exemplo n.º 4
0
 def get(self):
     uid, insession = attemptlogin(self.request)
     coursesservice = CoursesService()
     courses = coursesservice.listcourses()
     template_values = {}
     header_template_values = buildheadertemplatevalues(insession, uid)
     template_values.update(header_template_values)
     course_template_values = buildallcoursestemplatevalues(
         insession, courses)
     template_values.update(course_template_values)
     # logging.info('template_values='+str(template_values))
     template = JINJA_ENVIRONMENT.get_template('allcourses.html')
     self.response.write(template.render(template_values))
Exemplo n.º 5
0
 def get(self):
     uid, insession = attemptlogin(self.request)
     returnvalue = extractkeyfromrequest(self.request, 'r')
     hasreturnvalue = True
     if returnvalue is None:
         hasreturnvalue = False
     emailid = extractkeyfromrequest(self.request, 'e')
     template_values = {
         'emailid': emailid,
         'hasreturnvalue': hasreturnvalue,
     }
     header_template_values = buildheadertemplatevalues(insession, uid)
     template_values.update(header_template_values)
     template = JINJA_ENVIRONMENT.get_template('signupstatus.html')
     self.response.write(template.render(template_values))
Exemplo n.º 6
0
 def get(self):
     uid, insession = attemptlogin(self.request)
     coursesservice = CoursesService()
     userservice = UserService()
     emailid = userservice.getemailidforsession(uid)
     usercourses = coursesservice.listusercourses(emailid)
     template_values = {}
     header_template_values = buildheadertemplatevalues(insession, uid)
     template_values.update(header_template_values)
     course_template_values = buildmycoursestemplatevalues(
         insession, uid, usercourses)
     template_values.update(course_template_values)
     template = JINJA_ENVIRONMENT.get_template('mycourses.html?s=' +
                                               str(sessionid))
     self.response.write(template.render(template_values))
Exemplo n.º 7
0
 def get(self):
     uid, insession = attemptlogin(self.request)
     staffservice = StaffService()
     staff = staffservice.getstaff()
     channelpartnersservice = ChannelPartnersService()
     channelpartners = channelpartnersservice.getchannelpartners()
     template_values = {}
     header_template_values = buildheadertemplatevalues(insession, uid)
     template_values.update(header_template_values)
     staff_template_values = buildstafftemplatevalues(insession, staff)
     template_values.update(staff_template_values)
     channelpartner_template_values = buildchannelpartnertemplatevalues(
         insession, channelpartners)
     template_values.update(channelpartner_template_values)
     # logging.error('template_values='+str(template_values))
     template = JINJA_ENVIRONMENT.get_template('about.html')
     self.response.write(template.render(template_values))
Exemplo n.º 8
0
 def get(self):
     uid, insession = attemptlogin(self.request)
     emailid = extractkeyfromrequest(self.request, 'e')
     if emailid is None:
         emailid = ''
     returnvalue = extractkeyfromrequest(self.request, 'r')
     if returnvalue is None:
         returnvalue = 0
     else:
         returnvalue = int(returnvalue)
     template_values = {
         'emailid': emailid,
         'returnvalue': returnvalue,
     }
     header_template_values = buildheadertemplatevalues(insession, uid)
     template_values.update(header_template_values)
     template = JINJA_ENVIRONMENT.get_template('forgot.html')
     self.response.write(template.render(template_values))
Exemplo n.º 9
0
 def get(self):
     uid, insession = attemptlogin(self.request)
     emailid = extractkeyfromrequest(self.request, 'e')
     iserror = extractkeyfromrequest(self.request, 'x') != None
     errormsg = ''
     if iserror:
         errormsg = 'Unable to signin'
     if emailid is None:
         emailid = ''
     template_values = {
         'errormsg': errormsg,
         'emailid': emailid,
         'forgoturl': '/forgot?e=' + str(emailid),
         'forgoturllinktext': 'Forgot Student ID?'
     }
     header_template_values = buildheadertemplatevalues(insession, uid)
     template_values.update(header_template_values)
     template = JINJA_ENVIRONMENT.get_template('signin.html')
     self.response.write(template.render(template_values))
Exemplo n.º 10
0
 def get(self):
     uid, insession = attemptlogin(self.request)
     courseid = extractkeyfromrequest(self.request, 'c')
     coursecontentid = extractkeyfromrequest(self.request, 'cc')
     coursesservice = CoursesService()
     course = coursesservice.getcourse(courseid)
     coursecontents = coursesservice.getcoursecontents(courseid)
     coursehandouts = coursesservice.getcoursehandouts(courseid)
     coursehomeworks = coursesservice.getcoursehomeworks(courseid)
     coursevideos = coursesservice.getcoursevideos(courseid)
     coursestarterpacks = coursesservice.getcoursestarterpacks(courseid)
     coursequizzes = coursesservice.getcoursequizzes(courseid)
     template_values = {}
     header_template_values = buildheadertemplatevalues(insession, uid)
     template_values.update(header_template_values)
     coursecontent_template_values = buildcoursecontenttemplatevalues(
         insession, courseid, coursecontentid, course, coursecontents,
         coursehandouts, coursehomeworks, coursevideos, coursestarterpacks,
         coursequizzes)
     template_values.update(coursecontent_template_values)
     logging.info('template_values=' + str(template_values))
     template = JINJA_ENVIRONMENT.get_template('coursecontent.html')
     self.response.write(template.render(template_values))
Exemplo n.º 11
0
 def post(self):
     uid, insession = attemptlogin(self.request)
     if insession:
         pass
     self._done()