From 52e41e7cd766a329896b070c55bf784bbb3f98d2 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 4 Jan 2013 12:48:39 +0100 Subject: [PATCH] Move styles form fields in a separate template Working on yohanboniface/django-leaflet-storage#21 --- umap/templates/leaflet_storage/category_form.html | 10 +--------- umap/templates/leaflet_storage/feature_form.html | 4 +--- umap/templates/umap/styles_fieldset.html | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 umap/templates/umap/styles_fieldset.html diff --git a/umap/templates/leaflet_storage/category_form.html b/umap/templates/leaflet_storage/category_form.html index c1915a60..5a7f295c 100644 --- a/umap/templates/leaflet_storage/category_form.html +++ b/umap/templates/leaflet_storage/category_form.html @@ -6,21 +6,13 @@ {% endfor %} {% foundation_field form.name %} {% foundation_field form.description %} - {% foundation_field form.color %} -
-
- {% foundation_field form.icon_class %} -
-
- {% foundation_field form.pictogram %} -
-
{% foundation_field form.rank %}
{{ form.display_on_load.label }}{{ form.display_on_load }}
{{ form.display_on_load.help_text }} {{ form.map }} + {% include "umap/styles_fieldset.html" %} {% if delete_url %} {% trans "Delete" %} diff --git a/umap/templates/leaflet_storage/feature_form.html b/umap/templates/leaflet_storage/feature_form.html index f1f97f7e..5fafacda 100644 --- a/umap/templates/leaflet_storage/feature_form.html +++ b/umap/templates/leaflet_storage/feature_form.html @@ -4,10 +4,8 @@ {{ form.no_field_errors }} {% foundation_field form.name %} {% foundation_field form.description %} - {% foundation_field form.color %} -

{% foundation_field form.category %} -

+ {% include "umap/styles_fieldset.html" %} {{ form.latlng }} {% if delete_url %} diff --git a/umap/templates/umap/styles_fieldset.html b/umap/templates/umap/styles_fieldset.html new file mode 100644 index 00000000..b9057732 --- /dev/null +++ b/umap/templates/umap/styles_fieldset.html @@ -0,0 +1,15 @@ +{% load umap_tags i18n %} +
+ {% trans "Styles" %} + {% foundation_field form.color %} + {% if form.icon_class and form.pictogram %} +
+
+ {% foundation_field form.icon_class %} +
+
+ {% foundation_field form.pictogram %} +
+
+ {% endif %} +