diff --git a/observations/locale/de/LC_MESSAGES/django.mo b/observations/locale/de/LC_MESSAGES/django.mo
index 0d937a96065f4e94585f8f7e3437143836cc3ece..7f738fc76247996f3a81b8dd19b6a096fa425fd5 100755
Binary files a/observations/locale/de/LC_MESSAGES/django.mo and b/observations/locale/de/LC_MESSAGES/django.mo differ
diff --git a/observations/locale/de/LC_MESSAGES/django.po b/observations/locale/de/LC_MESSAGES/django.po
index e7dc67a98ebdcfe62a8e39b960a58c43a9a22a09..8c75c16637c2dcc305fbf31187e66432ad24181d 100755
--- a/observations/locale/de/LC_MESSAGES/django.po
+++ b/observations/locale/de/LC_MESSAGES/django.po
@@ -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 ""
diff --git a/observations/locale/nb/LC_MESSAGES/django.mo b/observations/locale/nb/LC_MESSAGES/django.mo
index 04392c88c3afc76d27ae94aff7b3204b8633cfa8..caa54dcd2c5a520a101455b42fb5931e419b6887 100755
Binary files a/observations/locale/nb/LC_MESSAGES/django.mo and b/observations/locale/nb/LC_MESSAGES/django.mo differ
diff --git a/observations/locale/nb/LC_MESSAGES/django.po b/observations/locale/nb/LC_MESSAGES/django.po
index fe0dd794814deeaf823dc4e866e791c758572c59..f81e9377d6908a99b6e5df7115229a1651b6db34 100755
--- a/observations/locale/nb/LC_MESSAGES/django.po
+++ b/observations/locale/nb/LC_MESSAGES/django.po
@@ -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"
diff --git a/observations/locale/zh_CN/LC_MESSAGES/django.mo b/observations/locale/zh_CN/LC_MESSAGES/django.mo
index 040dd855856656df2048627d0b8bf5b8ddbf2e42..a13deac788545c69ece15bc23629f82aba2adc81 100755
Binary files a/observations/locale/zh_CN/LC_MESSAGES/django.mo and b/observations/locale/zh_CN/LC_MESSAGES/django.mo differ
diff --git a/observations/locale/zh_CN/LC_MESSAGES/django.po b/observations/locale/zh_CN/LC_MESSAGES/django.po
index b472cce96a550ab095b59eadd6bb72ca05e46d7b..6d5047725669972f63c20c19be8dc1d9c5a364f0 100755
--- a/observations/locale/zh_CN/LC_MESSAGES/django.po
+++ b/observations/locale/zh_CN/LC_MESSAGES/django.po
@@ -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 "看细节"
diff --git a/observations/static/observations/images/globe.png b/observations/static/observations/images/globe.png
new file mode 100644
index 0000000000000000000000000000000000000000..d7a6a3afd110d0efa28ac7c70954f022d2c60a00
Binary files /dev/null and b/observations/static/observations/images/globe.png differ
diff --git a/observations/static/observations/js/observationViewMap.js b/observations/static/observations/js/observationViewMap.js
index f1092b2b3e0c1424f08f64d9d9a9b9e18f144a78..ba495ab120d766ea925c98fb1ea858397c7c0ec4 100755
--- a/observations/static/observations/js/observationViewMap.js
+++ b/observations/static/observations/js/observationViewMap.js
@@ -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({
diff --git a/observations/templates/observations/detail.html b/observations/templates/observations/detail.html
index 41e4fda18e81511a9125581122a7fb3308599c55..6dd5c1ec5e02961de01b2090ea23d70c1f64cb89 100755
--- a/observations/templates/observations/detail.html
+++ b/observations/templates/observations/detail.html
@@ -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 %}