def issue(): id = int(request.vars.id[-1]) student = db.person.with_alias('student') peer_support = db.person.with_alias('peer_support') if id: issue = db(db.student_issue.id == id).select( db.student_issue.ALL, student.ALL, peer_support.ALL, db.crew.ALL, join=[ student.on(student.id == db.student_issue.person_id), peer_support.on(peer_support.id == db.student_issue.ps_id) ], left=db.crew.on(db.student.crew == db.crew.id)).first() if issue: return dict(issue=issue, ctr_enabled=ctr_enabled, active_module='peersupport', ctr_data=get_ctr_data()) return dict(issue=None, ctr_enabled=ctr_enabled, active_module='peersupport', ctr_data=get_ctr_data())
def follow_up(): id = int(request.vars.id[-1]) db.student_issue.id.readable = False db.student_issue.person_id.writable = False db.student_issue.person_id.represent = lambda row: ' '.join( [row.first_name, row.last_name]) db.student_issue.ps_id.writable = False db.student_issue.ps_id.represent = lambda row: ' '.join( [row.first_name, row.last_name]) db.student_issue.result.writable = False db.student_issue.summary.writable = False db.student_issue.result.label = 'Result of Campus Walk' form = SQLFORM( db.student_issue, id, fields=['person_id', 'ps_id', 'summary', 'result', 'follow_up'], formstyle='table2cols') if form.process( next=URL(a='javelin', c='peersupport', f='index')).accepted: db(db.student_issue.id == id).update(need_follow_up=False) response.flash = 'The issue has been submitted!' elif form.errors: response.flash = 'There are errors in the form' return dict(form=form, ctr_enabled=ctr_enabled, active_module='peersupport', ctr_data=get_ctr_data())
def index(): """Loads the index page for the 'Messages' controller :returns: a dictionary to pass to the view with the list of modules_enabled and the active module ('messages') """ ctr_data = get_ctr_data() return dict(ctr_enabled=ctr_enabled, ctr_data=ctr_data, active_module='messages')
def index(): """Loads the index page for the 'Scores' controller :returns: a dictionary to pass to the view with the list of modules_enabled, the active module ('scores') and a dynamic form """ ctr_data = get_ctr_data() return dict(ctr_enabled=ctr_enabled, active_module="scores", ctr_data=ctr_data, crews=data())
def index(): """Loads the index page for the 'People' controller :returns: a dictionary to pass to the view with the list of modules_enabled, the active module ('people') and a dynamic form """ ctr_data = get_ctr_data() return dict(ctr_enabled=ctr_enabled, active_module='people', ctr_data=ctr_data)
def index(): """Loads the index page for the 'Orientation' controller :returns: a dictionary to pass to the view with the list of modules_enabled and the active module ('orientation') """ ctr_data = get_ctr_data() existing_nametags = db().select(db.file.ALL) return dict(ctr_enabled=ctr_enabled, ctr_data=ctr_data, active_module='orientation', existing_nametags=existing_nametags)
def index(): """Loads the index page for the 'Events' controller :returns: a dictionary to pass to the view with the list of modules_enabled and the active module ('events') """ return dict(ctr_enabled=ctr_enabled, ctr_data=get_ctr_data(), active_module='events')
def index(): """Loads the index page for the 'Admin' controller :returns: a dictionary to pass to the view with the list of ctr_enabled and the active module ('admin') """ ctr_data = get_ctr_data() users = db().select(db.auth_user.ALL) approvals = db(db.auth_user.registration_key=='pending').select(db.auth_user.ALL) return dict(ctr_enabled=ctr_enabled, ctr_data=ctr_data, active_module='jadmin', users=users, approvals=approvals, doctypes=DOC_TYPES)
def index(): """Loads the index page for the 'Groups' controller :returns: a dictionary to pass to the view with the list of modules_enabled, the active module ('groups') and the labels for 'groups' """ ctr_data = get_ctr_data() return dict(ctr_enabled=ctr_enabled, active_module='groups', labels=ctr_data['groups']['labels'], ctr_data=ctr_data)
def index(): """ example action using the internationalization operator T and flash rendered by views/default/index.html or views/generic.html if you need a simple wiki simple replace the two lines below with: return auth.wiki() """ ctr_data = get_ctr_data() return dict(ctr_enabled=ctr_enabled, active_module='None', ctr_data=ctr_data)
def index(): student = db.person.with_alias('student') peer_support = db.person.with_alias('peer_support') issues = db().select(db.student_issue.ALL, student.ALL, peer_support.ALL, db.crew.ALL, join=[student.on(student.id==db.student_issue.person_id), peer_support.on(peer_support.id==db.student_issue.ps_id)], left=db.crew.on(db.student.crew==db.crew.id)) reports = db(db.file.name.contains("Peer_Support")).select(db.file.ALL) return dict(issues=issues, reports=reports, ctr_enabled=ctr_enabled, ctr_data=get_ctr_data(), active_module='peersupport')
def index(): """Loads the index page for the 'Admin' controller :returns: a dictionary to pass to the view with the list of ctr_enabled and the active module ('admin') """ ctr_data = get_ctr_data() users = db().select(db.auth_user.ALL) approvals = db(db.auth_user.registration_key == 'pending').select( db.auth_user.ALL) return dict(ctr_enabled=ctr_enabled, ctr_data=ctr_data, active_module='jadmin', users=users, approvals=approvals, doctypes=DOC_TYPES)
def new_issue(): form = SQLFORM(db.student_issue, fields=[ 'person_id', 'ps_id', 'summary', 'result', 'need_follow_up', 'refer' ], formstyle='divs') if form.process( next=URL(a='javelin', c='peersupport', f='index')).accepted: response.flash = 'The issue has been submitted!' elif form.errors: response.flash = 'There are errors in the form' return dict(form=form, ctr_enabled=ctr_enabled, active_module='peersupport', ctr_data=get_ctr_data())
def index(): student = db.person.with_alias('student') peer_support = db.person.with_alias('peer_support') issues = db().select( db.student_issue.ALL, student.ALL, peer_support.ALL, db.crew.ALL, join=[ student.on(student.id == db.student_issue.person_id), peer_support.on(peer_support.id == db.student_issue.ps_id) ], left=db.crew.on(db.student.crew == db.crew.id)) reports = db(db.file.name.contains("Peer_Support")).select(db.file.ALL) return dict(issues=issues, reports=reports, ctr_enabled=ctr_enabled, ctr_data=get_ctr_data(), active_module='peersupport')
def follow_up(): id = int(request.vars.id[-1]) db.student_issue.id.readable = False db.student_issue.person_id.writable = False db.student_issue.person_id.represent = lambda row: ' '.join([row.first_name, row.last_name]) db.student_issue.ps_id.writable = False db.student_issue.ps_id.represent = lambda row: ' '.join([row.first_name, row.last_name]) db.student_issue.result.writable = False db.student_issue.summary.writable = False db.student_issue.result.label = 'Result of Campus Walk' form = SQLFORM(db.student_issue, id, fields=['person_id', 'ps_id', 'summary', 'result', 'follow_up'], formstyle='table2cols') if form.process(next=URL(a='javelin', c='peersupport', f='index')).accepted: db(db.student_issue.id==id).update(need_follow_up=False) response.flash = 'The issue has been submitted!' elif form.errors: response.flash = 'There are errors in the form' return dict(form=form, ctr_enabled=ctr_enabled, active_module='peersupport', ctr_data=get_ctr_data())
def issue(): id = int(request.vars.id[-1]) student = db.person.with_alias('student') peer_support = db.person.with_alias('peer_support') if id: issue = db(db.student_issue.id==id).select(db.student_issue.ALL, student.ALL, peer_support.ALL, db.crew.ALL, join=[student.on(student.id==db.student_issue.person_id), peer_support.on(peer_support.id==db.student_issue.ps_id)], left=db.crew.on(db.student.crew==db.crew.id)).first() if issue: return dict(issue=issue, ctr_enabled=ctr_enabled, active_module='peersupport', ctr_data=get_ctr_data()) return dict(issue=None, ctr_enabled=ctr_enabled, active_module='peersupport', ctr_data=get_ctr_data())
def new_issue(): form = SQLFORM(db.student_issue, fields=['person_id', 'ps_id', 'summary', 'result', 'need_follow_up', 'refer'], formstyle='divs') if form.process(next=URL(a='javelin', c='peersupport', f='index')).accepted: response.flash = 'The issue has been submitted!' elif form.errors: response.flash = 'There are errors in the form' return dict(form=form, ctr_enabled=ctr_enabled, active_module='peersupport', ctr_data=get_ctr_data())