summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chimere/static/chimere/js/base.js2
-rw-r--r--chimere/static/saclay/js/interface.js15
-rw-r--r--chimere/templates/blocks/bootstrap-modal.html2
-rw-r--r--chimere/templates/chimere/blocks/share_bar.html3
-rw-r--r--chimere/templates/chimere/main_map.html4
-rw-r--r--chimere/templates/chimere/main_map_simple.html8
-rw-r--r--chimere/templatetags/chimere_tags.py4
-rw-r--r--chimere/urls.py24
-rw-r--r--chimere/views.py4
-rw-r--r--requirements_searchengine.txt16
-rw-r--r--settings.py9
11 files changed, 52 insertions, 39 deletions
diff --git a/chimere/static/chimere/js/base.js b/chimere/static/chimere/js/base.js
index 0cf3f35..c358590 100644
--- a/chimere/static/chimere/js/base.js
+++ b/chimere/static/chimere/js/base.js
@@ -126,7 +126,7 @@ var update_permalink = false;
function share_link_update(){
if (update_permalink){
- $('.share_link').unbind('click').click(function(){
+ $('.share_link:not([onclick])').unbind('click').click(function(){
update_permalink();
var href = $(this).attr('href');
var url = '';
diff --git a/chimere/static/saclay/js/interface.js b/chimere/static/saclay/js/interface.js
index 413a50b..d3e756f 100644
--- a/chimere/static/saclay/js/interface.js
+++ b/chimere/static/saclay/js/interface.js
@@ -598,3 +598,18 @@ var init_modal_window = function(){
});
};
+var generate_iframe = function(){
+ var html;
+ if (update_permalink){
+ update_permalink();
+ var permalink = window.location.protocol + "//" + window.location.host + $("#permalink").attr('href');
+ html = '<iframe width="100%" height="100%" src="' + permalink + '"></iframe>';
+ html = html.replace(/</g, "&lt;").replace(/>/g, "&gt;");
+ html = "<pre>" + html + "</pre>";
+ html = "<p>Pour insérer la carte sur un site web, veuillez recopier le code suivant : </p>" + html;
+ } else {
+ html = "<p>Erreur lors de l'initialisation de l'iframe.</p>"
+ }
+ $("#modal-default-message .modal-body").html(html);
+ $('#modal-default-message').modal("show");
+} \ No newline at end of file
diff --git a/chimere/templates/blocks/bootstrap-modal.html b/chimere/templates/blocks/bootstrap-modal.html
index 7ca02ce..3e8d45e 100644
--- a/chimere/templates/blocks/bootstrap-modal.html
+++ b/chimere/templates/blocks/bootstrap-modal.html
@@ -11,7 +11,7 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">
- {% trans "Cancel" %}
+ {% trans "Close" %}
</button>
{% if edit %}<button type="button" class="btn btn-primary">
{% trans "Edit" %}
diff --git a/chimere/templates/chimere/blocks/share_bar.html b/chimere/templates/chimere/blocks/share_bar.html
index 8829401..7ec2e58 100644
--- a/chimere/templates/chimere/blocks/share_bar.html
+++ b/chimere/templates/chimere/blocks/share_bar.html
@@ -14,7 +14,8 @@
{% for share_network in share_networks %}
<li class='shared'>
<a class='share_link share_id_{{share_network.0}}'
- href='{{share_network.1}}' title="{{share_network.0}}">
+ href='{{share_network.1}}' title="{{share_network.0}}"{% if share_network.3 %}
+ onclick='{{share_network.3}}' {% endif %}>
<i class="fa {{share_network.2}}" aria-hidden="true"></i>
</a>
</li>
diff --git a/chimere/templates/chimere/main_map.html b/chimere/templates/chimere/main_map.html
index d7f7d98..dc3a2aa 100644
--- a/chimere/templates/chimere/main_map.html
+++ b/chimere/templates/chimere/main_map.html
@@ -18,7 +18,7 @@
var area_name = "{{area_name}}";
// -->
</script>
-<script src="{{ STATIC_URL }}saclay/js/interface.js?ver={{SACLAY_VERSION}}" type="text/javascript"></script>
+<script src="{{ STATIC_URL }}saclay/js/interface.js?ver={{VERSION}}" type="text/javascript"></script>
{% for css in extra_css %}<link rel="stylesheet" type="text/css" href="{{css}}" />
{% endfor %}
@@ -86,6 +86,7 @@
{% endif %}
{% display_news news_visible %}
{{ block.super }}
+ {% block edit_blocks %}
<div id='edit-button' class="action-button" data-toggle="modal"
data-target="#modal-edit">
{% trans "Contribute" %}
@@ -96,6 +97,7 @@
{% endwith %}
{% bootstrap_modal "modal-default-message"%}
+ {% endblock %}
<script type="text/javascript">
<!--
diff --git a/chimere/templates/chimere/main_map_simple.html b/chimere/templates/chimere/main_map_simple.html
index 552d309..da302d1 100644
--- a/chimere/templates/chimere/main_map_simple.html
+++ b/chimere/templates/chimere/main_map_simple.html
@@ -4,7 +4,10 @@
{% block body_id %}id='simple'{% endblock %}
{% block menu %}{# no menu in simple mode #}{% endblock %}
{% block message_edit %}{% endblock %}
+{% block header %}
+{% endblock %}
{% block sidebar %}
+<!--
<div class='sidebar-handler' id='sidebar-handler-hide'>
</div>
<div id='panel'>
@@ -12,9 +15,10 @@
<h2>{% trans "Categories"%}</h2>
</a>
<form method='post' name='frm_categories' id='frm_categories'>
- <div id='categories' name='categories'></div>
+ <div id='categories'></div>
</form>
</div>
+ -->
{% endblock %}
{% block content %}
<script type='text/javascript'><!--
@@ -22,3 +26,5 @@
// --></script>
{{ block.super }}
{% endblock %}
+{% block edit_blocks %}
+{% endblock %}
diff --git a/chimere/templatetags/chimere_tags.py b/chimere/templatetags/chimere_tags.py
index f08fc22..724ea2e 100644
--- a/chimere/templatetags/chimere_tags.py
+++ b/chimere/templatetags/chimere_tags.py
@@ -376,8 +376,8 @@ def share_bar(context, item, email_only=False, rss=True):
context['rss'] = rss
context['email_only'] = email_only
context['share_networks'] = [
- (defaultfilters.slugify(nme), url, icon)
- for nme, url, icon in settings.CHIMERE_SHARE_NETWORKS]
+ (defaultfilters.slugify(nme), url, icon, JS)
+ for nme, url, icon, JS in settings.CHIMERE_SHARE_NETWORKS]
return context
diff --git a/chimere/urls.py b/chimere/urls.py
index e7b9133..a7d43e2 100644
--- a/chimere/urls.py
+++ b/chimere/urls.py
@@ -55,29 +55,29 @@ urlpatterns += [
url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?dyn.css$',
views.DynCSS.as_view(), name="dyn-css"),
url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?edit-marker/'
- r'(?P<submited>\w+)?$', views.editMarker, name="editmarker"),
+ r'(?P<submited>\w+)?$', views.editMarker, name="editmarker"),
url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?edit-marker-tab/'
- r'(?P<submited>\w+)?$', views.editMarkerTab, name="edit-marker-tab"),
+ r'(?P<submited>\w+)?$', views.editMarkerTab, name="edit-marker-tab"),
url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?edit-marker/(?P<item_id>\w+)/'
- r'(?P<submited>\w+)?$', views.editMarker, name="editmarker-item"),
+ r'(?P<submited>\w+)?$', views.editMarker, name="editmarker-item"),
url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?edit-route/$', views.editRoute,
- name="editroute"),
+ name="editroute"),
url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?edit-route-tab/$', views.editRouteTab,
- name="edit-route-tab"),
+ name="edit-route-tab"),
url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?edit-route/(?P<item_id>\w+)/'
- r'(?P<submited>\w+)?$',
- views.editRoute, name="editroute-item"),
+ r'(?P<submited>\w+)?$',
+ views.editRoute, name="editroute-item"),
url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?edit-polygon/$', views.editPolygon,
- name="editpolygon"),
+ name="editpolygon"),
url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?edit-polygon-tab/$',
- views.editPolygonTab, name="edit-polygon-tab"),
+ views.editPolygonTab, name="edit-polygon-tab"),
url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?edit-polygon/(?P<item_id>\w+)/'
- r'(?P<submited>\w+)?$',
- views.editPolygon, name="editpolygon-item"),
+ r'(?P<submited>\w+)?$',
+ views.editPolygon, name="editpolygon-item"),
url(r'^form-result/(?P<success>[a-zA-Z0-9_-]+)?',
views.form_result, name='form-result'),
url(r'^', include('chimere.urls_chimere', namespace="chimere")),
url(r'^(?P<area_name>[a-zA-Z0-9_-]+)?', views.index,
- name="index"),
+ name="index"),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
diff --git a/chimere/views.py b/chimere/views.py
index 1e89bd2..4a2334f 100644
--- a/chimere/views.py
+++ b/chimere/views.py
@@ -144,7 +144,7 @@ def getShareUrl(request, area_name='', network='', attrs=''):
Get a share url
"""
data = getTinyfiedUrl(request, attrs, area_name)
- for name, url, img in settings.CHIMERE_SHARE_NETWORKS:
+ for name, url, img, JS in settings.CHIMERE_SHARE_NETWORKS:
if defaultfilters.slugify(name) == network:
return HttpResponse(url % {'text': data['text'],
'url': data['url']})
@@ -239,6 +239,8 @@ def index(request, area_name=None, default_area=None, simple=False,
response_dct['share_networks'], net_dct = \
getShareNetwork(request, response_dct['area_name'])
tpl = 'chimere/main_map.html'
+ if request.GET and "simple" in request.GET:
+ simple = True
response_dct['simple'] = simple
if simple:
tpl = 'chimere/main_map_simple.html'
diff --git a/requirements_searchengine.txt b/requirements_searchengine.txt
deleted file mode 100644
index df83462..0000000
--- a/requirements_searchengine.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-django>=1.8,<1.8.99
-beautifulsoup4==4.5.3
-psycopg2
-Pillow==3.3
-lxml==3.4
-feedparser==5.2.1
-django-tinymce==1.5.3
-django-haystack==2.5.1
-geopy==1.11
-pysolr==3.3
-icalendar==3.8
-chardet==2.3
-py3exiv2==0.2.1
-gdal==2.1.2
-osmapi==0.6.2
-PyTidyLib==0.3.1
diff --git a/settings.py b/settings.py
index ebb64b6..bf7b6b0 100644
--- a/settings.py
+++ b/settings.py
@@ -345,12 +345,15 @@ if 'CHIMERE_SHARE_NETWORKS' not in globals():
# share with
global CHIMERE_SHARE_NETWORKS
CHIMERE_SHARE_NETWORKS = (
+ # name, link, icon, JS (on click)
("Email", 'mailto:?subject=%(text)s&body=%(url)s',
- "fa-envelope"),
+ "fa-envelope", ''),
("Facebook", 'http://www.facebook.com/sharer.php?t=%(text)s&u=%(url)s',
- "fa-facebook-official"),
+ "fa-facebook-official", ''),
("Twitter", 'http://twitter.com/home?status=%(text)s %(url)s',
- "fa-twitter"),
+ "fa-twitter", ''),
+ ("Iframe web", '#',
+ "fa-clipboard", 'generate_iframe()'),
)
if 'OSM_MOBILE_JS_URLS' not in globals():