Commit 796a568895dc58a39939b2d05b418e4861f599c9
1 parent
083ac872
Exists in
master
and in
4 other branches
Add % sign in charge columns
Showing
4 changed files
with
10 additions
and
6 deletions
Show diff stats
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
app/main/templates/projects.html