Skip to content
Snippets Groups Projects
Commit 9acd00c2 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Added handling of observation with hidden location

parent 2fde14de
Branches
No related tags found
No related merge requests found
No preview for this file type
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-28 13:03-0700\n"
"POT-Creation-Date: 2017-03-13 15:02-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -26,15 +26,15 @@ msgstr ""
msgid "View all observations"
msgstr ""
#: templates/observations/detail.html:32 templates/observations/index.html:44
#: templates/observations/detail.html:32 templates/observations/index.html:53
msgid "Organism"
msgstr ""
#: templates/observations/detail.html:34 templates/observations/index.html:45
#: templates/observations/detail.html:34 templates/observations/index.html:54
msgid "Crop"
msgstr ""
#: templates/observations/detail.html:36 templates/observations/index.html:43
#: templates/observations/detail.html:36 templates/observations/index.html:52
msgid "Time of observation"
msgstr ""
......@@ -50,6 +50,14 @@ msgstr ""
msgid "Observation was not quantified"
msgstr ""
#: templates/observations/detail.html:116
msgid "Location is hidden"
msgstr ""
#: templates/observations/detail.html:117
msgid "The observer has requested that the location is hidden"
msgstr ""
#: templates/observations/index.html:25 templates/observations/index.html:28
msgid "Observations"
msgstr ""
......@@ -58,10 +66,14 @@ msgstr ""
msgid "All pests"
msgstr ""
#: templates/observations/index.html:46
#: templates/observations/index.html:55
msgid "Heading"
msgstr ""
#: templates/observations/index.html:86
#: templates/observations/index.html:82
msgid "Crops"
msgstr ""
#: templates/observations/index.html:112
msgid "View details"
msgstr ""
No preview for this file type
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-06 10:13+0200\n"
"POT-Creation-Date: 2017-03-13 15:02-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -28,17 +28,17 @@ msgid "View all observations"
msgstr "Se alle observasjoner"
#: templates/observations/detail.html:32
#: templates/observations/index.html:44
#: templates/observations/index.html:53
msgid "Organism"
msgstr "Organisme"
#: templates/observations/detail.html:34
#: templates/observations/index.html:45
#: templates/observations/index.html:54
msgid "Crop"
msgstr "Kultur"
#: templates/observations/detail.html:36
#: templates/observations/index.html:43
#: templates/observations/index.html:52
msgid "Time of observation"
msgstr "Observasjonstidspunkt"
......@@ -54,6 +54,14 @@ msgstr "Observasjonsdata"
msgid "Observation was not quantified"
msgstr "Observasjonen ble ikke kvantifisert"
#: templates/observations/detail.html:116
msgid "Location is hidden"
msgstr "Plasseringen er skjult"
#: templates/observations/detail.html:117
msgid "The observer has requested that the location is hidden"
msgstr "Observatøren har bedt om at plasseringen skal være skjult"
#: templates/observations/index.html:25
#: templates/observations/index.html:28
msgid "Observations"
......@@ -63,11 +71,16 @@ msgstr "Observasjoner"
msgid "All pests"
msgstr "Alle organismer"
#: templates/observations/index.html:46
#: templates/observations/index.html:55
msgid "Heading"
msgstr "Overskrift"
#: templates/observations/index.html:86
#: templates/observations/index.html:82
#, fuzzy
msgid "Crops"
msgstr "Kultur"
#: templates/observations/index.html:112
msgid "View details"
msgstr "Se detaljer"
No preview for this file type
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-28 13:04-0700\n"
"POT-Creation-Date: 2017-03-13 15:02-0700\n"
"PO-Revision-Date: 2016-10-27 11:26+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
......@@ -25,15 +25,15 @@ msgstr "观测"
msgid "View all observations"
msgstr "查看所有观测"
#: templates/observations/detail.html:32 templates/observations/index.html:44
#: templates/observations/detail.html:32 templates/observations/index.html:53
msgid "Organism"
msgstr "生物"
#: templates/observations/detail.html:34 templates/observations/index.html:45
#: templates/observations/detail.html:34 templates/observations/index.html:54
msgid "Crop"
msgstr "作物"
#: templates/observations/detail.html:36 templates/observations/index.html:43
#: templates/observations/detail.html:36 templates/observations/index.html:52
msgid "Time of observation"
msgstr "观测时间"
......@@ -49,6 +49,14 @@ msgstr "观测数据"
msgid "Observation was not quantified"
msgstr "观测没有定量化"
#: templates/observations/detail.html:116
msgid "Location is hidden"
msgstr ""
#: templates/observations/detail.html:117
msgid "The observer has requested that the location is hidden"
msgstr ""
#: templates/observations/index.html:25 templates/observations/index.html:28
msgid "Observations"
msgstr "观测"
......@@ -57,10 +65,16 @@ msgstr "观测"
msgid "All pests"
msgstr "所有病虫害"
#: templates/observations/index.html:46
#: templates/observations/index.html:55
msgid "Heading"
msgstr "标题"
#: templates/observations/index.html:86
#: templates/observations/index.html:82
#, fuzzy
#| msgid "Crop"
msgid "Crops"
msgstr "作物"
#: templates/observations/index.html:112
msgid "View details"
msgstr "看细节"
observations/static/observations/images/globe.png

85.5 KiB

......@@ -78,12 +78,12 @@ var initMap = function(geoJSON, poi, container, mapAttribution)
var format = new ol.format.GeoJSON();
console.log(JSON.parse(geoJSON));
//console.log(JSON.parse(geoJSON));
var drawnfeatures = format.readFeatures(JSON.parse(geoJSON), {
dataProjection: 'EPSG:4326',
featureProjection: map.getView().getProjection().getCode()
});
console.log(drawnfeatures);
//console.log(drawnfeatures);
// TODO: Convert small areas to points on large scale views
/**
......@@ -106,7 +106,7 @@ var initMap = function(geoJSON, poi, container, mapAttribution)
extent = featureOverlay.getSource().getExtent();
map.getView().fit(extent, map.getSize());
}
else
else if(poi != null)
{
/*var poiLayer = new ol.layer.Vector({
source: new ol.source.Vector({
......
......@@ -91,17 +91,31 @@
var illustration = observation.observationIllustrationSet[0];
document.getElementById("observationIllustration").innerHTML = "<img src='" + settings.vipslogicProtocol + "://" + settings.vipslogicServerName + "/static/images/observations/" + observation.organismId + "/" + illustration.observationIllustrationPK.fileName + "' class='img-responsive'/>";
}
if(observation.locationPointOfInterestId > 0)
if(!observation.locationIsPrivate)
{
$.getJSON(settings.vipslogicProtocol + "://" + settings.vipslogicServerName + "/rest/poi/" + observation.locationPointOfInterestId , function( poi ) {
initMap(null,poi,"observationViewMap","{{settings.MAP_ATTRIBUTION|safe}}")
});
if(observation.locationPointOfInterestId > 0)
{
$.getJSON(settings.vipslogicProtocol + "://" + settings.vipslogicServerName + "/rest/poi/" + observation.locationPointOfInterestId , function( poi ) {
initMap(null,poi,"observationViewMap","{{settings.MAP_ATTRIBUTION|safe}}")
});
}
else
{
initMap(observation.geoinfo,null,"observationViewMap","{{settings.MAP_ATTRIBUTION|safe}}");
}
}
else
{
initMap(observation.geoinfo,null,"observationViewMap","{{settings.MAP_ATTRIBUTION|safe}}");
renderLocationIsHiddenMessage();
}
});
});
function renderLocationIsHiddenMessage(){
document.getElementById("observationViewMap").parentNode.innerHTML =
"<h2>{% trans "Location is hidden" %}</h2>" +
"<p>{% trans "The observer has requested that the location is hidden" %}</p>" +
"<p><img class='img-responsive' src='{% static "observations/images/globe.png" %}'/></p>";
}
</script>
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment