From c20721a25df50878fd6d472f3fdfb892166eb72d Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 18 Jul 2012 21:29:08 +0200 Subject: Improve user submissions (routes and markers) --- chimere/static/chimere/css/forms.css | 29 ++++++- chimere/static/chimere/js/edit_route_map.js | 1 + chimere/templates/chimere/edit.html | 104 +++++++++++++----------- chimere/templates/chimere/edit_route.html | 95 ++++++++++++---------- example_project/locale/fr/LC_MESSAGES/django.po | 8 +- 5 files changed, 139 insertions(+), 98 deletions(-) diff --git a/chimere/static/chimere/css/forms.css b/chimere/static/chimere/css/forms.css index 7c6c4e8..5740a62 100644 --- a/chimere/static/chimere/css/forms.css +++ b/chimere/static/chimere/css/forms.css @@ -14,6 +14,27 @@ /**/ +div.rightWrapper{ + width: 100%; + float:left; +} + +div.rightform{ + margin-left:400px; + height:400px; +} + +div.leftform{ + float: left; + width: 400px; + margin-left: -100%; +} + +div.bottomform{ + clear: left; + width: 100%; +} + #map_edit{ margin:0; border: 1px solid black; @@ -81,10 +102,14 @@ } .help-route{ - width:98%; + width:250px; + float:right; + position:absolute; + z-index:1000; + right:45px; background-color:#EEF;; margin: 10px 0; - padding:0 4px; + padding:2px 6px 4px 6px; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; diff --git a/chimere/static/chimere/js/edit_route_map.js b/chimere/static/chimere/js/edit_route_map.js index 1650983..3428e90 100644 --- a/chimere/static/chimere/js/edit_route_map.js +++ b/chimere/static/chimere/js/edit_route_map.js @@ -19,6 +19,7 @@ See the file COPYING for details. function toggleDraw() { jQuery('#draw-toggle-off').hide(); jQuery('#draw-or').hide(); + jQuery('#draw-label').hide(); jQuery('#upload').hide(); jQuery('#map_edit').show(); jQuery('#help-route-create').show(); diff --git a/chimere/templates/chimere/edit.html b/chimere/templates/chimere/edit.html index 5108ab2..cb08623 100644 --- a/chimere/templates/chimere/edit.html +++ b/chimere/templates/chimere/edit.html @@ -22,61 +22,69 @@ {% endif %}
{% trans "Add/modify a site" %} -

* {% trans "indicates a mandatory field" %}

{% csrf_token %} -
- - {% if form.name.errors %}
{{ form.name.errors }}
{% endif %} - {{ form.name }} +
+
+
+ + {%if form.point.errors %}
  • {% trans "Select a location for this new site" %}
{%endif%} + {{point_widget}} +
+
-
- - {% if form.categories.errors %}
{{ form.categories.errors }}
{% endif %} - {{ form.categories }} +
+

* {% trans "indicates a mandatory field" %}

+
+ + {% if form.name.errors %}
{{ form.name.errors }}
{% endif %} + {{ form.name }} +
+
+ + {% if form.categories.errors %}
{{ form.categories.errors }}
{% endif %} + {{ form.categories }} +
+
+ + {{ form.description.errors }} + {{ form.description }} +

{{ form.description.help_text }}

+
+ {% if dated %} +
+ + {{ form.start_date.errors }} + {{ form.start_date }} +

{{ form.start_date.help_text }}

+
+
+ + {{ form.end_date.errors }} + {{ form.end_date }} +

{{ form.end_date.help_text }}

+
+ {% endif %}
-
- - {%if form.point.errors %}
  • {% trans "Select a location for this new site" %}
{%endif%} - {{point_widget}} -
-
- - {{ form.description.errors }} - {{ form.description }} -

{{ form.description.help_text }}

-
- {% if dated %} -
- - {{ form.start_date.errors }} - {{ form.start_date }} -

{{ form.start_date.help_text }}

-
-
- - {{ form.end_date.errors }} - {{ form.end_date }} -

{{ form.end_date.help_text }}

