Exemplo n.º 1
0
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())
Exemplo n.º 2
0
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())
Exemplo n.º 3
0
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')
Exemplo n.º 4
0
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())
Exemplo n.º 5
0
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)
Exemplo n.º 6
0
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)
Exemplo n.º 7
0
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')
Exemplo n.º 8
0
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)
Exemplo n.º 9
0
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)
Exemplo n.º 10
0
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)
Exemplo n.º 11
0
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)
Exemplo n.º 12
0
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)
Exemplo n.º 13
0
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')
Exemplo n.º 14
0
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)
Exemplo n.º 15
0
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())
Exemplo n.º 16
0
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')
Exemplo n.º 17
0
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())
Exemplo n.º 18
0
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())
Exemplo n.º 19
0
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())