def sign_out_act(): act_id = request.data enrolled = GK.get_act_detail(act_id.decode(), session['u_id']) if enrolled: GK.sign_out_act(act_id.decode(), session['u_id']) rs = GK.get_act_detail(act_id.decode(), session['u_id']) return json.dumps(rs, ensure_ascii=False, indent=4) return json.dumps({'error': True}, ensure_ascii=False, indent=4)
def sign_in_act(): if not session.get('logged', None): return redirect('/login') act_id = request.data enrolled = GK.get_act_detail(act_id.decode(), session['u_id']) if enrolled: GK.sign_activity(act_id.decode(), session['u_id']) rs = GK.get_act_detail(act_id.decode(), session['u_id']) return json.dumps(rs, ensure_ascii=False, indent=4) return json.dumps({'error': True}, ensure_ascii=False, indent=4)
def act_detail_stu(act): # if not session.get('logged', None): # return redirect('/login') act_id = request.data rs = GK.get_act_detail(act, session['u_id']) return json.dumps(rs, ensure_ascii=False, indent=4)
def act_detail(act_id): act_list = GK.get_act_detail(act_id) act_info = GK.get_act_info(act_id) return render_template('act_detail.html', act_list=enumerate(act_list), act_info=act_info)