Commit 796a568895dc58a39939b2d05b418e4861f599c9

Authored by hitier
1 parent 083ac872

Add % sign in charge columns

app/commands/commands.py
... ... @@ -131,6 +131,8 @@ def feed_from_irap(csv_file_name):
131 131 for period_name in range(2011, 2030):
132 132 t = Period.query.filter(Period.name == period_name).one()
133 133 charge = r[f"{period_name}"]
  134 + # Charge are stored as percent in db, but as fraction of ETP in irap csv
  135 + # we make the conversion here.
134 136 try:
135 137 charge = int(100 * float(charge))
136 138 except ValueError:
... ...
app/main/templates/agent.html
... ... @@ -17,8 +17,12 @@
17 17 <tbody>
18 18 {% for line in charges[1:] %}
19 19 <tr>
20   - {% for cell in line %}
21   - <td>{{cell}}</td>
  20 + {% for i in range(line|length) %}
  21 + {%if 'Charge' in charges[0][i] %}
  22 + <td>{{line[i]}} %</td>
  23 + {%else%}
  24 + <td>{{line[i]}}</td>
  25 + {%endif%}
22 26 {% endfor %}
23 27 </tr>
24 28 {% endfor %}
... ...
app/main/templates/agents.html
... ... @@ -15,7 +15,7 @@
15 15 {{ agent.firstname }}
16 16 {{ agent.secondname }}
17 17 </a></td>
18   - <td>{{agent.total_charge}}</td>
  18 + <td>{{agent.total_charge}} %</td>
19 19 <td>{{agent.num_projects}}</td>
20 20 </tr>
21 21 {% endfor %}
... ...
app/main/templates/projects.html
... ... @@ -13,9 +13,7 @@
13 13 <td><a href="{{url_for('main.project', project_id=project.id)}}">
14 14 {{ project.name }}</a>
15 15 </td>
16   - <td>
17   - {{ project.total_charge }}</a>
18   - </td>
  16 + <td>{{ project.total_charge }} % </td>
19 17 </tr>
20 18 {% endfor %}
21 19 </tbody>
... ...