SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit dfcb424a authored by George Katsikas's avatar George Katsikas :goat:
Browse files

refactor worklog summary table

parent 11d2aa07
No related branches found
No related tags found
No related merge requests found
{% load scipost_extras %}
<table class="table table-hover text-nowrap">
<thead class="table-light">
<tr>
<th>Employee</th>
{% for month in logs_filter_form.get_months %}<th colspan="2" scope="colgroup">{{ month|date:'N Y' }}</th>{% endfor %}
</tr>
</thead>
<tbody>
{% for user_data in logs_filter_form.filter_per_month %}
<tr>
<td>{{ user_data.user.contributor }}</td>
{% for _, total_time, monthly_salary in user_data.monthly_data %}
<td>{{ total_time|duration }}</td>
<td>€{{ monthly_salary|floatformat:0 }}</td>
{% endfor %}
</tr>
{% empty %}
<tr>
<td colspan="5">No logs found.</td>
</tr>
{% endfor %}
</tbody>
</table>
...@@ -32,29 +32,7 @@ ...@@ -32,29 +32,7 @@
{% if form.is_bound and form.is_valid %} {% if form.is_bound and form.is_valid %}
<h2 class="mb-2 mt-4">Team timesheets</h2> <h2 class="mb-2 mt-4">Team timesheets</h2>
<h4 class="mb-1">{{ user_log.user.first_name }} {{ user_log.user.last_name }}</h4> <h4 class="mb-1">{{ user_log.user.first_name }} {{ user_log.user.last_name }}</h4>
<table class="table table-hover text-nowrap"> {% include "finances/_worklog_summary_table.html" with logs_filter_form=form %}
<thead class="table-light">
<tr>
<th>Employee</th>
{% for month in form.get_months %}<th colspan="2" scope="colgroup">{{ month|date:'N Y' }}</th>{% endfor %}
</tr>
</thead>
<tbody>
{% for user_data in form.filter_per_month %}
<tr>
<td>{{ user_data.user.contributor }}</td>
{% for _, total_time, monthly_salary in user_data.monthly_data %}
<td>{{ total_time|duration }}</td>
<td>€{{ monthly_salary|floatformat:0 }}</td>
{% endfor %}
</tr>
{% empty %}
<tr>
<td colspan="5">No logs found.</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %} {% else %}
<p class="text-danger">First submit the filter form to retrieve results.</p> <p class="text-danger">First submit the filter form to retrieve results.</p>
{% endif %} {% endif %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment