diff options
| author | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-11-19 01:08:51 +0100 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-11-19 01:08:51 +0100 |
| commit | ded35ffba989c28d8dd515fc9c0f4e241038d668 (patch) | |
| tree | e756e63c9dca53bdf0f23e68a367a16b927ab61b /chimere/templates | |
| parent | 5db6ae2fc14ebbec4b52151c7250ca0bba98bc02 (diff) | |
| parent | 7d8c3719bb2dfaa70b1d6c5e2a19c53588091d3b (diff) | |
| download | Chimère-ded35ffba989c28d8dd515fc9c0f4e241038d668.tar.bz2 Chimère-ded35ffba989c28d8dd515fc9c0f4e241038d668.zip | |
Merge branch 'master' into saclay
Conflicts:
chimere/admin.py
chimere/models.py
chimere/templates/chimere/detail.html
chimere/templatetags/chimere_tags.py
chimere/tests.py
Diffstat (limited to 'chimere/templates')
| -rw-r--r-- | chimere/templates/admin/managed_modified.html | 47 | ||||
| -rw-r--r-- | chimere/templates/chimere/blocks/ol_map.html | 31 | ||||
| -rw-r--r-- | chimere/templates/chimere/detail.html | 3 |
3 files changed, 81 insertions, 0 deletions
diff --git a/chimere/templates/admin/managed_modified.html b/chimere/templates/admin/managed_modified.html new file mode 100644 index 0000000..c55650d --- /dev/null +++ b/chimere/templates/admin/managed_modified.html @@ -0,0 +1,47 @@ +{% extends "admin/base_site.html" %} +{% load chimere_tags i18n admin_static %} + +{% block extrahead %} +<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" /> +<script src="http://www.openlayers.org/api/OpenLayers.js"></script> +{% endblock %} + + +{% block content %} +<p class='errornote'>{% trans "Be careful: after validation, the modified item will be deleted. There is no roll-back." %}</p> +<fieldset class='module'> +<form method='POST' action='.'> +{% csrf_token %} +<input type='hidden' name='action' value='managed_modified'/> +<input type='hidden' name='rapprochement' value='1'/> +<input type='hidden' name='_selected_action' value='{{item.pk}}'/> +<table> +<thead> +<tr><th> </th><th>{% trans "Reference" %}</th><th>{% trans "Modified item" %}</th><th>{% trans "Accept modification" %}</th></tr> +</thead> +<tbody> +<tr><th>{% trans "Name" %}</th><td>{{item_ref}}</td><td>{{item}}</td><td><input type='checkbox' name='name'/></td></tr> +<tr> + <th>{% trans "Categories" %}</th> + <td>{% for cat in item_ref.categories.all %}{%if forloop.counter0 %}, {%endif%}{{cat}}{%endfor%}</td> + <td>{% for cat in item.categories.all %}{%if forloop.counter0 %}, {%endif%}{{cat}}{%endfor%}</td> + <td><input type='checkbox' name='categories'/></td> +</tr> +<tr><th>{% trans "Emplacement" %}</th><td>{{item_ref|ol_map:'map_ref_id'}}</td><td>{{item|ol_map:'map_id'}}</td><td><input type='checkbox' name='{{item.geom_attr}}'/></td></tr> +<tr><th>{% trans "Description" %}</th><td>{{item_ref.description|safe}}</td><td>{{item.description|safe}}</td><td><input type='checkbox' name='description'/></td></tr> +{% for property_ref in item_ref.getProperties %} +{% for property in item.getProperties %} +{% ifequal property_ref.propertymodel property.propertymodel %} +<tr><th>{{property.propertymodel.name}}</th><td>{{property_ref.value|safe}}</td><td>{{property.value|safe}}</td><td><input type='checkbox' name='property_{{property.propertymodel.pk}}'/></td></tr> +{% endifequal %} +{% endfor %} +{% endfor %} +</tbody> +</table> +</fieldset> +<div class='submit-row'> +<p class='deletelink-box'><a href="{% if item.point %}{% url admin:chimere_marker_changelist %}{%else%}{% url admin:chimere_route_changelist %}{%endif%}">{% trans "Back to list" %}</a></p> +<input class='default' type='submit' value='{% trans "Validate" %}'/> +</div> +</form> +{% endblock %} diff --git a/chimere/templates/chimere/blocks/ol_map.html b/chimere/templates/chimere/blocks/ol_map.html new file mode 100644 index 0000000..a12651c --- /dev/null +++ b/chimere/templates/chimere/blocks/ol_map.html @@ -0,0 +1,31 @@ +{% load unlocalize_point %} +<div id="{{map_id}}" style="height:250px;width:250px;"></div> +<script> + {{map_id}} = new OpenLayers.Map("{{map_id}}"); + {{map_id}}.addLayer(new OpenLayers.Layer.OSM()); + var fromProjection = new OpenLayers.Projection("EPSG:4326"); + var toProjection = new OpenLayers.Projection("EPSG:900913"); + {% ifequal geom_type 'point' %} + var lat = '{{geom.y|unlocalize_point}}'; + var lon = '{{geom.x|unlocalize_point}}'; + var position = new OpenLayers.LonLat(lon, lat).transform(fromProjection, + toProjection); + + var {{map_id}}markers = new OpenLayers.Layer.Markers( "Markers" ); + {{map_id}}.addLayer({{map_id}}markers); + {{map_id}}markers.addMarker(new OpenLayers.Marker(position)); + var zoom = 18; + {{map_id}}.setCenter(position, zoom); + {% else %} + var wkt_reader = new OpenLayers.Format.WKT({ + 'internalProjection':toProjection, + 'externalProjection':fromProjection + }); + var {{map_id}}vectors = new OpenLayers.Layer.Vector("Vector Layer"); + {{map_id}}.addLayer({{map_id}}vectors); + var {{map_id}}features = wkt_reader.read('{{geom.wkt}}'); + {{map_id}}vectors.addFeatures([{{map_id}}features]); + + {{map_id}}.zoomToExtent({{map_id}}vectors.getDataExtent()); + {% endifequal %} +</script> diff --git a/chimere/templates/chimere/detail.html b/chimere/templates/chimere/detail.html index 7fd2b2b..134c03e 100644 --- a/chimere/templates/chimere/detail.html +++ b/chimere/templates/chimere/detail.html @@ -28,6 +28,9 @@ <a href='#' class='show_gallery_link'>{% trans "Show multimedia gallery" %}</a> {% endif %} </div> + <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%}'> + {% 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" %} |
