summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chimere/static/chimere/css/styles.css4
-rw-r--r--chimere/static/chimere/img/images_licences3
-rw-r--r--chimere/static/chimere/img/printer.pngbin0 -> 914 bytes
-rw-r--r--chimere/static/chimere/img/share-icon.pngbin0 -> 2148 bytes
-rw-r--r--chimere/static/chimere/img/share-icon.xcfbin0 -> 5431 bytes
-rw-r--r--chimere/static/chimere/js/jquery.chimere.js24
-rw-r--r--chimere/views.py28
7 files changed, 38 insertions, 21 deletions
diff --git a/chimere/static/chimere/css/styles.css b/chimere/static/chimere/css/styles.css
index df3743d..001fa7b 100644
--- a/chimere/static/chimere/css/styles.css
+++ b/chimere/static/chimere/css/styles.css
@@ -347,6 +347,10 @@ ul.share li{
height:22px;
}
+.share .share-icon img{
+ width:74px;
+}
+
.detail_footer{
text-align:center;
position:absolute;
diff --git a/chimere/static/chimere/img/images_licences b/chimere/static/chimere/img/images_licences
index cbc9307..d6d2773 100644
--- a/chimere/static/chimere/img/images_licences
+++ b/chimere/static/chimere/img/images_licences
@@ -22,7 +22,8 @@ Url: http://commons.wikimedia.org/wiki/File:Internet-web-browser.svg
Author: The Tango! Desktop Project
Licence: Public domain
Url: http://commons.wikimedia.org/wiki/File:Edit-find-replace.svg
-Url 2: http://commons.wikimedia.org/wiki/File:Internet-web-browser.svg
+ http://commons.wikimedia.org/wiki/File:Internet-web-browser.svg
+ https://commons.wikimedia.org/wiki/File:Document-print.svg
* Quaver image credit (8thNote.png)
diff --git a/chimere/static/chimere/img/printer.png b/chimere/static/chimere/img/printer.png
new file mode 100644
index 0000000..5a5dbaf
--- /dev/null
+++ b/chimere/static/chimere/img/printer.png
Binary files differ
diff --git a/chimere/static/chimere/img/share-icon.png b/chimere/static/chimere/img/share-icon.png
new file mode 100644
index 0000000..89b631c
--- /dev/null
+++ b/chimere/static/chimere/img/share-icon.png
Binary files differ
diff --git a/chimere/static/chimere/img/share-icon.xcf b/chimere/static/chimere/img/share-icon.xcf
new file mode 100644
index 0000000..d149768
--- /dev/null
+++ b/chimere/static/chimere/img/share-icon.xcf
Binary files differ
diff --git a/chimere/static/chimere/js/jquery.chimere.js b/chimere/static/chimere/js/jquery.chimere.js
index 3a067f2..d7da137 100644
--- a/chimere/static/chimere/js/jquery.chimere.js
+++ b/chimere/static/chimere/js/jquery.chimere.js
@@ -591,9 +591,10 @@ OpenLayers.Layer.MapQuestOSM = OpenLayers.Class(OpenLayers.Layer.XYZ, {
settings.layerMarkers.addMarker(marker);
/* show the item when designed in the permalink */
if (settings.display_feature == feature.pk){
+ settings.current_feature = feature;
_popup(feature);
methods.display_feature_detail(feature.pk);
- settings.map.setCenter(feature.lonlat, 16);
+ _repan_popup();
methods.loadCategories();
}
return feature;
@@ -864,22 +865,23 @@ OpenLayers.Layer.MapQuestOSM = OpenLayers.Class(OpenLayers.Layer.XYZ, {
uri += "getDetail/" + pk;
var params = {}
if (settings.simple) { params["simple"] = 1; }
- $.ajax({url: uri,
+ $.ajax({url: uri,
data: params,
+ dataType: "html",
success: function (data) {
- if ( settings.display_feature_detail_fx ) {
- // Custom function ?
- settings.display_feature_detail_fx(data, settings);
+ if ( settings.display_feature_detail_fx ) {
+ // Custom function ?
+ settings.display_feature_detail_fx(data, settings);
+ }
+ else {
+ if (!settings.popupContentFull) {
+ $('#detail').html(data).show();
}
else {
- if (!settings.popupContentFull) {
- $('#detail').html(data).show();
- }
- else {
- settings.current_popup.setContentHTML("<div class='cloud'>" + data + "</div>");
- }
+ settings.current_popup.setContentHTML("<div class='cloud'>" + data + "</div>");
}
}
+ }
});
},
center_on_feature: function(feature) {
diff --git a/chimere/views.py b/chimere/views.py
index ecaae0b..20b4bd2 100644
--- a/chimere/views.py
+++ b/chimere/views.py
@@ -104,6 +104,21 @@ def get_base_response(area_name=""):
base_response_dct['JQUERY_CSS_URLS'] = settings.JQUERY_CSS_URLS
return base_response_dct, None
+def getShareNetwork(request, area_name='', marker=None):
+ """
+ Get URLs to share items
+ """
+ parameters = ""
+ if marker:
+ parameters = u'current_feature=%d' % marker.pk
+ parameters += u"&checked_categories=%s" % "_".join([str(m.id) \
+ for m in marker.categories.all()])
+ net_dct = getTinyfiedUrl(request, parameters, area_name)
+ share_networks = []
+ for network in settings.CHIMERE_SHARE_NETWORKS:
+ share_networks.append((network[0], network[1] % net_dct, network[2]))
+ return share_networks, net_dct
+
def index(request, area_name=None, default_area=None, simple=False):
"""
Main page
@@ -116,7 +131,6 @@ def index(request, area_name=None, default_area=None, simple=False):
request.session['last_visit'] != today:
request.session['last_visit'] = today
news_visible = True
- news_visible = True
response_dct, redir = get_base_response(area_name)
if redir:
return redir
@@ -138,6 +152,8 @@ def index(request, area_name=None, default_area=None, simple=False):
'zoomout':zoomout,
'contact_email':settings.CONTACT_EMAIL
})
+ response_dct['share_networks'], net_dct = \
+ getShareNetwork(request, response_dct['area_name'])
tpl = 'chimere/main_map.html'
if simple:
tpl = 'chimere/main_map_simple.html'
@@ -507,15 +523,9 @@ def getDetail(request, area_name, marker_id):
if request.method == 'GET':
if 'simple' in request.GET and request.GET['simple']:
response_dct['simple'] = True
- parameters = u'current_feature=%s' % marker_id
- parameters += u"&checked_categories=%s" % "_".join([str(m.id) \
- for m in marker.categories.all()])
- net_dct = getTinyfiedUrl(request, parameters, response_dct['area_name'])
- share_networks = []
+ response_dct['share_networks'], net_dct = \
+ getShareNetwork(request, response_dct['area_name'], marker)
response_dct['share_url'] = net_dct['url']
- for network in settings.CHIMERE_SHARE_NETWORKS:
- share_networks.append((network[0], network[1] % net_dct, network[2]))
- response_dct['share_networks'] = share_networks
net_dct['to'] = ";".join(getStaffEmails())
if net_dct['to']:
net_dct["body"] = _(settings.CHIMERE_MODIF_EMAIL)