-
- {% endif %} - {% for field in form %} - {% for property in properties %} - {% ifequal field.name property %} -
- - {{ field.errors }} - {% if field.errors %}
{{ field.errors }}
{% endif %} - {{ field }} -
- {%endifequal%} +
+ {% for field in form %} + {% for property in properties %} + {% ifequal field.name property %} +
+ + {{ field.errors }} + {% if field.errors %}
{{ field.errors }}
{% endif %} + {{ field }} +
+ {%endifequal%} + {%endfor%} {%endfor%} - {%endfor%} - {% inline_formset "Multimedia files" formset_multi %} - {% inline_formset "Picture files" formset_picture %} + {% inline_formset "Multimedia files" formset_multi %} + {% inline_formset "Picture files" formset_picture %} -

+

+
diff --git a/chimere/templates/chimere/edit_route.html b/chimere/templates/chimere/edit_route.html index fb4cf9a..a8121db 100644 --- a/chimere/templates/chimere/edit_route.html +++ b/chimere/templates/chimere/edit_route.html @@ -19,56 +19,63 @@ {% if error_message %}

{{ error_message }}

{% endif %}
{% trans "Add/modify a route" %} -

* {% trans "indicates a mandatory field" %}

{% csrf_token %} -
- - {{ form.name.errors }} - {{ form.name }} +
+
+
+ + {%if form.point.errors %}
  • {% trans "Select a location for this new site" %}
{%endif%} + {{route_widget}} +
+
-
- - {{ form.categories.errors }} - {{ form.categories }} +
+

* {% trans "indicates a mandatory field" %}

+
+ + {{ form.name.errors }} + {{ form.name }} +
+
+ + {{ form.categories.errors }} + {{ form.categories }} +
+
+ + {{ form.description.errors }} + {{ form.description }} +
+ {% if dated %} +
+ + {{ form.start_date.errors }} + {{ form.start_date }} +

{{ form.start_date.help_text }}

+
+
+ + {{ form.end_date.errors }} + {{ form.end_date }} +

{{ form.end_date.help_text }}

+
+ {% endif %}
-
- - {%if form.point.errors %}
  • {% trans "Select a location for this new site" %}
{%endif%} - {{route_widget}} -
- - {% if dated %} -
- - {{ form.start_date.errors }} - {{ form.start_date }} -

{{ form.start_date.help_text }}

-
-
- - {{ form.end_date.errors }} - {{ form.end_date }} -

{{ form.end_date.help_text }}

-
- {% endif %} - {%for field in form%}{%for property in properties%}{%ifequal field.name property%} -
- - {{ field.errors }} - {{ field }} -
- {%endifequal%}{%endfor%}{%endfor%} +
+ {%for field in form%}{%for property in properties%}{%ifequal field.name property%} +
+ + {{ field.errors }} + {{ field }} +
+ {%endifequal%}{%endfor%}{%endfor%} - {% inline_formset "Multimedia files" formset_multi %} - {% inline_formset "Picture files" formset_picture %} + {% inline_formset "Multimedia files" formset_multi %} + {% inline_formset "Picture files" formset_picture %} -

+

+
diff --git a/example_project/locale/fr/LC_MESSAGES/django.po b/example_project/locale/fr/LC_MESSAGES/django.po index 8ef85f9..2f730e4 100644 --- a/example_project/locale/fr/LC_MESSAGES/django.po +++ b/example_project/locale/fr/LC_MESSAGES/django.po @@ -656,7 +656,7 @@ msgstr "Mode création" #: extra-locales/chimere/widgets.py:245 msgid "To start drawing the route click on the toggle button: \"Draw\"." -msgstr "Pour commencer le dessin cliquez sur le bouton : « Tracer » " +msgstr "Pour commencer le dessin cliquez sur le bouton : « Tracer »." #: extra-locales/chimere/widgets.py:247 msgid "Then click on the map to begin the drawing." @@ -679,8 +679,8 @@ msgid "" "While creating to undo a drawing click again on the toggle button \"Stop " "drawing\"." msgstr "" -"En mode création vous pouvez annuler un tracé en appuyant sur le bouton « " -"Arrêter le tracé »" +"En mode création vous pouvez annuler un tracé en appuyant sur le bouton « " +"Arrêter le tracé »." #: extra-locales/chimere/widgets.py:256 msgid "Modification mode" @@ -698,7 +698,7 @@ msgid "" "\" key." msgstr "" "Pour supprimer un point, mettez le curseur de la souris sur celui-ci et " -"appuyez sur le touche « d » ou « Suppr »" +"appuyez sur le touche « d » ou « Suppr »." #: extra-locales/chimere/widgets.py:260 msgid "" -- cgit v1.2.3