示例#1
0
def courseman_users(req):
    ''' display the list of signups '''
    
    colheaders = [Ci('date'), Ci('firstname'), Ci('lastname'), Ci('email'), Ci('username'), Ci('password')]
    rows_ids = []
    ids = []
    
    next = '/coursemanage/users-post'
    uploadnext = '/coursemanage/uploadcsv-post'
    
    courses = mu.get_courses()
    
    displaysignups = 'none'
    signups = Signup.objects.filter(is_added=False)
    
    if len(signups) > 0:
        displaysignups = ''
        for s in signups:
            row = []
            use_textbox = True
            
            row.append(Ci(s.created.strftime("%Y%m%d")))
            row.append(Ci(s.firstname, txt=use_textbox, header='firstname'))
            row.append(Ci(s.lastname, txt=use_textbox, header='lastname'))
            row.append(Ci(s.email, txt=use_textbox, header='email'))
            row.append(Ci(s.username, txt=use_textbox, header='username'))
            row.append(Ci(s.password, header='passwd'))
            row.append(Ci('delete', btn=True))
            
            rows_ids.append([row, str(s.id)])
            ids.append(s.id)
    
    return render(req, 'course_enroll.html', _cmdict(req, next='', dict={'colheaders' : colheaders, 'rows_ids' : rows_ids, 'ids' : ids, 'next' : next, 'uploadnext' : uploadnext, 'displaysignups' : displaysignups, 'courses' : courses}))
示例#2
0
def courseman_templates(req):
    ''' display template creation form, including existing templates and courses '''
    courses = mu.get_courses()
    templates = mu.get_templates()
    
    return render(req, 'course_template.html', _cmdict(req, next='/coursemanage/templates-post', dict={'courses' : courses, 'templates' : templates}))