diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2018-07-31 15:09:10 +0300 |
---|---|---|
committer | Matthieu Aubry <mattab@users.noreply.github.com> | 2018-07-31 15:09:10 +0300 |
commit | 0521d33d6f9df2727b77facee7f28c9c13327216 (patch) | |
tree | 6e4a236ca6a5013ed2260c66bf886347fed5bf7a /plugins/UserCountryMap | |
parent | cc5d65e4e691967bf1f9ab79b29ea75d34daa396 (diff) |
Display warning if there are no visits in realtime map because of missing latitude/longitude. (#13220)
* Display warning if there are no visits in realtime map because of missing latitude/longitude.
* use pre-existing view variable.
Diffstat (limited to 'plugins/UserCountryMap')
-rw-r--r-- | plugins/UserCountryMap/javascripts/realtime-map.js | 3 | ||||
-rw-r--r-- | plugins/UserCountryMap/lang/en.json | 4 | ||||
-rw-r--r-- | plugins/UserCountryMap/templates/realtimeMap.twig | 8 |
3 files changed, 13 insertions, 2 deletions
diff --git a/plugins/UserCountryMap/javascripts/realtime-map.js b/plugins/UserCountryMap/javascripts/realtime-map.js index 09396e9bba..5e616acd47 100644 --- a/plugins/UserCountryMap/javascripts/realtime-map.js +++ b/plugins/UserCountryMap/javascripts/realtime-map.js @@ -409,6 +409,9 @@ report = $.grep(report, function (r) { return r.latitude !== null; }); + + // show warning if no visits w/ latitude + $('#realTimeMapNoVisitsInfo').toggle(!report.length); } // check wether we got any geolocated visits left diff --git a/plugins/UserCountryMap/lang/en.json b/plugins/UserCountryMap/lang/en.json index 90f10244d7..a4e98e6331 100644 --- a/plugins/UserCountryMap/lang/en.json +++ b/plugins/UserCountryMap/lang/en.json @@ -20,6 +20,8 @@ "VisitorMap": "Visitor Map", "WorldWide": "World-Wide", "WithUnknownRegion": "%s with unknown region", - "WithUnknownCity": "%s with unknown city" + "WithUnknownCity": "%s with unknown city", + "NoVisitsInfo": "There are no visits displayed currently, because no visit for this period has the correct geolocation information (latitude & longitude).", + "NoVisitsInfo2": "To resolve this issue, make sure you are using a GeoIP geolocation provider with a GeoIP city database. If this does not resolve your issue, then it is possible (though unlikely) that your visits have IP addresses that just cannot be geolocated." } }
\ No newline at end of file diff --git a/plugins/UserCountryMap/templates/realtimeMap.twig b/plugins/UserCountryMap/templates/realtimeMap.twig index 84de8d95e4..4d9c13241b 100644 --- a/plugins/UserCountryMap/templates/realtimeMap.twig +++ b/plugins/UserCountryMap/templates/realtimeMap.twig @@ -25,6 +25,12 @@ </span> </div> -</div> + {% if userIsSuperUser %} + <div style="display:none;margin-top:20px;margin-bottom:0;" id="realTimeMapNoVisitsInfo" class="alert alert-info"> + <p>{{ 'UserCountryMap_NoVisitsInfo'|translate }}</p> + <p>{{ 'UserCountryMap_NoVisitsInfo2'|translate }}</p> + </div> + {% endif %} + </div> </div> <script type="text/javascript">UserCountryMap.RealtimeMap.initElements();</script>
\ No newline at end of file |