agent.html 1.07 KB
{% extends "base_page.html" %}

{% block more_heads %}
<link href="{{ url_for('main.static', filename='css/charges.css', version=config.VERSION) }}" rel="stylesheet" type="text/css"/>
{% endblock %}

{% block content %}
<div id="projects_chart" class="charge_chart"></div>
<table id="charge_table">
  <thead>
  <tr>
  {% for header in charges[0] %}
    <th>{{header}}</th>
  {% endfor %}
  </tr>
  </thead>
  <tbody>
  {% for line in charges[1:] %}
  <tr>
    {% for i in range(line|length) %}
      {%if  'Charge' in charges[0][i]  %}
        <td>{{line[i]}} %</td>
      {%else%}
        <td>{{line[i]}}</td>
      {%endif%}
    {% endfor %}
  </tr>
  {% endfor %}

  </tbody>
</table>
{% endblock %}


{% block more_scripts %}
{% include 'd3js-includes.html' %}
<script src="{{ url_for('main.static', filename='js/charges.js', version=config.VERSION) }}" type="text/javascript"></script>
<script>
  build_chart("#projects_chart",
      "{{url_for('main.charge_agent_csv', agent_id=agent.id)}}",
      "{{agent.secondname}}"+ " {{agent.firstname}}",
      "project");
</script>
{% endblock %}