Commit d9f5cfc9a58cc948c71f5c6368d62347499d7dcc
1 parent
71b91c22
Exists in
master
and in
4 other branches
New agent page dynamically gets agent charge with d3js
Showing
5 changed files
with
39 additions
and
1 deletions
Show diff stats
app/main/routes.py
... | ... | @@ -66,7 +66,14 @@ def charge_add(): |
66 | 66 | |
67 | 67 | |
68 | 68 | @bp.route('/charge/agent/<agent_id>') |
69 | -def charge_user(agent_id): | |
69 | +def charge_agent(agent_id): | |
70 | 70 | resp = make_response(json.dumps(db_mgr.charges_by_agent(agent_id))) |
71 | 71 | resp.headers['Content-Type'] = 'application/json' |
72 | 72 | return resp |
73 | + | |
74 | +@bp.route('/agent/<agent_id>') | |
75 | +def agent(agent_id): | |
76 | + agent = Agent.query.get(int(agent_id)) | |
77 | + return render_template('agent.html', | |
78 | + agent=agent, | |
79 | + subtitle="Fiche agent: {} {}".format(agent.firstname, agent.secondname)) | ... | ... |