summaryrefslogtreecommitdiff
path: root/chimere/templates
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/templates')
-rw-r--r--chimere/templates/chimere/blocks/live_coordinates.html3
-rw-r--r--chimere/templates/chimere/blocks/map.html39
-rw-r--r--chimere/templates/chimere/blocks/polygon_edit.html5
-rw-r--r--chimere/templates/chimere/detail.html7
-rw-r--r--chimere/templates/chimere/edit.html12
-rw-r--r--chimere/templates/chimere/main_map.html1
6 files changed, 53 insertions, 14 deletions
diff --git a/chimere/templates/chimere/blocks/live_coordinates.html b/chimere/templates/chimere/blocks/live_coordinates.html
index 7e8cfd9..b4b7d1e 100644
--- a/chimere/templates/chimere/blocks/live_coordinates.html
+++ b/chimere/templates/chimere/blocks/live_coordinates.html
@@ -7,6 +7,7 @@
var CENTER_LONLAT = centerLonLat = ol.proj.transform(%s,
EPSG_DISPLAY_PROJECTION, EPSG_PROJECTION);
var DEFAULT_ZOOM = %s;
+ {{extra_js|safe}}
var chimere_init_options = {};
chimere_init_options["input_id"] = 'id_{{name}}';
//chimere_init_options["default_icon"] = new OpenLayers.Icon('%schimere/img/marker-green.png', new OpenLayers.Size(21, 25), new OpenLayers.Pixel(-(21/2), -25));
@@ -20,6 +21,7 @@
</div>
+<div id='layerSwitcher'></div>
<div id='map_edit'></div>
<div id='live_lonlat'>
<p>
@@ -44,6 +46,7 @@
{% else %}
$('#map_edit').chimere('activateDraw');
{% endif %}
+ $('#map_edit').chimere('zoom', { 'area':%s });
function update_marker_on_map(){
var mylonlat = [$('#live_longitude').val(),
diff --git a/chimere/templates/chimere/blocks/map.html b/chimere/templates/chimere/blocks/map.html
index 64248ac..007f507 100644
--- a/chimere/templates/chimere/blocks/map.html
+++ b/chimere/templates/chimere/blocks/map.html
@@ -1,4 +1,17 @@
{% load i18n %}
+<div id='category_description' class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-label="{% trans "Close" %}"><span aria-hidden="true">&times;</span></button>
+ <h4 class="modal-title" id="category_description-label"></h4>
+ </div>
+ <div class="modal-body" id="category_description-content">
+ </div>
+ </div>
+ </div>
+</div>
+
<div id='{{map_id}}'></div>
<script type="text/javascript">
$("#{{map_id}}").show();
@@ -22,8 +35,13 @@ $(function(){
</ul>
</div>
<script type="text/javascript">
- {% if single_category %}
- $(function() {$('#panel').hide()});{% endif %}
+ {% if not display_category_menu %}
+ $(function() {
+ $('#panel').hide();
+ $(".show-hide-panel").hide();
+ $("#categories-lnk").hide();
+ });{% endif %}
+ {{extra_js}}
var chimere_init_options = {};
{% if MOBILE %}chimere_init_options["mobile"] = true;{% endif %}
{% if enable_clustering %}chimere_init_options["enable_clustering"] = true;{% endif %}
@@ -46,7 +64,9 @@ $(function(){
{% if p_routing_steps %}chimere_init_options["routing_steps_lonlat"] = [{{ p_routing_steps }}];{% endif %}
{% if p_routing_transport %}chimere_init_options["routing_transport"] = "{{ p_routing_transport }}";{% endif %}
{% if p_routing_speed %}chimere_init_options["routing_speed"] = "{{ p_routing_speed }}";{% endif %}
- chimere_init_options["icon_offset"] = [{{icon_offset_x}}, {{icon_offset_y}}];
+ //chimere_init_options["icon_offset"] = new OpenLayers.Pixel({{icon_offset_x}},
+ // {{icon_offset_y}});
+ chimere_init_options["icon_offset"] = ({{icon_offset_x}}, {{icon_offset_y}});
chimere_init_options["dynamic_categories"] = {{ dynamic_categories }};
{% if p_display_submited %}chimere_init_options["display_submited"] = {{ p_display_submited }};{% endif %}
chimere_init_options["checked_categories"] = [{% for cc in checked_categories %}{% if forloop.counter0 > 0 %}, {% endif %}{{cc}}{% endfor %}];
@@ -61,13 +81,22 @@ $(function(){
{% if selected_map_layer %}
chimere_init_options["selected_map_layer"] = {{selected_map_layer}};
{% endif %}
+
+ $('#category_description').modal({show:false});
+ chimere_init_options["open_dialog_fx"] = function (title, content){
+ $('#category_description-content').html(content);
+ $('#category_description-label').html(title);
+ $('#category_description').modal('show');
+ }
$("#main-map").chimere(chimere_init_options);
{% if zoom %}
$('#maps').chimere('zoom', {'area':{{zoom}} });
{% endif %}
+ {{extra_map_def|safe}}
+
// init layer selection
- $(function() {
+ /* $(function() {
{% for layer_name, js, def in map_layers %}
$('#layer_list').append("<li><input type='radio' value='{{forloop.counter0}}' name='layer_type' id='layer_{{forloop.counter}}'{% if def %} checked='checked'{% endif %}><label for='layer_{{forloop.counter}}'>{{layer_name}}</li>");{% endfor %}
{% for subcat in subcat_layer %}
@@ -87,7 +116,9 @@ $(function(){
$('#'+$(this).val()).trigger('click');
$('#'+$(this).val()).prop("checked", this.checked);
});
+ highlight_selected_categories();
});
+ */
</script>
<div id='marker_hover'><div id='marker_hover_content'></div></div>
<div id='cluster_list'></div>
diff --git a/chimere/templates/chimere/blocks/polygon_edit.html b/chimere/templates/chimere/blocks/polygon_edit.html
index be112d2..59fe07e 100644
--- a/chimere/templates/chimere/blocks/polygon_edit.html
+++ b/chimere/templates/chimere/blocks/polygon_edit.html
@@ -7,9 +7,10 @@
var CENTER_LONLAT = centerLonLat = ol.proj.transform(
{center}, epsg_display_projection, epsg_projection);
var DEFAULT_ZOOM = {zoom};
+ {extra_js}
var chimere_init_options = {% raw %}{{}}{% endraw %};
chimere_init_options["input_id"] = 'id_{{name}}';
- {% if map_layers %}chimere_init_options["map_layers"] = [{map_layers}];{% endif %}
+ chimere_init_options["map_layers"] = [{map_layers}];
chimere_init_options['dynamic_categories'] = false;
chimere_init_options['edition'] = true;
chimere_init_options['edition_type'] = 'polygon';
@@ -18,6 +19,7 @@
</script>
<div id='popup'></div>
+<div id='layerSwitcher'></div>
<div id='map_edit'></div>
<div class='help'>{% trans "To delete a vertice, hold the SHIFT key and click." %}</div>
<input type='hidden' name='{{name}}' id='id_{{name}}' value='{{value}}'/>
@@ -26,6 +28,7 @@
function init_map_edit(){% raw %}{{{% endraw %}
$('#map_edit').chimere(chimere_init_options);
$('#map_edit').chimere('activateDraw');
+ $('#map_edit').chimere('zoom', {% raw %} {{ 'area':{zoom} }} {% endraw %});
{% if value %}$('#map_edit').chimere('initFeature', '{{value}}');
{% endif %}
{% raw %}}}{% endraw %}
diff --git a/chimere/templates/chimere/detail.html b/chimere/templates/chimere/detail.html
index abdd76e..11ce8d2 100644
--- a/chimere/templates/chimere/detail.html
+++ b/chimere/templates/chimere/detail.html
@@ -20,8 +20,8 @@
{% if marker.description %}
<p class='description'>{{ marker.description|sanitize:"p b i br hr strong em img:src:alt span:style a:href:target ul li ol h1 h2 h3 h4 table td tr th"|safe}}</p>
{% endif %}
- {% for property in marker.getProperties %}
- <p class='{{property.propertymodel.getNamedId}}'>{{ property.value|sanitize:"p b i br hr strong em img:src:alt span:style a:href:target ul li ol h1 h2 h3 h4 table td tr th"|safe}}</p>
+ {% for property in properties %}
+ <p class='{{property.propertymodel.getNamedId}}'><strong>{{property.propertymodel}}</strong>{% trans ":" %} {{ property.value|sanitize:"p b i br hr strong em img:src:alt span:style a:href:target ul li ol h1 h2 h3 h4 table td tr th"|safe}}</p>
{% endfor %}
{% if marker.origin %}<p class='detail_source'><strong>{% trans "Source:" %}</strong> <span>{{marker.origin}}</span></p>{% endif %}
{% if marker.license %}<p class='detail_license'><strong>{% trans "License:" %}</strong> <span>{{marker.license}}</span></p>{% endif %}
@@ -30,13 +30,14 @@
</p>{% endif %}
</div>
{% share_bar marker.name %}
- <p class='detail_amendment'><a href='{% if marker.route %}{% url chimere:editroute-item area_name_slash|default_if_none:"" marker.route.pk "" %}{%else%}{% url chimere:edit-item area_name_slash|default_if_none:"" marker.pk "" %}{%endif%}'>
+ <p class='detail_amendment'><a href='{% if marker.polygon %}{% url chimere:editpolygon-item area_name_slash|default_if_none:"" marker.pk "" %}{% else %}{% if marker.route %}{% url chimere:editroute-item area_name_slash|default_if_none:"" marker.route.pk "" %}{% else %}{% url chimere:edit-item area_name_slash|default_if_none:"" marker.pk "" %}{% endif %}{% endif %}'>
{% trans "Submit an amendment" %}
</a>
{% if moderator_emails %}
<a href="mailto:?from={{moderator_emails}}&subject={% trans "Propose amendment" %}&body={% trans "I would like to propose an amendment for this item:"%} {{share_url}}">
{% trans "Propose amendment" %}
</a>{%endif%}
+ </p>
</div>
{% if marker.multimedia_items %}
<div id='gallery-{{time_now}}' class='gallery'>
diff --git a/chimere/templates/chimere/edit.html b/chimere/templates/chimere/edit.html
index ff4e514..ab5bb4b 100644
--- a/chimere/templates/chimere/edit.html
+++ b/chimere/templates/chimere/edit.html
@@ -39,7 +39,7 @@
<div class='leftform'>
<p>* {% trans "indicates a mandatory field" %}</p>
<div class="fieldWrapper full">
- <label for="id_subcategory">{% trans "Categories" %} *</label>
+ <label for="id_subcategory">{% if form.categories.label %}{{ form.categories.label }}{% else %}{% trans "Categories" %} *{% endif %}</label>
{% if form.categories.errors %}<div class='errors'>{{ form.categories.errors }}</div>{% endif %}
{{ form.categories }}
</div>
@@ -74,8 +74,6 @@
<p class="help">{{ form.end_date.help_text }}</p>
</div>
{% endif %}
- </div>
- <div class='bottomform'>
{% for field in form %}
{% for property in properties %}
{% ifequal field.name property.getNamedId %}
@@ -87,6 +85,8 @@
{%endifequal%}
{%endfor%}
{%endfor%}
+ </div>
+ <div class='bottomform'>
{% inline_formset "Multimedia files" formset_multi %}
{% inline_formset "Picture files" formset_picture %}
@@ -102,11 +102,11 @@
cat_filters['{{subcat.id}}'].push('#id_{{property.getNamedId}}');
{% endfor %}
{% endfor %}
- $('#id_categories').change(function(){
+ $('.bsmSelect').change(function(){
for (idx in cat_to_hide){
$(cat_to_hide[idx]).parent().hide();
}
- var vals = $(this).val();
+ var vals = $('#id_categories').val();
for (val_id in vals){
var val = vals[val_id];
for (ids in cat_filters[val]){
@@ -114,7 +114,7 @@
}
}
});
- $('#id_categories').change();
+ $('.bsmSelect').change();
</script>
{% endif %}
</div>
diff --git a/chimere/templates/chimere/main_map.html b/chimere/templates/chimere/main_map.html
index 6f53611..45423ba 100644
--- a/chimere/templates/chimere/main_map.html
+++ b/chimere/templates/chimere/main_map.html
@@ -46,6 +46,7 @@
{% block content %}
{{block.super}}
<div id='popup'></div>
+ <div id='layerSwitcher'></div>
<div id='main-map'></div>
<script type="text/javascript">
$("#main-map").show();