Refactor loading of organization reports.

parent 021c8016
......@@ -217,3 +217,6 @@ msgstr ""
#: failmap_admin/map/templates/map/topwin.html:9
msgid "This is the top win from"
msgstr ""
msgid "Report"
msgstr ""
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-10-20 11:47+0000\n"
"POT-Creation-Date: 2017-11-05 12:39+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"
......@@ -21,37 +21,47 @@ msgstr ""
msgid "About Failmap"
msgstr "Over Faalkaart"
#: failmap_admin/map/templates/map/index.html:5
#: failmap_admin/map/templates/map/index.html:11
msgid "Site Title"
msgstr "Faalkaart - Geeft inzicht in beveiliging."
#: failmap_admin/map/templates/map/index.html:30
#: failmap_admin/map/templates/map/index.html:46
msgid "Toggle navigation"
msgstr "In of uitklappen"
#: failmap_admin/map/templates/map/index.html:35
#: failmap_admin/map/templates/map/index.html:53
#: failmap_admin/map/templates/map/index.html:51
#: failmap_admin/map/templates/map/index.html:80 failmap_admin/map/views.py:60
#: failmap_admin/map/views.py:61
msgid "Fail Map"
msgstr "Faalkaart"
#: failmap_admin/map/templates/map/index.html:39
#: failmap_admin/map/templates/map/index.html:55
msgid "Intro"
msgstr "Introductie"
#: failmap_admin/map/templates/map/index.html:40
#: failmap_admin/map/templates/map/index.html:56
msgid "Numbers"
msgstr "Cijfers"
#: failmap_admin/map/templates/map/index.html:41
#: failmap_admin/map/templates/map/index.html:57
#: failmap_admin/map/templates/map/index.html:289
msgid "Report"
msgstr "Verslag"
#: failmap_admin/map/templates/map/index.html:58
#: failmap_admin/map/templates/map/topfail.html:6
msgid "Top Fail"
msgstr "Top faal"
#: failmap_admin/map/templates/map/index.html:42
#: failmap_admin/map/templates/map/index.html:59
msgid "Explanation"
msgstr "Uitleg"
#: failmap_admin/map/templates/map/index.html:54
#: failmap_admin/map/templates/map/index.html:68
msgid "Admin"
msgstr ""
#: failmap_admin/map/templates/map/index.html:81 failmap_admin/map/views.py:62
msgid "Fail Map Introduction"
msgstr ""
"Faalkaart geeft inzicht in hoe veilig uw gemeente is richting het internet. "
......@@ -59,119 +69,133 @@ msgstr ""
"Het is belangrijk dat dit goed gebeurt omdat hierover ook uw gegevens worden "
"verstuurd."
#: failmap_admin/map/templates/map/index.html:72
#: failmap_admin/map/templates/map/index.html:94
msgid "The Numbers"
msgstr "De Cijfers"
#: failmap_admin/map/templates/map/index.html:100
msgid "Organizations"
msgstr "Organisaties"
#: failmap_admin/map/templates/map/index.html:73
#: failmap_admin/map/templates/map/index.html:101
msgid "Organizations Explained"
msgstr ""
"Organisaties hebben vaak meerdere internet adressen. Alle fouten op deze "
"adressen bij elkaar opgeteld bepalen of de organisatie haar beveiliging op "
"orde heeft."
#: failmap_admin/map/templates/map/index.html:93
#: failmap_admin/map/templates/map/index.html:130
#: failmap_admin/map/templates/map/index.html:121
#: failmap_admin/map/templates/map/index.html:158
msgid "When"
msgstr "Tijdstip"
#: failmap_admin/map/templates/map/index.html:94
#: failmap_admin/map/templates/map/index.html:131
#: failmap_admin/map/templates/map/index.html:122
#: failmap_admin/map/templates/map/index.html:159
msgid "Number"
msgstr "Aantal"
#: failmap_admin/map/templates/map/index.html:95
#: failmap_admin/map/templates/map/index.html:132
#: failmap_admin/map/templates/map/index.html:123
#: failmap_admin/map/templates/map/index.html:160
msgid "Good"
msgstr "Goed"
#: failmap_admin/map/templates/map/index.html:96
#: failmap_admin/map/templates/map/index.html:133
#: failmap_admin/map/templates/map/index.html:124
#: failmap_admin/map/templates/map/index.html:161
msgid "Average"
msgstr "Matig"
#: failmap_admin/map/templates/map/index.html:97
#: failmap_admin/map/templates/map/index.html:134
#: failmap_admin/map/templates/map/index.html:125
#: failmap_admin/map/templates/map/index.html:162
msgid "Bad"
msgstr "Slecht"
#: failmap_admin/map/templates/map/index.html:114
#: failmap_admin/map/templates/map/index.html:142
msgid "Internet addresses"
msgstr "Internet adressen"
#: failmap_admin/map/templates/map/index.html:115
#: failmap_admin/map/templates/map/index.html:143
msgid "Internet addresses Explained"
msgstr ""
"Van de onderstaande adressen hebben we een beveilingsstatus weten te bepalen."
#: failmap_admin/map/templates/map/index.html:153
#: failmap_admin/map/templates/map/index.html:181
msgid "Technical TLS"
msgstr "Integriteit en vertrouwelijkheid"
#: failmap_admin/map/templates/map/index.html:154
#: failmap_admin/map/templates/map/index.html:182
msgid "Technical stats TLS explained"
msgstr ""
"Goede versleuteling garandeert dat informatie niet door anderen gelezen of "
"aangepast kan worden."
#: failmap_admin/map/templates/map/index.html:160
#: failmap_admin/map/templates/map/index.html:195
#: failmap_admin/map/templates/map/index.html:188
#: failmap_admin/map/templates/map/index.html:223
msgid "Technology"
msgstr "Beveiliging"
#: failmap_admin/map/templates/map/index.html:161
#: failmap_admin/map/templates/map/index.html:196
#: failmap_admin/map/templates/map/index.html:189
#: failmap_admin/map/templates/map/index.html:224
msgid "Result"
msgstr "Resultaat"
#: failmap_admin/map/templates/map/index.html:162
#: failmap_admin/map/templates/map/index.html:197
#: failmap_admin/map/templates/map/index.html:190
#: failmap_admin/map/templates/map/index.html:225
msgid "Total"
msgstr "Aantal"
#: failmap_admin/map/templates/map/index.html:188
#: failmap_admin/map/templates/map/index.html:216
msgid "Technical stats headers"
msgstr "Veiligheid inhoud website"
#: failmap_admin/map/templates/map/index.html:189
#: failmap_admin/map/templates/map/index.html:217
msgid "Technical stats headers explained"
msgstr "Of de website diverse aanvallen voorkomt."
#: failmap_admin/map/templates/map/index.html:222
#: failmap_admin/map/templates/map/index.html:250
msgid "Services"
msgstr "Diensten"
#: failmap_admin/map/templates/map/index.html:223
#: failmap_admin/map/templates/map/index.html:251
msgid "Services explained"
msgstr "Een adres kan allerlei diensten aanbieden, waaronder websites."
#: failmap_admin/map/templates/map/index.html:235
#: failmap_admin/map/templates/map/index.html:263
msgid "Services faq"
msgstr "Meer over Diensten"
#: failmap_admin/map/templates/map/index.html:261
#: failmap_admin/map/templates/map/index.html:294
msgid "Show report for organization"
msgstr "Toon verslag voor organisatie"
#: failmap_admin/map/templates/map/index.html:296
#, fuzzy
#| msgid "Organization"
msgid "Select an organization"
msgstr "Selecteer een organisatie"
#: failmap_admin/map/templates/map/index.html:302
msgid "Data from"
msgstr "Gegevens van"
#: failmap_admin/map/templates/map/index.html:262
#: failmap_admin/map/templates/map/index.html:303
#: failmap_admin/map/templates/map/topfail.html:16
#: failmap_admin/map/templates/map/topwin.html:16
#: failmap_admin/map/templates/map/topwin.html:17
msgid "Points"
msgstr "Punten"
#: failmap_admin/map/templates/map/index.html:262
#: failmap_admin/map/templates/map/index.html:303
msgid "congratulations"
msgstr "gefeliciteerd"
#: failmap_admin/map/templates/map/index.html:281
#: failmap_admin/map/templates/map/index.html:327
msgid "Address"
msgstr "Adres"
#: failmap_admin/map/templates/map/index.html:285
#: failmap_admin/map/templates/map/index.html:331
msgid "Since"
msgstr "Sinds"
#: failmap_admin/map/templates/map/index.html:285
#: failmap_admin/map/templates/map/index.html:331
msgid "Last check"
msgstr "Laatste controle"
......@@ -197,13 +221,13 @@ msgstr "Dit zijn de slechtste adressen op"
#: failmap_admin/map/templates/map/terrible_urls.html:14
#: failmap_admin/map/templates/map/topfail.html:14
#: failmap_admin/map/templates/map/topwin.html:14
#: failmap_admin/map/templates/map/topwin.html:15
msgid "Rank"
msgstr "Notering"
#: failmap_admin/map/templates/map/terrible_urls.html:15
#: failmap_admin/map/templates/map/topfail.html:15
#: failmap_admin/map/templates/map/topwin.html:15
#: failmap_admin/map/templates/map/topwin.html:16
msgid "Organization"
msgstr "Organisatie"
......@@ -216,7 +240,7 @@ msgid "This is the top fail from"
msgstr "Dit is de top faal van"
#: failmap_admin/map/templates/map/topfail.html:17
#: failmap_admin/map/templates/map/topwin.html:17
#: failmap_admin/map/templates/map/topwin.html:18
msgid "Tweet"
msgstr ""
......@@ -224,7 +248,7 @@ msgstr ""
msgid "Top Win!"
msgstr "Top Win!"
#: failmap_admin/map/templates/map/topwin.html:9
#: failmap_admin/map/templates/map/topwin.html:10
msgid "This is the top win from"
msgstr "Dit is de top win van"
......@@ -254,9 +278,6 @@ msgstr "Dit is de top win van"
#~ msgid "The Bar"
#~ msgstr "De Balk"
#~ msgid "The Numbers"
#~ msgstr "De Cijfers"
#~ msgid "The Numbers Explained"
#~ msgstr ""
#~ "Deze cijfers geven het verloop van beveiliging weer van de laatste drie "
......
......@@ -359,6 +359,8 @@ var failmap = {
loadmap: function (weeknumber) {
vueMap.loading = true;
$.getJSON('/data/map/' + weeknumber, function (json) {
// make map features (organization data) available to other vues
vueMap.features = json.features;
// if there is one already, overwrite the attributes...
if (failmap.geojson) {
failmap.geojson.eachLayer(function(layer){
......@@ -427,8 +429,9 @@ var failmap = {
// perhaps this should be in the leave fullscreen event handler
vueReport.load(organization_id, vueMap.week);
} else {
vueReport.show_in_browser();
vueReport.load(organization_id, vueMap.week);
// trigger load of organization data and jump to Report view.
vueReport.selected = organization_id;
location.href = '#report';
}
}
};
......@@ -452,6 +455,7 @@ $(document).ready(function () {
loading: false,
week: 0,
selected_organization: -1,
features: null,
},
computed: {
visibleweek: function () {
......@@ -524,12 +528,32 @@ $(document).ready(function () {
twitter_handle: '',
name: "",
urls: Array,
mailto: document.head.querySelector("[name=mailto]").getAttribute('content')
mailto: document.head.querySelector("[name=mailto]").getAttribute('content'),
selected: null
},
filters: {
// you cannot run filters in rawHtml, so this doesn't work.
// therefore we explicitly do this elsewhere
},
computed: {
// load list of organizations from map features
organizations: function(){
if (vueMap.features != null){
return vueMap.features.map(function(feature){
return {
"id": feature.properties.OrganizationID,
"name": feature.properties.OrganizationName,
}
});
}
}
},
watch: {
selected: function(){
// load selected organization id
this.load(this.selected);
}
},
methods: {
colorize: function (points) {
if (points < 199) return "green";
......@@ -902,11 +926,8 @@ $(document).ready(function () {
// if browser contains report anchor with organization id load that organization
let organization_id = RegExp('report-([0-9]+)').exec(location.hash)[1] || undefined;
if (organization_id != undefined){
// trigger rendering initial report html so anchor can be jumped to
vueReport.name = ' ';
// jump to the just rendered content (report anchor)
vueReport.show_in_browser();
vueReport.load(organization_id, vueMap.week);
location.href = '#report';
vueReport.selected = organization_id;
}
});
......@@ -55,6 +55,7 @@
<ul class="nav navbar-nav">
<li><a href="#intro">{% trans "Intro" %}</a></li>
<li><a href="#numbers">{% trans "Numbers" %}</a></li>
<li><a href="#report">{% trans "Report" %}</a></li>
<li><a href="#topfail">{% trans "Top Fail" %}</a></li>
<li><a href="#explanation">{% trans "Explanation" %}</a></li>
</ul>
......@@ -284,12 +285,23 @@
<div class="page-header" id="report">
<a name="report" class="jumptonav"></a>
<div v-if="name">
<div>
<div class="page-header">
<h1><span class="organization_points" v-html="organization_points(points)"></span> {% verbatim %}{{ name }}{% endverbatim %}</h1>
<h1><span class="organization_points"></span>{% trans "Report" %}</h1>
<a href="#" class="backtomap">back to map ↑</a>
</div>
<div>
<div>
{% trans "Show report for organization" %}:
{% verbatim %}
<select v-model="selected">
<option v-for="organization in organizations" v-bind:value="organization.id">
{{ organization.name }}
</option>
</select>
{% endverbatim %}
</div>
<div v-if="selected">
Dit resultaat delen? {% verbatim %}<span v-html="create_twitter_link(name, twitter_handle, points)"></span>{% endverbatim %}<br />
<br />
{% trans "Data from" %}: {% verbatim %}{{ humanize(when) }}{% endverbatim %}<br />
......@@ -328,6 +340,7 @@
</div>
</div>
</div>
</div>
{% endverbatim %}
</div>
</div>
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-10-20 11:47+0000\n"
"POT-Creation-Date: 2017-11-05 12:39+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