Verified Commit f738c760 authored by Elger Jonker's avatar Elger Jonker

faster debugging, language depending on user agent (with poor english), various bugfixes

parent 0a321016
Pipeline #28003907 passed with stages
in 24 minutes and 49 seconds
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-10 10:59+0000\n"
"POT-Creation-Date: 2018-08-15 11:11+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,75 +18,65 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: failmap/game/forms.py:68
msgid "Incorrect secret or team. Try again!"
msgstr ""
#: failmap/game/forms.py:111
#, python-format
msgid ""
"This organization %(organization)s already exists in the database for this "
"group."
#: failmap/game/forms.py:32
msgid "This contest does not exist."
msgstr ""
#: failmap/game/forms.py:193
#, python-format
msgid "Invalid or missing suffix (like .com etc): %(url)s"
msgstr ""
#: failmap/game/forms.py:201
#, python-format
msgid "URL does not resolve (anymore): %(url)s."
#: failmap/game/forms.py:76
msgid "Incorrect secret or team. Try again!"
msgstr ""
#: failmap/game/forms.py:230
#: failmap/game/forms.py:159
#, python-format
msgid ""
"This URL %(url)s is already in the production data for organization "
"%(organization)s"
msgstr ""
#: failmap/game/forms.py:238
#, python-format
msgid "This URL %(url)s is already suggested for organization %(organization)s"
"This organization %(organization)s already exists in the database for this "
"type / layer."
msgstr ""
#: failmap/game/models.py:15
#: failmap/game/models.py:16
msgid "Contest name"
msgstr ""
#: failmap/game/models.py:47
#: failmap/game/models.py:48
msgid "contest"
msgstr ""
#: failmap/game/models.py:48
#: failmap/game/models.py:49
msgid "contests"
msgstr ""
#: failmap/game/models.py:60
#: failmap/game/models.py:61
msgid "Team name"
msgstr ""
#: failmap/game/models.py:83
#: failmap/game/models.py:91
msgid "team"
msgstr ""
#: failmap/game/models.py:84
#: failmap/game/models.py:92
msgid "teams"
msgstr ""
#: failmap/game/models.py:173
#: failmap/game/models.py:190
msgid "organisation submission"
msgstr ""
#: failmap/game/models.py:174
#: failmap/game/models.py:191
msgid "organisation submissions"
msgstr ""
#: failmap/game/models.py:237
#: failmap/game/models.py:256
msgid "url submission"
msgstr ""
#: failmap/game/models.py:238
#: failmap/game/models.py:257
msgid "url submissions"
msgstr ""
#: failmap/game/templates/game/base.html:78
msgid "Toggle navigation"
msgstr ""
#: failmap/game/templates/game/base.html:83
msgid "Game"
msgstr ""
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-10 10:59+0000\n"
"POT-Creation-Date: 2018-08-15 11:11+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,77 +18,73 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: failmap/game/forms.py:68
#: failmap/game/forms.py:32
msgid "This contest does not exist."
msgstr ""
#: failmap/game/forms.py:76
msgid "Incorrect secret or team. Try again!"
msgstr "Verkeerd geheim of team. Probeer opnieuw!"
#: failmap/game/forms.py:111
#, python-format
#: failmap/game/forms.py:159
#, fuzzy, python-format
#| msgid ""
#| "This organization %(organization)s already exists in the database for "
#| "this group."
msgid ""
"This organization %(organization)s already exists in the database for this "
"group."
"type / layer."
msgstr "De organisatie %(organization)s zit al in deze groep."
#: failmap/game/forms.py:193
#, python-format
msgid "Invalid or missing suffix (like .com etc): %(url)s"
msgstr "Ongeldig suffix (zoals .com etc): %(url)s"
#: failmap/game/forms.py:201
#, python-format
msgid "URL does not resolve (anymore): %(url)s."
msgstr ""
#: failmap/game/forms.py:230
#, python-format
msgid ""
"This URL %(url)s is already in the production data for organization "
"%(organization)s"
msgstr ""
#: failmap/game/forms.py:238
#, python-format
msgid "This URL %(url)s is already suggested for organization %(organization)s"
msgstr ""
#: failmap/game/models.py:15
#: failmap/game/models.py:16
msgid "Contest name"
msgstr "Naam van de wedstrijd"
#: failmap/game/models.py:47
#: failmap/game/models.py:48
msgid "contest"
msgstr "wedstrijd"
#: failmap/game/models.py:48
#: failmap/game/models.py:49
msgid "contests"
msgstr "wedstrijden"
#: failmap/game/models.py:60
#: failmap/game/models.py:61
msgid "Team name"
msgstr "Team-naam"
#: failmap/game/models.py:83
#: failmap/game/models.py:91
msgid "team"
msgstr "team"
#: failmap/game/models.py:84
#: failmap/game/models.py:92
msgid "teams"
msgstr "teams"
#: failmap/game/models.py:173
#: failmap/game/models.py:190
msgid "organisation submission"
msgstr "organisatie inzending"
#: failmap/game/models.py:174
#: failmap/game/models.py:191
msgid "organisation submissions"
msgstr "organisatie inzendingen"
#: failmap/game/models.py:237
#: failmap/game/models.py:256
msgid "url submission"
msgstr "url inzending"
#: failmap/game/models.py:238
#: failmap/game/models.py:257
#, fuzzy
#| msgid "submissions"
msgid "url submissions"
msgstr "url inzendingen"
#: failmap/game/templates/game/base.html:78
msgid "Toggle navigation"
msgstr ""
#: failmap/game/templates/game/base.html:83
msgid "Game"
msgstr ""
#~ msgid "Invalid or missing suffix (like .com etc): %(url)s"
#~ msgstr "Ongeldig suffix (zoals .com etc): %(url)s"
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-10 10:59+0000\n"
"POT-Creation-Date: 2018-08-15 11:11+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"
......@@ -17,75 +17,65 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: failmap/game/forms.py:68
msgid "Incorrect secret or team. Try again!"
msgstr ""
#: failmap/game/forms.py:111
#, python-format
msgid ""
"This organization %(organization)s already exists in the database for this "
"group."
#: failmap/game/forms.py:32
msgid "This contest does not exist."
msgstr ""
#: failmap/game/forms.py:193
#, python-format
msgid "Invalid or missing suffix (like .com etc): %(url)s"
msgstr ""
#: failmap/game/forms.py:201
#, python-format
msgid "URL does not resolve (anymore): %(url)s."
#: failmap/game/forms.py:76
msgid "Incorrect secret or team. Try again!"
msgstr ""
#: failmap/game/forms.py:230
#: failmap/game/forms.py:159
#, python-format
msgid ""
"This URL %(url)s is already in the production data for organization "
"%(organization)s"
msgstr ""
#: failmap/game/forms.py:238
#, python-format
msgid "This URL %(url)s is already suggested for organization %(organization)s"
"This organization %(organization)s already exists in the database for this "
"type / layer."
msgstr ""
#: failmap/game/models.py:15
#: failmap/game/models.py:16
msgid "Contest name"
msgstr ""
#: failmap/game/models.py:47
#: failmap/game/models.py:48
msgid "contest"
msgstr ""
#: failmap/game/models.py:48
#: failmap/game/models.py:49
msgid "contests"
msgstr ""
#: failmap/game/models.py:60
#: failmap/game/models.py:61
msgid "Team name"
msgstr ""
#: failmap/game/models.py:83
#: failmap/game/models.py:91
msgid "team"
msgstr ""
#: failmap/game/models.py:84
#: failmap/game/models.py:92
msgid "teams"
msgstr ""
#: failmap/game/models.py:173
#: failmap/game/models.py:190
msgid "organisation submission"
msgstr ""
#: failmap/game/models.py:174
#: failmap/game/models.py:191
msgid "organisation submissions"
msgstr ""
#: failmap/game/models.py:237
#: failmap/game/models.py:256
msgid "url submission"
msgstr ""
#: failmap/game/models.py:238
#: failmap/game/models.py:257
msgid "url submissions"
msgstr ""
#: failmap/game/templates/game/base.html:78
msgid "Toggle navigation"
msgstr ""
#: failmap/game/templates/game/base.html:83
msgid "Game"
msgstr ""
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-10 10:59+0000\n"
"POT-Creation-Date: 2018-08-15 11:11+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"
......@@ -63,46 +63,54 @@ msgstr ""
msgid "It's time to monitor your government!"
msgstr ""
#: failmap/settings.py:826
#: failmap/settings.py:847
msgid "🔧 configuration"
msgstr ""
#: failmap/settings.py:829
#: failmap/settings.py:850
msgid "configuration"
msgstr ""
#: failmap/settings.py:830
#: failmap/settings.py:851
msgid "map configuration"
msgstr ""
#: failmap/settings.py:831
#: failmap/settings.py:852
msgid "import regions"
msgstr ""
#: failmap/settings.py:834
#: failmap/settings.py:855
msgid "🏢 organizations"
msgstr ""
#: failmap/settings.py:842
#: failmap/settings.py:863
msgid "🔬 scanners"
msgstr ""
#: failmap/settings.py:852
#: failmap/settings.py:874
msgid "🗺️ map (autogenerated)"
msgstr ""
#: failmap/settings.py:857
#: failmap/settings.py:879
msgid "🕒 periodic tasks"
msgstr ""
#: failmap/settings.py:865
#: failmap/settings.py:887
msgid "ℹ️ helpdesk"
msgstr ""
#: failmap/settings.py:878
#: failmap/settings.py:900
msgid "☁️ hypersh cloud scans"
msgstr ""
#: failmap/settings.py:885
#: failmap/settings.py:907
msgid "👾️ the game"
msgstr ""
#: failmap/settings.py:911
msgid "New organizations"
msgstr ""
#: failmap/settings.py:915
msgid "New urls"
msgstr ""
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-10 10:59+0000\n"
"POT-Creation-Date: 2018-08-15 11:11+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"
......@@ -63,46 +63,54 @@ msgstr ""
msgid "It's time to monitor your government!"
msgstr ""
#: failmap/settings.py:826
#: failmap/settings.py:847
msgid "🔧 configuration"
msgstr ""
#: failmap/settings.py:829
#: failmap/settings.py:850
msgid "configuration"
msgstr ""
#: failmap/settings.py:830
#: failmap/settings.py:851
msgid "map configuration"
msgstr ""
#: failmap/settings.py:831
#: failmap/settings.py:852
msgid "import regions"
msgstr ""
#: failmap/settings.py:834
#: failmap/settings.py:855
msgid "🏢 organizations"
msgstr ""
#: failmap/settings.py:842
#: failmap/settings.py:863
msgid "🔬 scanners"
msgstr ""
#: failmap/settings.py:852
#: failmap/settings.py:874
msgid "🗺️ map (autogenerated)"
msgstr ""
#: failmap/settings.py:857
#: failmap/settings.py:879
msgid "🕒 periodic tasks"
msgstr ""
#: failmap/settings.py:865
#: failmap/settings.py:887
msgid "ℹ️ helpdesk"
msgstr ""
#: failmap/settings.py:878
#: failmap/settings.py:900
msgid "☁️ hypersh cloud scans"
msgstr ""
#: failmap/settings.py:885
#: failmap/settings.py:907
msgid "👾️ the game"
msgstr ""
#: failmap/settings.py:911
msgid "New organizations"
msgstr ""
#: failmap/settings.py:915
msgid "New urls"
msgstr ""
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-10 10:59+0000\n"
"POT-Creation-Date: 2018-08-15 11:11+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"
......@@ -62,46 +62,54 @@ msgstr ""
msgid "It's time to monitor your government!"
msgstr ""
#: failmap/settings.py:826
#: failmap/settings.py:847
msgid "🔧 configuration"
msgstr ""
#: failmap/settings.py:829
#: failmap/settings.py:850
msgid "configuration"
msgstr ""
#: failmap/settings.py:830
#: failmap/settings.py:851
msgid "map configuration"
msgstr ""
#: failmap/settings.py:831
#: failmap/settings.py:852
msgid "import regions"
msgstr ""
#: failmap/settings.py:834
#: failmap/settings.py:855
msgid "🏢 organizations"
msgstr ""
#: failmap/settings.py:842
#: failmap/settings.py:863
msgid "🔬 scanners"
msgstr ""
#: failmap/settings.py:852
#: failmap/settings.py:874
msgid "🗺️ map (autogenerated)"
msgstr ""
#: failmap/settings.py:857
#: failmap/settings.py:879
msgid "🕒 periodic tasks"
msgstr ""
#: failmap/settings.py:865
#: failmap/settings.py:887
msgid "ℹ️ helpdesk"
msgstr ""
#: failmap/settings.py:878
#: failmap/settings.py:900
msgid "☁️ hypersh cloud scans"
msgstr ""
#: failmap/settings.py:885
#: failmap/settings.py:907
msgid "👾️ the game"
msgstr ""
#: failmap/settings.py:911
msgid "New organizations"
msgstr ""
#: failmap/settings.py:915
msgid "New urls"
msgstr ""
This diff is collapsed.
This diff is collapsed.
......@@ -23,7 +23,6 @@ var failmap = {
iconSize: new L.Point(40, 40) });
}}),
info: L.control(),
legend: L.control({position: 'bottomright'}),
hovered_organization: "",
proxy_tiles: true,
......@@ -38,7 +37,7 @@ var failmap = {
orangeIcon: new L.Icon({iconUrl: 'static/images/orange-dot.png'}),
grayIcon: new L.Icon({iconUrl: 'static/images/gray-dot.png'}),
initialize: function (country_code) {
initialize: function (country_code, debug) {
// don't name this variable location, because that redirects the browser.
loc = this.initial_location(country_code);
this.map = L.map('map',
......@@ -46,30 +45,6 @@ var failmap = {
).setView(loc.coordinates, loc.zoomlevel);
this.map.scrollWheelZoom.disable();
let tile_uri_base = 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png';
let tile_uri_params = 'access_token={accessToken}';
let tile_uri = tile_uri_base + '?' + tile_uri_params;
// allow tiles to be fetched through a proxy to apply our own caching rules
// and prevent exhausion of free mapbox account credits
if (this.proxy_tiles) {
tile_uri = '/proxy/' + tile_uri_base;
}
L.tileLayer(tile_uri, {
maxZoom: 18,
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>, ' +
'Ratings &copy; <a href="http://faalkaart.nl/">Fail Map</a> <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-NC-BY-SA</a>',
id: 'mapbox.light',
accessToken: 'pk.eyJ1IjoibXJmYWlsIiwiYSI6ImNqMHRlNXloczAwMWQyd3FxY3JkMnUxb3EifQ.9nJBaedxrry91O1d90wfuw',
}).addTo(this.map);
// we have our own fullscreen control
// L.control.fullscreen().addTo(this.map);
// console.log(this.map.isFullscreen());
this.map.on('fullscreenchange', function () {
if (failmap.map.isFullscreen()) {
......@@ -109,15 +84,49 @@ var failmap = {
this.add_div('<div id="historycontrol"></div>', "info", false);
this.add_div("<input id='searchbar' type='text' onkeyup='failmap.search(this.value)' placeholder=\"" + gettext('Search organization') + "\"/>", "info", true);
this.add_info();
this.add_div("<div id=\"domainlist\"></div>", "info", false);
this.add_div("<div id='domainlist'></div>", "info", false);
var labels=[];
labels.push('<i style="background:' + failmap.getColorCode('green') + '"></i> '+ gettext('Perfect'));
labels.push('<i style="background:' + failmap.getColorCode('yellow') + '"></i> '+ gettext('Good'));
labels.push('<i style="background:' + failmap.getColorCode('orange') + '"></i> '+ gettext('Mediocre'));
labels.push('<i style="background:' + failmap.getColorCode('red') + '"></i> '+ gettext('Bad'));
labels.push('<i style="background:' + failmap.getColorCode('unknown') + '"></i> '+ gettext('Unknown'));
this.add_div("<span class='legend_title'>" + gettext('legend_basic_security') + "</span><br />" + labels.join('<br />'), "info legend", false);
this.add_div("<span class='legend_title'>" + gettext('legend_basic_security') + "</span><br />" + labels.join('<br />'), "info legend", false, {position: 'bottomright'});
this.add_div(document.getElementById('fullscreenreport').innerHTML, "fullscreenmap", true);
if (debug)
this.emptyTiles();
else
this.loadTiles();
},
loadTiles: function(){
let tile_uri_base = 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png';
let tile_uri_params = 'access_token={accessToken}';
let tile_uri = tile_uri_base + '?' + tile_uri_params;
// allow tiles to be fetched through a proxy to apply our own caching rules
// and prevent exhausion of free mapbox account credits
if (this.proxy_tiles) {
tile_uri = '/proxy/' + tile_uri_base;
}
// given tiles are proxies, the amount of connections might be maxed. Loading this last creates a bit more
// faster design.
L.tileLayer(tile_uri, {
maxZoom: 18,
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>, ' +
'Ratings &copy; <a href="http://faalkaart.nl/">Fail Map</a> <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-NC-BY-SA</a>',
id: 'mapbox.light',
accessToken: 'pk.eyJ1IjoibXJmYWlsIiwiYSI6ImNqMHRlNXloczAwMWQyd3FxY3JkMnUxb3EifQ.9nJBaedxrry91O1d90wfuw',
}).addTo(this.map);
},
// this is an empty tiles layer to make sure markers load. This can be useful for testing so things load faster.
emptyTiles: function(){
L.tileLayer("",{}).addTo(this.map);
},
// To help you get the coordinates;
......@@ -369,8 +378,8 @@ var failmap = {
},
// where you don't need to access the div again with js:
add_div: function(html, style, clickable) {
new_div = L.control();
add_div: function(html, style, clickable, control_options) {
new_div = L.control(control_options);
new_div.onAdd = function () {
this._div = L.DomUtil.create('div', style);
this._div.innerHTML = html;
......@@ -570,6 +579,11 @@ var failmap = {
},
clean_map: function(mapdata) {
// case when data is not loaded. todo: fix the cause of this.
if (!mapdata.features)
return;