-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding new functionality of visualizing which reports are related to …
…a specific metric
Showing
5 changed files
with
249 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{% extends 'base.html' %} | ||
{% load static %} | ||
{% load i18n %} | ||
{% block title %}{{ title }}{% endblock %} | ||
{% load metricstags %} | ||
|
||
{% block scripts %} | ||
<script src="https://tools-static.wmflabs.org/cdnjs/ajax/libs/bootstrap-table/1.21.2/bootstrap-table.min.js"></script> | ||
<script src="https://tools-static.wmflabs.org/cdnjs/ajax/libs/bootstrap-table/1.21.2/extensions/mobile/bootstrap-table-mobile.min.js"></script> | ||
<script src="https://tools-static.wmflabs.org/cdnjs/ajax/libs/bootstrap-table/1.21.2/extensions/filter-control/bootstrap-table-filter-control.min.js"></script> | ||
{% endblock %} | ||
{% block styles %} | ||
<link rel="stylesheet" href="https://tools-static.wmflabs.org/cdnjs/ajax/libs/bootstrap/5.2.3/css/bootstrap.min.css"> | ||
<link rel="stylesheet" href="https://tools-static.wmflabs.org/cdnjs/ajax/libs/bootstrap-table/1.21.2/bootstrap-table.min.css"> | ||
<link rel="stylesheet" type="text/css" href="{% static 'css/forms.css' %}"> | ||
{% endblock %} | ||
{% block banner %}{% endblock %} | ||
{% block content %} | ||
<div class="w3-row"> | ||
<div class="w3-container userform" style="background-color: var(--light-color); color:black;"> | ||
<h1>{{ metric.text }}</h1> | ||
{% for metric_goal in values %} | ||
<h2>{{ metric_goal.text }}</h2> | ||
<div class="w3-container"> | ||
<p><b>Goal:</b> {{ metric_goal.goal }}</p> | ||
<p><b>Done:</b> {{ metric_goal.done }}</p> | ||
</div> | ||
<table id="reports_{{ metric.id }}" class="table table-striped table-fixed table-sara metrics_table" | ||
data-mobile-responsive="true" | ||
data-check-on-init="true" | ||
data-filter-control="true"> | ||
<thead> | ||
<tr> | ||
<th data-field="id" data-sortable="true">{% trans "ID" %}</th> | ||
<th data-field="report" data-sortable="true">{% trans "Report" %}</th> | ||
<th data-field="done" data-sortable="true">{% trans "Done" %}</th> | ||
<th data-field="goal" data-sortable="true">{% trans "Goal" %}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for report in metric_goal.reports %} | ||
<tr> | ||
<th scope="row">{{ report.id }}</th> | ||
<td><a title="{% trans 'View' %}" href="{% url 'report:detail_report' report_id=report.id %}">{{ report.description }}</a><br><small>({{ report.initial_date }} - {{ report.end_date }})</small></td> | ||
<td>{{ report.done }}</td> | ||
<td>{{ report.done|perc:metric_goal.goal }}</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
<script> | ||
$(function () { | ||
$('.metrics_table').bootstrapTable(); | ||
}) | ||
|
||
function datesSorter(a, b) { | ||
if (new Date(a) < new Date(b)) return 1; | ||
if (new Date(a) > new Date(b)) return -1; | ||
return 0; | ||
} | ||
|
||
$(function (){ | ||
$('[class*="bootstrap-table-filter-control-"]').wrap("<label style='width: 100%'></label>"); | ||
}) | ||
</script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters