Commit cd139aed authored by Elger Jonker's avatar Elger Jonker Committed by Elger Jonker

fix for charts, with option to expand the list

parent 06a38e3b
Pipeline #28252127 passed with stages
in 21 minutes and 27 seconds
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-20 09:29+0000\n"
"POT-Creation-Date: 2018-08-20 09:59+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-20 09:29+0000\n"
"POT-Creation-Date: 2018-08-20 09:59+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-20 09:29+0000\n"
"POT-Creation-Date: 2018-08-20 09:59+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-20 09:29+0000\n"
"POT-Creation-Date: 2018-08-20 09:59+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-20 09:29+0000\n"
"POT-Creation-Date: 2018-08-20 09:59+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-20 09:29+0000\n"
"POT-Creation-Date: 2018-08-20 09:59+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
......
This diff is collapsed.
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-20 09:29+0000\n"
"POT-Creation-Date: 2018-08-20 09:59+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
......@@ -18,8 +18,8 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
#: failmap/map/static/js/failmap.js:56 failmap/map/static/js/views.js:684
#: failmap/map/static/js/views.js:689 failmap/map/static/js/views.js:692
#: failmap/map/static/js/failmap.js:56 failmap/map/static/js/views.js:693
#: failmap/map/static/js/views.js:698 failmap/map/static/js/views.js:701
msgid "View Full Screen"
msgstr ""
......@@ -362,10 +362,8 @@ msgid "report_header_DNSSEC"
msgstr "DNSSEC"
#: failmap/map/static/js/script.js:64
#, fuzzy
#| msgid "report_header_plain_https"
msgid "report_header_ftp"
msgstr "Missing transport encryption"
msgstr "Missing file transfer (FTP) encryption"
#: failmap/map/static/js/script.js:67
msgid "category_menu_municipality"
......@@ -1867,7 +1865,7 @@ msgstr "medium"
msgid "score low"
msgstr "low"
#: failmap/map/static/js/views.js:690
#: failmap/map/static/js/views.js:699
msgid "Exit Full Screen"
msgstr ""
......
This diff is collapsed.
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-20 09:29+0000\n"
"POT-Creation-Date: 2018-08-20 09:59+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
......@@ -18,8 +18,8 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: failmap/map/static/js/failmap.js:56 failmap/map/static/js/views.js:684
#: failmap/map/static/js/views.js:689 failmap/map/static/js/views.js:692
#: failmap/map/static/js/failmap.js:56 failmap/map/static/js/views.js:693
#: failmap/map/static/js/views.js:698 failmap/map/static/js/views.js:701
msgid "View Full Screen"
msgstr "Volledig scherm"
......@@ -1880,7 +1880,7 @@ msgstr "midden"
msgid "score low"
msgstr "laag"
#: failmap/map/static/js/views.js:690
#: failmap/map/static/js/views.js:699
msgid "Exit Full Screen"
msgstr "Sluit volledig scherm"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-20 09:29+0000\n"
"POT-Creation-Date: 2018-08-20 09:59+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
......@@ -18,8 +18,8 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: failmap/map/static/js/failmap.js:56 failmap/map/static/js/views.js:684
#: failmap/map/static/js/views.js:689 failmap/map/static/js/views.js:692
#: failmap/map/static/js/failmap.js:56 failmap/map/static/js/views.js:693
#: failmap/map/static/js/views.js:698 failmap/map/static/js/views.js:701
msgid "View Full Screen"
msgstr "🌈"
......@@ -1867,7 +1867,7 @@ msgstr "🌈"
msgid "score low"
msgstr "🌈"
#: failmap/map/static/js/views.js:690
#: failmap/map/static/js/views.js:699
msgid "Exit Full Screen"
msgstr "🌈"
......
......@@ -303,7 +303,8 @@ const top_mixin = {
},
data: {
data: Array,
data: Array, // a short list of 10 items.
fulldata: Array, // a much larger list.
columns: ['rank', 'high', 'medium', 'low', 'organization_id'],
sortKey: '',
metadata: {},
......@@ -328,13 +329,21 @@ const top_mixin = {
let self = this;
$.getJSON(this.$data.data_url + this.country + '/' + this.category + '/' + weeknumber, function (data) {
self.data = data.ranking;
self.data = data.ranking.slice(0,10);
self.fulldata = data.ranking;
self.metadata = data.metadata;
});
},
sortBy: function (key) {
this.sortKey = key;
this.sortOrders[key] = this.sortOrders[key] * -1
},
swapFull: function(){
console.log('swap');
temp = Array;
temp = this.data;
this.data = this.fulldata;
this.fulldata = temp;
}
},
computed: {
......
......@@ -206,6 +206,8 @@
</div>
<div class="row">
{% include "map/topfail.html" %}
</div>
<div class="row">
{% include "map/topwin.html" %}
</div>
</div>
......
{% load static %} {% load i18n %}
<div class="col-md-6">
<div class="col-md-12">
<div id="topfail">
<h3>{% trans "Top Fail" %}</h3>
......@@ -7,6 +7,10 @@
<p v-if="metadata">{% trans "This is the top fail from" %} {% verbatim %}{{
humanize(metadata.data_from_time) }}{% endverbatim %}</p>
<span role="button" class="btn btn-info btn-sm" v-on:click="swapFull()">
<i class='fas fa-plus-square'></i> {% trans "Expand/shorten list" %}
</span>
<table class="table table-striped" id="topfail_table">
<thead>
<tr>
......@@ -31,7 +35,7 @@
{% verbatim %}
<tr v-for='rank in filteredData'>
<td>{{ rank['rank'] }}</td>
<td><a v-on:click="showReport(rank.organization_id)">{{ rank['organization_name'] }}</a></td>
<td><a v-on:click="showReport(rank.organization_id)">🔍 {{ rank['organization_name'] }}</a></td>
<td>{{ rank['high'] }}</td>
<td>{{ rank['medium'] }}</td>
<td>{{ rank['low'] }}</td>
......
{% load static %} {% load i18n %}
<div class="col-md-6">
<div class="col-md-12">
<div id="topwin">
<h3>{% trans "Top Win!" %}</h3>
<p v-if="metadata">{% trans "This is the top win from" %} {% verbatim %}{{ humanize(metadata.data_from_time)
}}{% endverbatim %}</p>
<span role="button" class="btn btn-info btn-sm" v-on:click="swapFull()">
<i class='fas fa-plus-square'></i> {% trans "Expand/shorten list" %}
</span>
<table class="table table-striped" id="topwin_table">
<thead>
<tr>
......@@ -30,7 +35,7 @@
{% verbatim %}
<tr v-for='rank in filteredData'>
<td>{{ rank['rank'] }}</td>
<td><a v-on:click="showReport(rank['organization_id'])">{{ rank['organization_name'] }}</a></td>
<td><a v-on:click="showReport(rank['organization_id'])">🔍 {{ rank['organization_name'] }}</a></td>
<td>{{ rank['high'] }}</td>
<td>{{ rank['medium'] }}</td>
<td>{{ rank['low'] }}</td>
......
......@@ -552,7 +552,7 @@ def top_fail(request, country: str="NL", organization_type="municipality", weeks
GROUP BY organization.name
HAVING high > 0 or medium > 0
ORDER BY `high` DESC, `medium` DESC, `medium` DESC, `organization`.`name` ASC
LIMIT 10
LIMIT 500
''' % {"when": when, "OrganizationTypeId": get_organization_type(organization_type),
"country": get_country(country)}
......@@ -631,7 +631,7 @@ def top_win(request, country: str="NL", organization_type="municipality", weeks_
GROUP BY organization.name
HAVING high = 0 AND medium = 0
ORDER BY low ASC, LENGTH(`calculation`) DESC, `organization`.`name` ASC
LIMIT 10
LIMIT 500
''' % {"when": when, "OrganizationTypeId": get_organization_type(organization_type),
"country": get_country(country)}
cursor.execute(sql)
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-20 09:29+0000\n"
"POT-Creation-Date: 2018-08-20 09:59+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-20 09:29+0000\n"
"POT-Creation-Date: 2018-08-20 09:59+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-20 09:29+0000\n"
"POT-Creation-Date: 2018-08-20 09:59+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-20 09:29+0000\n"
"POT-Creation-Date: 2018-08-20 09:59+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-20 09:29+0000\n"
"POT-Creation-Date: 2018-08-20 09:59+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-20 09:29+0000\n"
"POT-Creation-Date: 2018-08-20 09:59+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment