Skip to content

Commit

Permalink
Refactor report queues
Browse files Browse the repository at this point in the history
  • Loading branch information
epou committed Jan 3, 2025
1 parent 029dd18 commit 168421f
Show file tree
Hide file tree
Showing 20 changed files with 1,025 additions and 1,659 deletions.
2 changes: 1 addition & 1 deletion stats/static/stats/global_assignments.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ $(function () {
createGaugeChart(data[i].ns_country_code + '_unassigned',data[i].unassigned,'Unassigned reports','unassigned');
createGaugeChart(data[i].ns_country_code + '_progress',data[i].progress,'Reports in progress','progress');
createGaugeChart(data[i].ns_country_code + '_pending',data[i].pending,'Pending reports','pending');
createGaugeChart(data[i].ns_country_code + '_nsblocked',data[i].blocked_ns,'NS queue','ns queue');
createGaugeChart(data[i].ns_country_code + '_reserved',data[i].reserved,'Reserved for supervisor only','reserved');
}


Expand Down
43 changes: 22 additions & 21 deletions stats/templates/stats/global_assignments.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,34 +53,35 @@
</div>

<div style="margin-top:60px"></div>
{% with is_superexpert=user.userstat.is_superexpert %}
<div class="container-custom">
<div class="row solid-border">
<div class="col-md-6">
<p><h3>Category description:</h3></p>
<p><strong>Reserved reports</strong></p>
<p>Reports reserved for national supervisors to validate first based on country-specific exclusivity days.</p>
<p><strong>Unassigned reports</strong></p>
<p>Unassigned reports are reports that have not been yet assigned to any expert. Reports which are hidden or missing pictures are not included in this count.</p>
<p>Unassigned reports pertain to those not yet allocated to any expert, excluding those reserved for the supervisor. Additionally, reports with hidden or missing pictures are not counted in this category.</p>
<p><strong>Reports in progress</strong></p>
<p>Reports in progress are reports which have not yet been assigned to at least 3 experts. Therefore, they are considered work in progress. This count excludes unassigned reports.</p>
<p><strong>Pending reports</strong></p>
<p>This is the total pending (assigned but not yet validated) reports for the users of the current country. These users include the national supervisor of the current country.</p>
<p><strong>Reports in National Supervisor queue</strong></p>
<p>Reports that are currently in the exclusivity period for the National Supervisor (and therefore not available to regular users), and NS has not yet claimed them</p>
{% if user.userstat.is_superexpert %}
{% if is_superexpert %}
<p><strong>Blocked reports</strong></p>
<p>Number of reports which have been claimed by experts and not validated for more than <b>{{ days }}</b> days.</p>
{% endif %}
</div>
<div class="col-md-6">
<p><h3>Summary stats:</h3></p>
<p><strong>Total reports reserved for supervisors:</strong></p>
<p><h3>{{ summary.total_reserved }}</h3></p>
<p><strong>Total unassigned reports:</strong></p>
<p><h3>{{ summary.total_unassigned }}</h3></p>
<p><strong>Total in progress reports:</strong></p>
<p><h3>{{ summary.total_progress }}</h3></p>
<p><strong>Total pending reports:</strong></p>
<p><h3>{{ summary.total_pending }}</h3></p>
<p><strong>Total reports in National Supervisor queue:</strong></p>
<p><h3>{{ summary.total_blocked_ns }}</h3></p>
{% if user.userstat.is_superexpert %}
{% if is_superexpert %}
<p><strong>Total blocked reports:</strong></p>
<p><h3>{{ summary.total_blocked }} {% if summary.total_blocked > 0 %} <a class="btn btn-primary" href="{% url 'report_expiration' %}" target="_blank">Manage blocked for all countries</a> {% endif %}</h3></p>
{% endif %}
Expand All @@ -93,51 +94,50 @@
<div class="col-md-1">
<p><h3>{{ d.ns_country_name }}</h3></p>
<p>National supervisor - {{ d.ns_username }}</p>
<p>Data last update - {{ d.last_update }} (UTC)</p>
</div>
<div class="col-md-11">
<div class="row">
<div class="col-md-2">
<div id="{{ d.ns_country_code }}_unassigned" style="height: 200px; margin: 0 auto"></div>
{% if user.userstat.is_superexpert %}
<div id="{{ d.ns_country_code }}_reserved" style="height: 200px; margin: 0 auto"></div>
{% if is_superexpert %}
<div style="padding-top: 15px;">
<p style="text-align: center;">
<a id="{{ d.ns_country_code }}_unassigned_list" class="btn btn-primary" href="{% url 'global_assignments_list' country_code=d.ns_country_code status='unassigned' %}"><i class="fas fa-list"></i>&nbsp; Unassigned report list</a>
<a id="{{ d.ns_country_code }}_reserved_list" class="btn btn-primary" href="{% url 'global_assignments_list' country_code=d.ns_country_code status='reserved' %}"><i class="fas fa-list"></i>&nbsp; Reports reserved for supervisors</a>
</p>
</div>
{% endif %}
</div>
<div class="col-md-2">
<div id="{{ d.ns_country_code }}_progress" style="height: 200px; margin: 0 auto"></div>
{% if user.userstat.is_superexpert %}
<div id="{{ d.ns_country_code }}_unassigned" style="height: 200px; margin: 0 auto"></div>
{% if is_superexpert %}
<div style="padding-top: 15px;">
<p style="text-align: center;">
<a id="{{ d.ns_country_code }}_progress_list" class="btn btn-primary" href="{% url 'global_assignments_list' country_code=d.ns_country_code status='progress' %}"><i class="fas fa-list"></i>&nbsp; Reports in progress list</a>
<a id="{{ d.ns_country_code }}_unassigned_list" class="btn btn-primary" href="{% url 'global_assignments_list' country_code=d.ns_country_code status='unassigned' %}"><i class="fas fa-list"></i>&nbsp; Unassigned report list</a>
</p>
</div>
{% endif %}
</div>
<div class="col-md-2">
<div id="{{ d.ns_country_code }}_pending" style="height: 200px; margin: 0 auto"></div>
{% if user.userstat.is_superexpert %}
<div id="{{ d.ns_country_code }}_progress" style="height: 200px; margin: 0 auto"></div>
{% if is_superexpert %}
<div style="padding-top: 15px;">
<p style="text-align: center;">
<a id="{{ d.ns_country_code }}_pending_list" class="btn btn-primary" href="{% url 'global_assignments_list' country_code=d.ns_country_code status='pending' %}" target="_blank"><i class="fas fa-list"></i>&nbsp; Pending reports list</a>
<a id="{{ d.ns_country_code }}_progress_list" class="btn btn-primary" href="{% url 'global_assignments_list' country_code=d.ns_country_code status='progress' %}"><i class="fas fa-list"></i>&nbsp; Reports in progress list</a>
</p>
</div>
{% endif %}
</div>
<div class="col-md-2">
<div id="{{ d.ns_country_code }}_nsblocked" style="height: 200px; margin: 0 auto"></div>
{% if user.userstat.is_superexpert %}
<div id="{{ d.ns_country_code }}_pending" style="height: 200px; margin: 0 auto"></div>
{% if is_superexpert %}
<div style="padding-top: 15px;">
<p style="text-align: center;">
<a id="{{ d.ns_country_code }}_nsblocked_list" class="btn btn-primary" href="{% url 'global_assignments_list' country_code=d.ns_country_code status='nsblocked' %}" target="_blank"><i class="fas fa-list"></i>&nbsp; NS queue list</a>
<a id="{{ d.ns_country_code }}_pending_list" class="btn btn-primary" href="{% url 'global_assignments_list' country_code=d.ns_country_code status='pending' %}" target="_blank"><i class="fas fa-list"></i>&nbsp; Pending reports list</a>
</p>
</div>
{% endif %}
</div>
{% if user.userstat.is_superexpert %}
{% if is_superexpert %}
{% if d.blocked > 0 %}
<div class="col-md-2">
<h4>Blocked reports</h4>
Expand All @@ -151,5 +151,6 @@ <h1>{{ d.blocked }}</h1>
</div>
</div>
{% endfor %}
{% endwith %}
</body>
</html>
Loading

0 comments on commit 168421f

Please sign in to comment.