From c70992b801209ee06ebe5be0feca719a8690bf86 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 27 Nov 2012 17:56:17 +0100 Subject: Add not_for_osm to admin marker form --- chimere/admin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'chimere/admin.py') diff --git a/chimere/admin.py b/chimere/admin.py index 1d3dcbe..b2ae7e1 100644 --- a/chimere/admin.py +++ b/chimere/admin.py @@ -194,8 +194,8 @@ class MarkerAdmin(admin.ModelAdmin): }), (_(u"Import"), { 'classes':('collapse',), - 'fields': ('modified_since_import', 'import_source', - 'origin', 'license') + 'fields': ('not_for_osm', 'modified_since_import', + 'import_source', 'origin', 'license') }), (_(u"Advanced options"), { 'classes':('collapse',), -- cgit v1.2.3 From c590082daa7b5eca6d5f021e356e4ddd15cee595 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 28 Nov 2012 00:54:09 +0100 Subject: Update documentation --- chimere/admin.py | 8 +- chimere/models.py | 3 +- .../_images/chimere_admin_modified_management.png | Bin 0 -> 93852 bytes docs/_build/html/_sources/administration.txt | 129 ++++++++++++++++---- docs/_build/html/_sources/configuration.txt | 59 +++++++--- docs/_build/html/_sources/customisation.txt | 42 +++++-- docs/_build/html/_sources/import_export.txt | 3 + docs/_build/html/_sources/index.txt | 2 +- docs/_build/html/_sources/install.txt | 10 +- docs/_build/html/_sources/upgrade.txt | 2 +- .../_static/chimere_admin_modified_management.png | Bin 0 -> 93852 bytes docs/_build/html/_static/jquery.js | 2 +- docs/_build/html/administration.html | 131 ++++++++++++++++----- docs/_build/html/configuration.html | 69 +++++++---- docs/_build/html/customisation.html | 57 +++++---- docs/_build/html/import_export.html | 25 +++- docs/_build/html/index.html | 21 ++-- docs/_build/html/install.html | 8 +- docs/_build/html/objects.inv | Bin 230 -> 311 bytes docs/_build/html/searchindex.js | 2 +- docs/_build/html/upgrade.html | 2 +- docs/_static/chimere_admin_modified_management.png | Bin 0 -> 93852 bytes docs/administration.rst | 126 ++++++++++++++++---- docs/configuration.rst | 59 +++++++--- docs/customisation.rst | 42 +++++-- docs/import_export.rst | 3 + docs/index.rst | 2 +- 27 files changed, 611 insertions(+), 196 deletions(-) create mode 100644 docs/_build/html/_images/chimere_admin_modified_management.png create mode 100644 docs/_build/html/_static/chimere_admin_modified_management.png create mode 100644 docs/_static/chimere_admin_modified_management.png (limited to 'chimere/admin.py') diff --git a/chimere/admin.py b/chimere/admin.py index b2ae7e1..2d5f8bf 100644 --- a/chimere/admin.py +++ b/chimere/admin.py @@ -181,7 +181,7 @@ class MarkerAdmin(admin.ModelAdmin): exclude = ['submiter_session_key', 'import_key', 'import_version', 'available_date'] readonly_fields = ['submiter_email', 'submiter_comment', 'import_source', - 'ref_item', 'modified_since_import'] + 'ref_item', 'modified_since_import', 'route'] form = MarkerAdminForm fieldsets = ((None, { 'fields': ['point', 'name', 'status', 'categories', @@ -197,7 +197,7 @@ class MarkerAdmin(admin.ModelAdmin): 'fields': ('not_for_osm', 'modified_since_import', 'import_source', 'origin', 'license') }), - (_(u"Advanced options"), { + (_(u"Associated items"), { 'classes':('collapse',), 'fields': ('ref_item', 'route',) }), @@ -238,7 +238,7 @@ class RouteAdmin(admin.ModelAdmin): list_filter = ('status', 'categories') exclude = ['height', 'width'] form = RouteAdminForm - readonly_fields = ('associated_file',) + readonly_fields = ('associated_file', 'ref_item', 'has_associated_marker') actions = [validate, disable, managed_modified, export_to_kml, export_to_shapefile, export_to_csv] fieldsets = ((None, { @@ -255,7 +255,7 @@ class RouteAdmin(admin.ModelAdmin): 'fields': ('modified_since_import', 'import_source', 'origin', 'license') }), - (_(u"Advanced options"), { + (_(u"Associated items"), { 'classes':('collapse',), 'fields': ('ref_item', 'associated_file', 'has_associated_marker') diff --git a/chimere/models.py b/chimere/models.py index daa2d48..f6b1872 100644 --- a/chimere/models.py +++ b/chimere/models.py @@ -283,8 +283,7 @@ class GeographicItem(models.Model): ('A', _(u'Available')), ('M', _(u'Modified')), ('D', _(u'Disabled')), - ('I', _(u'Imported')), - ('E', _(u"Excluded"))) + ('I', _(u'Imported'))) STATUS_DCT = dict(STATUS) status = models.CharField(_(u"Status"), max_length=1, choices=STATUS) import_key = models.CharField(_(u"Import key"), max_length=200, diff --git a/docs/_build/html/_images/chimere_admin_modified_management.png b/docs/_build/html/_images/chimere_admin_modified_management.png new file mode 100644 index 0000000..84e069e Binary files /dev/null and b/docs/_build/html/_images/chimere_admin_modified_management.png differ diff --git a/docs/_build/html/_sources/administration.txt b/docs/_build/html/_sources/administration.txt index db7e078..2f8ddb5 100644 --- a/docs/_build/html/_sources/administration.txt +++ b/docs/_build/html/_sources/administration.txt @@ -60,7 +60,7 @@ Item list #. search items by word (not available for all type of items) #. this filter box permit to filter current entries with some criteria (not available for all type of items) -#. the header of the table is clickable. Click on an header sort the items by +#. the header of the table is cliquable. Click on an header sort the items by this header (ascending or descending). Multiple header sort is possible (the number on the right of the header explain the order of sorting). #. each item can be checked (for applying an action) or selected (by clicking on @@ -80,36 +80,121 @@ Item form item, they can be ordered by drag and drop. #. the form has to be validated by one of theses actions buttons. They are self-explanatory. -Creating news + +Status +****** + +*Status* is a property attached to each geographic item in Chimère. To +administrate efficiently Chimère you need to understand the mean of each status. + +- **Submited**: Status of a new item freshly proposed by an end user. This item + is not visible on the map. +- **Available**: Status of an item visible on the map. +- **Disabled**: Status of a discarded item. +- **Modified**: Status of an amendment proposed by an end-user. +- **Imported**: Status of a newly imported item. Import and export operations + need that all items with *imported* status are treated (validated, disabled + or deleted). + + +Managing news ------------- A news system is available. -All you have to to do is to click on the Add button near News. -For each news you have to provided a name and a content. The content can contain HTML tags. -The avaibility is set with a checkbox. +All you have to to do is to click on the **Add** button near News. +For each news you have to provided a name and a content. The content can contain +HTML tags. +The availability is set with a checkbox. Creating categories/subcategories --------------------------------- -Before adding categories you have to set some icons. Theses icons appears on the map and in the categories' box on the main map. -Be careful to resize correctly your icons. Indeed the icon will be presented at their real size on the map. -To add icons: the Add button near Icons. +Before adding categories you have to set some icons. Theses icons appears on the +map and in the categories' box on the main map. +Be careful to resize correctly your icons. Indeed the icon will be presented at +their real size on the map. +To add icons: the **Add** button near Icons. + +Categories are in fact only containers for subcategories. You'll have to provide +only a name and an order. +To add categories: the **Add** button near categories (quite clear now, isn't +it?) + +Fields of subcategories are: an associated category, a name, an icon, an order, +a color and an element type. +Theses fields are mainly quite self- explanatory. +The color is used to draw routes (if this subcategory contains routes). If it a +basic color it can be set with the English name (for instance: *red*, *blue*, +*yellow* or *purple*) otherwise you can put the HTML RVB code (for instance +*#9227c9*). +The element type is the type of element the subcategory can contain: POI, route +or both. + +Edition/moderation of items +--------------------------- -Categories are in fact only containers for subcategories. You'll have to provide only a name and an order. -To add categories: the Add button near categories (quite clear now, isn't it?) +The moderation step is quite simple. It works the same with POIs and routes. +The moderator can access to all POIs (or routes) by clicking on them on the +list. -Fields of subcategories are: an associated category, a name, an icon, an order, a color and an element type. -Theses fields are mainly quite self-explainatory. -The color is used to draw routes (if this subcategory contains routes). If it a basic color it can be set with the english name (for instance: "red", "blue", "yellow" or "purple") otherwise you can put the HTML RVB code (for instance "#9227c9"). -The element type is the type of element the subcategory can contain: POI, route or both. +A search field is available to search by name but the more interesting is to +filter POIs (or route) by state and by subcategory. -Moderation ----------- +There is a some actions available in the action list. -The moderation step is quite simple. It works the same with POIs and routes. -The moderator can access to all POIs (or routes) by clicking on the Modify button. -A search field is available to search by name but the more interesting is to filter POIs (or route) by state and by subcategory. -Then to modify an item you have to click on his name. -The submission can now freely modified. Compared to the main submission interface there is only on field add: the state field. To be publish in the main site the item must have the state: Available. -If an item is not revelant the Delete button permit to remove it. +- **Delete** to delete selected items. A confirmation step is displayed. +- **Validate** to set the status *Available* to selected items. +- **Disable** to set teh status *Disabled* to selected items. This is useful to + keep items you don't want to be exposed on the map. +- **Managed modified items** to manage the amendment made by end users on the + main site cf. to :ref:`managing-modified`. Modified item has to be treated + one by one. +- **Export to...** to export selected item to the selected format. + + +To modify an item, classically you have to click on his name. +Then you access to a form to freely modify the item. +In this form there is all data available to the end user form plus some extra +fields. The *Import fields* only make sense with data imported from an external +source or for data to be exported to OSM cf. to the :ref:`import section +` of this documentation. *Associated items fields* are read only +fields that list items associated to the current one (reference item of an +amendment, associated file of a route). + +Associated multimedia items are at the bottom of the form. You can freely add, +change items and change their order with drag and drop. + +Don't forget to validate your change with one of the **Save** buttons at the +bottom of the form (it is easily forgot when you change multimedia items). + +If an item is not relevant the **Delete** button permit to remove it. + +.. _managing-modified: + +Managing end user amendment +--------------------------- + +Amendment can be proposed on the main site by end-users. +In Chimère an amendment is a new item with the status *Modified* and with a link +to the reference item modified. + +.. Note:: + If you are logged as an administrator and make changes on the map with the + end user form there will be directly validated. + +A special form has been developed to facilitate the processing of theses +modified items. + +You can access to this special form with the action *Managed modified items*. + +.. image:: _static/chimere_admin_modified_management.png + +This form is a table with three columns. + +#. The first column display the information for the reference item. +#. The second column display the information proposed by the submitter. +#. The third column is a list of checkboxes. For each row checked, after the + validation, the value of the modified item will replace the value of the + reference item. +To reject all modification validate the form with no checkbox checked. diff --git a/docs/_build/html/_sources/configuration.txt b/docs/_build/html/_sources/configuration.txt index f8bed2b..0565509 100644 --- a/docs/_build/html/_sources/configuration.txt +++ b/docs/_build/html/_sources/configuration.txt @@ -33,6 +33,16 @@ To access theses pages you have to identify you with an account with *staff* and A *superuser* account is created at the initialization of the database. +Configuring the sites framework +------------------------------- + +*Sites* framework allow you to serve the same content on different domains. +Most of you will probably use only one domain but this unique domain has to +be configured. This is done in the web administration interface in *Sites > Sites* +You only need to change *example.com* by your domain name. If you forgot to +do that functionality such as RSS feeds will not work properly. + +.. _managing-areas: Managing areas -------------- @@ -40,29 +50,36 @@ Managing areas An *Area* is the base of your map. It defines: * a name: a human readable label for this area. +* an associated URN (*not mandatory*): the name of the area as a web ressource. + In practice, if the area is not the default area the URN is used at the end of + the default URL to access to this area. This is not mandatory but necessary + for each area that is not the default one. * a welcome message (*not mandatory*): this message is displayed once a day per user arriving on the map. -* a map bounding box: this is the default area to display when arriving on the - map. -* restriction on the bounding box: if set to restricted, the end user can't pan - outside the defined bounding box. -* available layers (*not mandatory* OSM Mapnik is used by default): OSM Mapnik - render, OSM MapQuest render, OSM Transport Map render, OSM CycleMap are - available by default. You can add new custom layer cf. :ref:`managing-layers`. -* categories restriction (*not mandatory*): if no restriction is set all - categories are available. +* an order (to sort areas). +* an availability. +* a default state. The /default/ area is viewed by default. Only one area can + be the default: activating this state disable it on the possible other area + with a default state. * default checked categories (*not mandatory*). -* an external CSS file (*not mandatory*): an URL to an external CSS file. * if categories are displayed dynamically (if dynamically is set, the end user only view categories witch have items on the map section the user currently see). -* an associated URN (*not mandatory*): the name of the area as a web ressource. - In practice, if the area is not the default area the URN is used at the end of - the default URL to access to this area. This is not mandatory but necessary - for each area that is not the default one. +* categories restriction (*not mandatory*): if no restriction is set all + categories are available. +* an external CSS file (*not mandatory*): an URL to an external CSS file. +* restriction on the bounding box: if set to restricted, the end user can't pan + outside the defined bounding box. Due to technical reasons, there is at this + time no restriction on the zoom. +* a map bounding box: this is the area to display when arriving on the map. If + the area is restricted it will be the bounding box that restrict the end user. + Hold the control key, click and drag to draw the bounding box. +* available layers (*not mandatory* OSM Mapnik is used by default): OSM Mapnik + render, OSM MapQuest render, OSM Transport Map render, OSM CycleMap are + available by default. You can add new custom layer cf. :ref:`managing-layers`. *Areas* are customizable directly on the web administration interface in -*Chimere/Areas*. +*Chimere > Areas*. As there is little chance that the default area is appropriate for you, you'll have to set at least one default area. @@ -92,8 +109,8 @@ and a default password (the user can change it on in own later). Then complete the other pieces of information. -Check the case: *Staff status* (or this user will not be able to log to -the administration website). +Check the case: *Staff status* (or this user will not be able to log to the +administration website). If this account is a new technical administrator, check *Superuser status* (this user must be trustworthy!). Otherwise you'll have to give permissions to this @@ -151,15 +168,19 @@ model*). The administration page ask you for: * a name, -* an order (to order between other properties), +* an order (to sort properties), * an availability to the end user (this can be used to set hidden properties), * a mandatory status, * the categories the property applied to (if no categories selected it applied to all), * the type: text, long text, password or date. -To make this property available it is necessary to reload your webserver (the +To make this property available it is necessary to reload your web server (the property is cached). All forms are then automatically updated with this new field. +If you don't want to allow add and modification of properties you can disable +this form by setting CHIMERE_HIDE_PROPERTYMODEL to *True* in your +*local_settings.py* file. + diff --git a/docs/_build/html/_sources/customisation.txt b/docs/_build/html/_sources/customisation.txt index e27be01..19002dc 100644 --- a/docs/_build/html/_sources/customisation.txt +++ b/docs/_build/html/_sources/customisation.txt @@ -12,13 +12,41 @@ This documents presents the installation of Chimère. The version has been updated for version 2.0.0. -Updating the design -------------------- - -You can of course customize Chimère with your own CSS. To do that just edit the file static/styles.css. - -After this basic configuration done the harder is done. You can do now application administration tasks. - .. _managing-layers: + Managing layers --------------- + +There is some different layers available by default in Chimère (OSM Mapnik, OSM +Mapquest, OSM Transport map, OSM Cyclemap). You can add some extra layer using +the web administration pages of Chimère. The new layer is defined with the +appropriate `Openlayers `_ JS code. This JS code must +be a compatible Openlayers Layer instance with no ending semi-colon. For +instance defining a Bing layer can be done with this kind of code:: + + new OpenLayers.Layer.Bing({ + name: "Aerial", + key: "my-bing-API-key", + type: "Aerial"}) + + +Refer to the `Openlayers documentation API +`_ +for more details. + + +Customizing the layout and the design +------------------------------------- + +If you only want to customize the CSS, the easiest way to do it is to add a +link to an extra CSS to your *Areas* cf. :ref:`managing-areas`. + +If you want to do larger changes in the layout and the style the (well named) +example_project can be customized to fit your needs. Each template file present +in the *chimere/templates* directory can be copied in your *myproject/templates* +directory and then modified. +You only need to copy files that you want to modify. Theses files are in +Django template language mainly made of pure HTML with some logic. Refer to +the `Django template documentation `_ +for more details. + diff --git a/docs/_build/html/_sources/import_export.txt b/docs/_build/html/_sources/import_export.txt index 890a644..3d4b0ed 100644 --- a/docs/_build/html/_sources/import_export.txt +++ b/docs/_build/html/_sources/import_export.txt @@ -11,4 +11,7 @@ Chimère import/export This documents presents the administration of Chimère. The version has been updated for version 2.0.0. +.. _importing: +Importing +--------- diff --git a/docs/_build/html/_sources/index.txt b/docs/_build/html/_sources/index.txt index 45f40e0..ee1dd6f 100644 --- a/docs/_build/html/_sources/index.txt +++ b/docs/_build/html/_sources/index.txt @@ -12,6 +12,6 @@ Welcome to Chimère's documentation! install upgrade configuration - customisation administration import_export + customisation diff --git a/docs/_build/html/_sources/install.txt b/docs/_build/html/_sources/install.txt index 2dd745b..10c333e 100644 --- a/docs/_build/html/_sources/install.txt +++ b/docs/_build/html/_sources/install.txt @@ -60,7 +60,7 @@ Linux distribution repositories. For instance on Debian Wheezy:: On Debian Squeeze (you need to activate backports):: - apt-get install -t squeeze-backports python-django + apt-get install -t squeeze-backports python-django libjs-jquery apt-get install python python-django-south python-beautifulsoup tinymce \ apache2 libgeos-3.2.0 proj-bin gdal-bin python-gdal python-lxml \ @@ -272,3 +272,11 @@ To activate the website reload apache:: a2ensite chimere /etc/init.d/apache2 reload +If you encounter problem with the upload of files with Unicode chars in their +names activate the appropriate locale in Apache. On a Debian server with UTF-8 +as default encoding in the file */etc/apache2/envvars* uncomment the following +line:: + + . /etc/default/locale + + diff --git a/docs/_build/html/_sources/upgrade.txt b/docs/_build/html/_sources/upgrade.txt index f2d0d64..d7c7233 100644 --- a/docs/_build/html/_sources/upgrade.txt +++ b/docs/_build/html/_sources/upgrade.txt @@ -45,7 +45,7 @@ Then install the new dependencies:: apt-get install -t squeeze-backports python-django python-django-south \ python-simplejson libjs-jquery-ui python-pyexiv2 \ - python-feedparser javascript-common + python-feedparser javascript-common libjs-jquery Debian Wheezy +++++++++++++ diff --git a/docs/_build/html/_static/chimere_admin_modified_management.png b/docs/_build/html/_static/chimere_admin_modified_management.png new file mode 100644 index 0000000..84e069e Binary files /dev/null and b/docs/_build/html/_static/chimere_admin_modified_management.png differ diff --git a/docs/_build/html/_static/jquery.js b/docs/_build/html/_static/jquery.js index f8b3fb8..96d660c 100644 --- a/docs/_build/html/_static/jquery.js +++ b/docs/_build/html/_static/jquery.js @@ -11,7 +11,7 @@ * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * - * Date: Sat Aug 4 06:33:40 UTC 2012 + * Date: Thu Nov 15 18:28:24 BRST 2012 */ (function( window, undefined ) { diff --git a/docs/_build/html/administration.html b/docs/_build/html/administration.html index f5cd345..518d2a9 100644 --- a/docs/_build/html/administration.html +++ b/docs/_build/html/administration.html @@ -27,7 +27,7 @@ - + +
+

Status

+

Status is a property attached to each geographic item in Chimère. To +administrate efficiently Chimère you need to understand the mean of each status.

+
    +
  • Submited: Status of a new item freshly proposed by an end user. This item +is not visible on the map.
  • +
  • Available: Status of an item visible on the map.
  • +
  • Disabled: Status of a discarded item.
  • +
  • Modified: Status of an amendment proposed by an end-user.
  • +
  • Imported: Status of a newly imported item. Import and export operations +need that all items with imported status are treated (validated, disabled +or deleted).
  • +
+
-
-

Creating news

+
+

Managing news

A news system is available. -All you have to to do is to click on the Add button near News. -For each news you have to provided a name and a content. The content can contain HTML tags. -The avaibility is set with a checkbox.

+All you have to to do is to click on the Add button near News. +For each news you have to provided a name and a content. The content can contain +HTML tags. +The availability is set with a checkbox.

Creating categories/subcategories

-

Before adding categories you have to set some icons. Theses icons appears on the map and in the categories’ box on the main map. -Be careful to resize correctly your icons. Indeed the icon will be presented at their real size on the map. -To add icons: the Add button near Icons.

-

Categories are in fact only containers for subcategories. You’ll have to provide only a name and an order. -To add categories: the Add button near categories (quite clear now, isn’t it?)

-

Fields of subcategories are: an associated category, a name, an icon, an order, a color and an element type. -Theses fields are mainly quite self-explainatory. -The color is used to draw routes (if this subcategory contains routes). If it a basic color it can be set with the english name (for instance: “red”, “blue”, “yellow” or “purple”) otherwise you can put the HTML RVB code (for instance “#9227c9”). -The element type is the type of element the subcategory can contain: POI, route or both.

+

Before adding categories you have to set some icons. Theses icons appears on the +map and in the categories’ box on the main map. +Be careful to resize correctly your icons. Indeed the icon will be presented at +their real size on the map. +To add icons: the Add button near Icons.

+

Categories are in fact only containers for subcategories. You’ll have to provide +only a name and an order. +To add categories: the Add button near categories (quite clear now, isn’t +it?)

+

Fields of subcategories are: an associated category, a name, an icon, an order, +a color and an element type. +Theses fields are mainly quite self- explanatory. +The color is used to draw routes (if this subcategory contains routes). If it a +basic color it can be set with the English name (for instance: red, blue, +yellow or purple) otherwise you can put the HTML RVB code (for instance +#9227c9). +The element type is the type of element the subcategory can contain: POI, route +or both.

-
-

Moderation

+
+

Edition/moderation of items

The moderation step is quite simple. It works the same with POIs and routes. -The moderator can access to all POIs (or routes) by clicking on the Modify button. -A search field is available to search by name but the more interesting is to filter POIs (or route) by state and by subcategory. -Then to modify an item you have to click on his name. -The submission can now freely modified. Compared to the main submission interface there is only on field add: the state field. To be publish in the main site the item must have the state: Available. -If an item is not revelant the Delete button permit to remove it.

+The moderator can access to all POIs (or routes) by clicking on them on the +list.

+

A search field is available to search by name but the more interesting is to +filter POIs (or route) by state and by subcategory.

+

There is a some actions available in the action list.

+
    +
  • Delete to delete selected items. A confirmation step is displayed.
  • +
  • Validate to set the status Available to selected items.
  • +
  • Disable to set teh status Disabled to selected items. This is useful to +keep items you don’t want to be exposed on the map.
  • +
  • Managed modified items to manage the amendment made by end users on the +main site cf. to Managing end user amendment. Modified item has to be treated +one by one.
  • +
  • Export to... to export selected item to the selected format.
  • +
+

To modify an item, classically you have to click on his name. +Then you access to a form to freely modify the item. +In this form there is all data available to the end user form plus some extra +fields. The Import fields only make sense with data imported from an external +source or for data to be exported to OSM cf. to the import section of this documentation. Associated items fields are read only +fields that list items associated to the current one (reference item of an +amendment, associated file of a route).

+

Associated multimedia items are at the bottom of the form. You can freely add, +change items and change their order with drag and drop.

+

Don’t forget to validate your change with one of the Save buttons at the +bottom of the form (it is easily forgot when you change multimedia items).

+

If an item is not relevant the Delete button permit to remove it.

+
+
+

Managing end user amendment

+

Amendment can be proposed on the main site by end-users. +In Chimère an amendment is a new item with the status Modified and with a link +to the reference item modified.

+
+

Note

+

If you are logged as an administrator and make changes on the map with the +end user form there will be directly validated.

+
+

A special form has been developed to facilitate the processing of theses +modified items.

+

You can access to this special form with the action Managed modified items.

+_images/chimere_admin_modified_management.png +

This form is a table with three columns.

+
    +
  1. The first column display the information for the reference item.
  2. +
  3. The second column display the information proposed by the submitter.
  4. +
  5. The third column is a list of checkboxes. For each row checked, after the +validation, the value of the modified item will replace the value of the +reference item.
  6. +
+

To reject all modification validate the form with no checkbox checked.

@@ -171,18 +242,20 @@ If an item is not revelant the Delete button permit to remove it.

  • Main page
  • Item list
  • Item form
  • +
  • Status
  • -
  • Creating news
  • +
  • Managing news
  • Creating categories/subcategories
  • -
  • Moderation
  • +
  • Edition/moderation of items
  • +
  • Managing end user amendment
  • Previous topic

    -

    Chimère customisation

    +

    Configuration

    Next topic

    Chimère import/export

    @@ -218,7 +291,7 @@ If an item is not revelant the Delete button permit to remove it.

    next |
  • - previous |
  • Chimère 2.0 documentation »
  • diff --git a/docs/_build/html/configuration.html b/docs/_build/html/configuration.html index 01ab81f..18966df 100644 --- a/docs/_build/html/configuration.html +++ b/docs/_build/html/configuration.html @@ -26,7 +26,7 @@ - + @@ -37,7 +37,7 @@ index
  • - next |
  • +

    Configuring the sites framework

    +

    Sites framework allow you to serve the same content on different domains. +Most of you will probably use only one domain but this unique domain has to +be configured. This is done in the web administration interface in Sites > Sites +You only need to change example.com by your domain name. If you forgot to +do that functionality such as RSS feeds will not work properly.

    +
  • -

    Managing areas

    +

    Managing areas

    An Area is the base of your map. It defines:

    • a name: a human readable label for this area.
    • +
    • an associated URN (not mandatory): the name of the area as a web ressource. +In practice, if the area is not the default area the URN is used at the end of +the default URL to access to this area. This is not mandatory but necessary +for each area that is not the default one.
    • a welcome message (not mandatory): this message is displayed once a day per user arriving on the map.
    • -
    • a map bounding box: this is the default area to display when arriving on the -map.
    • -
    • restriction on the bounding box: if set to restricted, the end user can’t pan -outside the defined bounding box.
    • -
    • available layers (not mandatory OSM Mapnik is used by default): OSM Mapnik -render, OSM MapQuest render, OSM Transport Map render, OSM CycleMap are -available by default. You can add new custom layer cf. managing-layers.
    • -
    • categories restriction (not mandatory): if no restriction is set all -categories are available.
    • +
    • an order (to sort areas).
    • +
    • an availability.
    • +
    • a default state. The /default/ area is viewed by default. Only one area can +be the default: activating this state disable it on the possible other area +with a default state.
    • default checked categories (not mandatory).
    • -
    • an external CSS file (not mandatory): an URL to an external CSS file.
    • if categories are displayed dynamically (if dynamically is set, the end user only view categories witch have items on the map section the user currently see).
    • -
    • an associated URN (not mandatory): the name of the area as a web ressource. -In practice, if the area is not the default area the URN is used at the end of -the default URL to access to this area. This is not mandatory but necessary -for each area that is not the default one.
    • +
    • categories restriction (not mandatory): if no restriction is set all +categories are available.
    • +
    • an external CSS file (not mandatory): an URL to an external CSS file.
    • +
    • restriction on the bounding box: if set to restricted, the end user can’t pan +outside the defined bounding box. Due to technical reasons, there is at this +time no restriction on the zoom.
    • +
    • a map bounding box: this is the area to display when arriving on the map. If +the area is restricted it will be the bounding box that restrict the end user. +Hold the control key, click and drag to draw the bounding box.
    • +
    • available layers (not mandatory OSM Mapnik is used by default): OSM Mapnik +render, OSM MapQuest render, OSM Transport Map render, OSM CycleMap are +available by default. You can add new custom layer cf. Managing layers.

    Areas are customizable directly on the web administration interface in -Chimere/Areas.

    +Chimere > Areas.

    As there is little chance that the default area is appropriate for you, you’ll have to set at least one default area.

    Adding many area can be a mean to show your map in different flavors.

    @@ -129,8 +144,8 @@ password):

    To create a new account, simply click on the Add button near Users. Give a name and a default password (the user can change it on in own later).

    Then complete the other pieces of information.

    -

    Check the case: Staff status (or this user will not be able to log to -the administration website).

    +

    Check the case: Staff status (or this user will not be able to log to the +administration website).

    If this account is a new technical administrator, check Superuser status (this user must be trustworthy!). Otherwise you’ll have to give permissions to this new user. It is easier to don’t add permission manually but make this user @@ -229,16 +244,19 @@ model).

    The administration page ask you for:

    • a name,
    • -
    • an order (to order between other properties),
    • +
    • an order (to sort properties),
    • an availability to the end user (this can be used to set hidden properties),
    • a mandatory status,
    • the categories the property applied to (if no categories selected it applied to all),
    • the type: text, long text, password or date.
    -

    To make this property available it is necessary to reload your webserver (the +

    To make this property available it is necessary to reload your web server (the property is cached).

    All forms are then automatically updated with this new field.

    +

    If you don’t want to allow add and modification of properties you can disable +this form by setting CHIMERE_HIDE_PROPERTYMODEL to True in your +local_settings.py file.

    @@ -251,6 +269,7 @@ property is cached).

    Table Of Contents

  • Configuration
  • -
  • Chimère customisation -
  • Administration +
  • +
  • Chimère import/export +
  • +
  • Chimère customisation
  • -
  • Chimère import/export
  • diff --git a/docs/_build/html/install.html b/docs/_build/html/install.html index 6f74a04..2c0ea7f 100644 --- a/docs/_build/html/install.html +++ b/docs/_build/html/install.html @@ -118,7 +118,7 @@ Linux distribution repositories. For instance on Debian Wheezy:

    python-pyexiv2 python-feedparser javascript-common

    On Debian Squeeze (you need to activate backports):

    -
    apt-get install -t squeeze-backports python-django
    +
    apt-get install -t squeeze-backports python-django libjs-jquery
     
     apt-get install python python-django-south python-beautifulsoup tinymce \
         apache2 libgeos-3.2.0 proj-bin gdal-bin python-gdal python-lxml \
    @@ -307,6 +307,12 @@ mkdir /var/log/apache2/chimere/
    a2ensite chimere
     /etc/init.d/apache2 reload
    +

    If you encounter problem with the upload of files with Unicode chars in their +names activate the appropriate locale in Apache. On a Debian server with UTF-8 +as default encoding in the file /etc/apache2/envvars uncomment the following +line:

    +
    . /etc/default/locale
    +
    diff --git a/docs/_build/html/objects.inv b/docs/_build/html/objects.inv index 7a41eb7..d0161af 100644 Binary files a/docs/_build/html/objects.inv and b/docs/_build/html/objects.inv differ diff --git a/docs/_build/html/searchindex.js b/docs/_build/html/searchindex.js index 1cdf783..e21926c 100644 --- a/docs/_build/html/searchindex.js +++ b/docs/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({objects:{},terms:{all:[1,3,6],code:[1,3,4],forget:[1,3],yellow:3,signific:[1,4],osm:6,follow:[1,6,4],feedpars:[1,4],content:3,depend:[2,1,4],zone:4,readabl:[6,4],base_url:[],send:4,easiest:[],init:4,program:[],titl:3,text:6,larg:4,town:[],sourc:[2,1,4],string:[1,4],createsuperus:6,relev:4,administr:[0,2,3,4,5,6],button:[6,3],list:[3,4],geograph:[6,4],item:[6,3],form:[6,3],quick:[],initialis:[2,1,6,4],dir:4,pleas:4,base_us:[],direct:1,sign:4,design:[0,2],download:4,further:1,myusernam:4,click:[6,3],blue:3,index:[],appear:3,compar:3,section:6,multimedia:6,abl:6,beautifulsoup:4,access:[6,3],delet:[6,3],version:[0,1,2,3,4,5,6],"new":[2,1,3,6,4],net:[1,4],chimer:[1,3,6,4],chose:[],createdb:4,french:4,"005k":1,witch:6,address:[],path:[6,3,4],modifi:[6,3,4],sinc:4,interpret:[],box:[6,3],search:3,host:[],prior:[],permit:[6,3],action:3,template_context_processor:[],chang:[1,3,6,4],chanc:6,environn:1,chimere_tag:1,repositori:[1,4],father:[],modul:[],apt:[1,4],vim:[1,4],put:3,authentifi:3,subcategori:[2,6,3],fake:1,marker:1,instal:[0,1,6,4,2],select:[6,3],from:[1,3,4],would:[1,4],univers:4,upgrad:[2,1],next:1,websit:[6,4],few:[6,3],handler:[],usr:[1,4],criteria:3,type:[6,3,4],more:[6,3,4],sort:3,where_is_your_chimer:3,desir:4,share:4,relat:4,server_url:1,customis:[0,1,2],phone:6,"export":[2,5],indic:[],particular:4,recommand:4,unpack:4,cach:[2,1,6],must:[1,3,6,4],psql:4,"static":[0,1,4],account:[6,3,4],word:3,hour:6,prepar:1,work:[1,3],uniqu:4,soup:4,paragraph:[1,6],can:[0,1,3,6,4],lc_messag:4,default_categori:[],root:4,prompt:4,tar:4,give:6,process:1,sudo:[],smtp:4,templat:[2,1,4],tarbal:1,tag:[3,4],want:[6,4],default_cent:[],mapnik:6,lxml:[1,4],end:[6,3],anoth:4,length:[1,4],write:[],verifi:1,simpl:[6,3],css:[0,6],email_host:4,map:[6,3],product:1,rebas:1,pypi:4,clone:[1,4],after:[0,1],superus:6,upload:1,manuali:[],befor:[1,3],plane:1,beauti:4,date:[0,1,3,4,5,6],multipl:3,data:[1,4],"short":4,practic:6,bind:1,postgi:4,lost:1,stash:1,django:[1,6,4],issu:[],inform:6,environ:[1,6],jquery_js_url:4,allow:[],order:[6,3],checkbox:3,move:[1,4],becaus:[1,4],meter:1,through:[],tinymce_url:4,still:4,mainli:3,dynam:6,paramet:4,style:0,group:6,cli:[1,6],fit:4,psycopg2:4,clickabl:3,better:4,window:[],requir:[1,6],where_is_chimer:4,media_root:[],hidden:[6,3],main:3,extra_url:[],changepassword:6,them:[1,3,4],recal:[],thei:[6,3],python:[1,4],dai:6,initi:[1,6,4],nov:4,now:[0,1,3,4],choic:[],name:[1,3,6,4],jquery_css_url:4,pyshar:[],gpsbabel:[1,4],off:[],drop:3,refresh:1,xvjf:4,html2text:4,each:[6,3],found:4,unicod:4,updat:[0,1,2,3,4,5,6],mean:6,compil:[2,4],replac:4,jquery_url:1,hard:[],procedur:4,realli:[],backport:[1,4],extract:4,special:[1,4],out:3,variabl:[1,6,4],won:1,tinymc:4,publish:[1,3],categori:[2,6,3],adapt:[1,4],modpython:[],correct:[1,4],red:3,common:[1,4],postgr:4,uncommit:1,migrat:[2,1,4],precaut:1,given:[1,4],free:4,base:[6,4],ask:6,org:[1,4],"9227c9":3,mychimer:[1,6],unpredict:4,gdal:[1,4],care:[3,4],spatial_ref_si:4,could:1,area:[2,6],static_url:1,database_host:[],filter:3,perhap:1,isn:3,outsid:6,root_urlconf:[1,4],auth:6,south:[1,4],first:[1,3,6,4],feed:4,major:1,suffix:[],render:6,feel:4,onc:[6,3],number:[1,3,6,4],yourself:3,restrict:6,mai:6,instruct:1,alreadi:4,done:[0,1,6,4],least:[1,6,4],mydjango:4,owner:4,stabl:[1,4],installed_app:1,optionali:4,size:3,differ:6,"long":6,district:[],script:1,associ:[6,3],top:[],mkdir:[1,4],system:3,messag:6,chimere_dynamic_categori:[],master:1,conveni:3,option:1,copi:[1,4],install_path:4,part:4,consult:3,detail_cont:[],haven:1,png:[],serv:1,provid:[3,4],remov:[1,3],project:[2,1,6,4],pythoninterpret:[],ressourc:6,database_password:[],transport:6,browser:[2,1],favorit:4,ani:[1,4],packag:[1,4],manner:[],have:[1,3,6,4],tabl:[3,4],need:4,element:3,pg_version:4,plpgsql:4,local_set:[1,4],engin:[],bz2:4,min:1,rout:[6,3],port:[],also:[1,3],etienn:[],take:4,which:[],default_data:4,simplifi:1,map_lay:[],sethandl:[],usernam:6,choos:4,most:[6,3,4],letter:[1,4],deploi:[],geodjango:4,icon:[1,3,6],time_zon:4,don:[1,3,6,4],url:[1,3,6,4],doc:[],clear:3,later:[1,6],flow:[],your_chimere_path:1,inde:3,database_port:[],pythonhandl:[],left:[],fact:3,wsgi:[1,4],show:6,german:[],visitor:[2,1],database_us:[],directli:6,session:6,loaddata:4,secret_kei:4,permiss:[6,4],cryptograph:4,staff:6,celeri:[1,4],current:[1,3,6],onli:[1,3,6,4],locat:1,execut:1,copyright:[0,1,3,4,5,6],explain:3,configur:[0,1,6,4,2],apach:[1,4],should:[1,4],theme:6,simpliest:4,local:[1,6,4],media_url:[],contribut:[1,4],get:[2,1,4],familiar:6,your_local_nam:1,stop:1,blank:3,wheezi:[1,4],a2ensit:4,report:1,geo:4,restart:1,enabl:1,chimere_localnam:[1,6],reload:[6,4],integr:1,contain:3,where:6,explainatori:3,view:6,set:[1,3,6,4],project_nam:4,"chim\u00e8r":[0,1,2,3,4,5,6],knowledg:1,displai:[6,3],see:[6,3],mandatori:[6,3],epsg_display_project:[],concern:3,jqueri:[1,4],statu:6,avaibl:3,correctli:3,databas:[2,1,6,4],someth:4,cours:[0,4],label:[6,3],state:3,epsg_project:[],between:[1,6],"import":[2,1,6,4,5],experi:1,email:4,accord:4,javascript:[1,4],appreci:4,kei:4,postgresql_psycopg2:[],job:[],here:4,purpl:3,addit:4,cyclemap:6,both:3,last:4,admin:[1,3,4],gpsbabel_opt:1,etc:[6,4],instanc:[1,3,4],forgotten:6,freeli:3,login:3,whole:[],load:[],simpli:6,technic:6,point:[1,6],color:[6,3],arriv:6,chmod:4,header:3,littl:6,poi:3,mapquest:6,mod_python:[],backend:[],quit:3,folow:1,come:3,empti:[],example_project:[1,4],json:4,valu:[1,4],interest:[6,3],basic:[0,1,3,6],popul:4,createlang:4,regroup:4,imag:4,present:[0,2,3,4,5,6],"case":6,chimere_path:[1,6],look:[6,3],vanilla:[],properti:[2,1,6],harder:0,easier:6,trick:1,defin:6,error:1,value_of_your_localnam:1,fixtur:4,compilemessag:[1,4],openstreetmap:[],real:3,layer:[0,6,2],customiz:6,libj:[1,4],"\u00e9tienn":[0,1,3,4,5,6],site:[3,4],destin:4,archiv:4,conf:4,sever:1,welcom:[2,6],open:6,author:[0,1,3,4,5,6],media:[1,4],make:[1,6],exchang:[],same:[3,4],member:6,html:3,descend:3,document:[0,2,3,4,5,6],mod_wsgi:4,pan:6,complet:[6,4],http:[1,3,4],webserv:[2,1,6,4],effect:3,solut:4,moment:[],user:[2,1,6,4],mani:[1,3,6],extern:6,rvb:3,posgi:4,recent:3,pwprompt:4,task:[0,6],moder:[2,6,3],center:[],chimere_app_path:[1,6],entri:3,well:4,exampl:4,thi:[0,1,3,4,5,6],english:3,model:[2,1,6],self:3,piec:6,propos:6,explan:[],identifi:[6,3],just:[0,1,4],mypassword:[],obtain:4,activ:[1,4],insid:[6,3],human:6,touch:[1,4],flavor:6,yet:1,languag:[2,4],web:[2,1,6],easi:1,"53k":4,shortcut:3,apache2:4,identif:3,add:[1,3,6],other:6,appli:[1,3,6],apart:[],explanatori:3,match:[],bin:[1,4],applic:[0,6,3,4],format:[],read:3,database_engin:[],database_nam:[],password:[6,3],mod:4,linux:[1,4],insert:[],like:[1,3,6,4],specif:4,mychimere_project:4,unidecod:4,property_i_j:[],zoom:[],staticfil:1,server:[1,4],edit:[0,1,3,4],necessari:[1,6,4],"_static":[],django_settings_modul:[],resiz:3,page:[2,6,3],two:6,www:[1,4],right:[6,3],chimere_display_area:[],manual:6,creation:4,some:[1,3,4],begin:[1,4],revel:3,sampl:[1,4],language_cod:4,home:[],librari:4,distribut:4,lead:3,bottom:[],makemessag:4,definit:[],per:6,libapache2:4,evolv:[],leav:[],proj:4,slash:3,localhost:[],refer:4,core:[],previou:1,run:1,bold:3,chimere_default_cent:[],usag:6,step:[1,3,6],squeez:[1,4],prerequisit:[2,4],wget:4,trustworthi:6,sub:3,postgresql:4,chimere_restricted_ext:[],column:3,eventuali:[],manag:[0,1,6,4,2],srv:[1,6],stand:4,backup:1,ratatouil:[],own:[0,6],addus:4,setenv:[],additionn:[],pythonpath:[],encod:4,bound:6,automat:6,appropri:[6,4],been:[0,1,3,4,5,6],contrib:[1,4],openlay:[],your:[0,1,3,6,4],libgeo:4,accordingli:4,git:[1,4],fill:[],lwpostgi:[],wai:4,pictur:6,lok:[0,1,3,4,5,6],secret:4,submit:[3,4],custom:[0,6,4,2],avail:[1,3,6,4],interfac:[6,3],"var":[1,4],submiss:3,particulari:[],properli:[],administration_:[],simplejson:[1,4],forc:[2,1],ascend:3,back:3,pwd:1,collectstat:[1,4],link:3,translat:[2,1,4],pyexiv2:[1,4],line:1,congratul:4,pull:1,made:[1,3],possibl:3,"default":[1,6,4],checkout:[1,4],chimere_default_categori:[],pythondebug:[],rc2:[],rc3:1,below:4,limit:6,otherwis:[6,3],problem:1,urn:6,crosstrack:1,gone:[],creat:[2,1,3,6,4],createus:4,parser:4,exist:4,rule:[1,4],file:[0,1,6,4],syncdb:[1,4],chimere_default_zoom:[],check:[6,3,4],probabl:1,echo:4,encrypt:4,automaticali:[],todo:4,when:6,detail:[6,3],gettext:4,field:[1,3,6,4],old:1,valid:3,kombu:1,branch:[1,4],chimere_admin_01:[],test:1,you:[0,1,3,6,4],draw:3,repeat:1,peacefrog:[1,4],symbol:[],drag:3,log:[1,3,6,4],consid:1,sql:4,debian:[1,4],longer:[],migrate_properti:1,directori:[1,4],root_path:[],descript:[1,6,4],dgango:[],chown:[1,4],time:4},objtypes:{},titles:["Chim\u00e8re customisation","Upgrade","Welcome to Chim\u00e8re’s documentation!","Administration","Installation","Chim\u00e8re import/export","Configuration"],objnames:{},filenames:["customisation","upgrade","index","administration","install","import_export","configuration"]}) \ No newline at end of file +Search.setIndex({objects:{},terms:{all:[1,3,6],code:[0,1,3,4],forget:[1,3],yellow:3,signific:[1,4],osm:[0,6,3],follow:[1,6,4],feedpars:[1,4],row:3,content:[6,3],hold:6,depend:[2,1,4],zone:4,readabl:[6,4],base_url:[],send:4,easiest:0,init:4,program:[],titl:3,text:6,sens:3,town:[],sourc:[2,1,3,4],string:[1,4],createsuperus:6,relev:[3,4],administr:[0,2,3,4,5,6],button:[6,3],list:[3,4],geograph:[6,3,4],item:[2,6,3],form:[6,3],quick:[],initialis:[2,1,6,4],dir:4,pleas:4,base_us:[],direct:1,sign:4,second:3,design:[0,2],download:4,further:1,myusernam:4,click:[6,3],blue:3,index:[],appear:3,compar:[],section:[6,3],multimedia:[6,3],abl:6,beautifulsoup:4,access:[6,3],delet:[6,3],version:[0,1,2,3,4,5,6],"new":[0,1,2,3,4,6],net:[1,4],chimer:[0,1,3,6,4],chose:[],createdb:4,french:4,"005k":1,witch:6,address:[],path:[6,3,4],modifi:[0,6,3,4],sinc:4,interpret:[],box:[6,3],search:3,larger:0,host:[],prior:[],permit:[6,3],action:3,template_context_processor:[],chang:[0,1,3,6,4],apart:[],chanc:6,environn:1,chimere_tag:1,repositori:[1,4],extra:[0,3],father:[],modul:[],apt:[1,4],vim:[1,4],put:3,authentifi:3,subcategori:[2,6,3],fake:1,marker:1,instal:[0,1,6,4,2],select:[6,3],from:[1,3,4],would:[1,4],univers:4,upgrad:[2,1],next:1,websit:[6,4],few:[6,3],handler:[],usr:[1,4],criteria:3,type:[0,6,3,4],more:[0,6,3,4],sort:[6,3],where_is_your_chimer:3,desir:4,mypassword:[],share:4,relat:4,server_url:1,customis:[0,1,2],phone:6,"export":[2,3,5],indic:[],particular:4,recommand:4,unpack:4,cach:[2,1,6],must:[0,1,6,4],psql:4,"static":[1,4],account:[6,3,4],word:3,hour:6,prepar:1,work:[1,3,6],uniqu:[6,4],soup:4,paragraph:[1,6],can:[0,1,3,6,4],lc_messag:4,default_categori:[],root:4,control:6,prompt:4,tar:4,give:6,process:[1,3],sudo:[],smtp:4,templat:[0,1,4,2],tarbal:1,tag:[3,4],want:[0,6,3,4],default_cent:[],spe:[],mapnik:[0,6],lxml:[1,4],end:[0,6,3,2],freshli:3,anoth:4,length:[1,4],write:[],pure:0,reject:3,verifi:1,simpl:[6,3],css:[0,6],email_host:4,map:[0,6,3],product:1,rebas:1,pypi:4,clone:[1,4],after:[1,3],superus:6,upload:[1,4],manuali:[],befor:[1,3],plane:1,beauti:4,date:[0,1,3,4,5,6],multipl:3,data:[1,3,4],"short":4,practic:6,third:3,bind:1,bing:0,postgi:4,lost:1,stash:1,django:[0,1,6,4],issu:[],inform:[6,3],environ:[1,6],jquery_js_url:4,allow:6,order:[6,3],oper:3,checkbox:3,move:[1,4],becaus:[1,4],meter:1,through:[],addus:4,tinymce_url:4,still:4,mainli:[0,3],dynam:6,paramet:4,style:0,group:6,cli:[1,6],fit:[0,4],psycopg2:4,clickabl:[],better:4,window:[],requir:[1,6],where_is_chimer:4,media_root:[],hidden:[6,3],main:3,extra_url:[],changepassword:6,them:[1,3,4],recal:[],thei:[6,3],python:[1,4],dai:6,initi:[1,6,4],framework:[2,6],facilit:3,nov:4,now:[1,3,4],choic:[],name:[0,1,3,6,4],jquery_css_url:4,pyshar:[],gpsbabel:[1,4],off:[],drop:3,refresh:1,easili:3,xvjf:4,html2text:4,each:[0,6,3],found:4,unicod:4,updat:[0,1,2,3,4,5,6],mean:[6,3],compil:[2,4],domain:6,replac:[3,4],jquery_url:1,hard:[],procedur:4,realli:[],backport:[1,4],forgot:[6,3],extract:4,special:[1,3,4],out:3,variabl:[1,6,4],won:1,tinymc:4,newli:3,publish:1,categori:[2,6,3],adapt:[1,4],modpython:[],ref:[],correct:[1,4],red:3,common:[1,4],postgr:4,uncommit:1,migrat:[2,1,4],precaut:1,given:[1,4],free:4,reason:6,base:[6,4],ask:6,org:[1,4],"9227c9":3,mychimer:[1,6],unpredict:4,gdal:[1,4],care:[3,4],spatial_ref_si:4,could:1,area:[0,6,2],static_url:1,keep:3,filter:3,perhap:1,isn:3,outsid:6,root_urlconf:[1,4],auth:6,south:[1,4],first:[1,3,6,4],feed:[6,4],teh:3,major:1,suffix:[],render:6,feel:4,onc:[6,3],number:[1,3,6,4],yourself:3,restrict:6,mai:6,instruct:1,alreadi:4,done:[0,1,6,4],least:[1,6,4],mydjango:4,owner:4,stabl:[1,4],installed_app:1,optionali:4,size:3,differ:[0,6],"long":6,district:[],script:1,associ:[6,3],top:[],mkdir:[1,4],system:3,messag:6,attach:3,chimere_dynamic_categori:[],cliquabl:3,master:1,conveni:3,option:1,copi:[0,1,4],install_path:4,part:4,consult:3,detail_cont:[],haven:1,png:[],rss:6,serv:[1,6],kind:0,provid:[3,4],remov:[1,3],project:[2,1,6,4],pythoninterpret:[],ressourc:6,database_password:[],other:6,browser:[2,1],favorit:4,ani:[1,4],myproject:0,packag:[1,4],manner:[],have:[1,3,6,4],tabl:[3,4],need:[0,6,3,4],element:3,pg_version:4,plpgsql:4,local_set:[1,6,4],engin:[],bz2:4,min:1,rout:[6,3],port:[],note:3,also:[1,3],etienn:[],take:4,which:[],librari:4,default_data:4,simplifi:1,map_lay:[],sethandl:[],usernam:6,choos:4,most:[6,3,4],larg:4,letter:[1,4],deploi:[],geodjango:4,icon:[1,3,6],time_zon:4,don:[1,3,6,4],url:[1,3,6,4],doc:[],clear:3,later:[1,6],flow:[],your_chimere_path:1,inde:3,database_port:[],pythonhandl:[],left:[],fact:3,visibl:3,wsgi:[1,4],show:6,german:[],visitor:[2,1],database_us:[],directli:[6,3],session:6,loaddata:4,secret_kei:4,permiss:[6,4],cryptograph:4,staff:6,celeri:[1,4],current:[1,3,6],onli:[0,1,3,6,4],locat:1,execut:1,copyright:[0,1,3,4,5,6],explain:3,configur:[2,1,6,4],apach:[1,4],should:[1,4],theme:6,simpliest:4,local:[1,6,4],media_url:[],contribut:[1,4],get:[2,1,4],familiar:6,your_local_nam:1,stop:1,blank:3,wheezi:[1,4],a2ensit:4,report:1,geo:4,restart:1,layout:[0,2],enabl:1,specif:4,chimere_localnam:[1,6],reload:[6,4],integr:1,contain:3,where:6,explainatori:[],view:6,set:[1,3,6,4],project_nam:4,"chim\u00e8r":[0,1,2,3,4,5,6],knowledg:1,displai:[6,3],see:[6,3],mandatori:[6,3],epsg_display_project:[],concern:3,jqueri:[1,4],statu:[6,3],avaibl:[],correctli:3,databas:[2,1,6,4],someth:4,cours:4,label:[6,3],state:[6,3],epsg_project:[],between:1,"import":[2,1,3,4,5,6],experi:1,email:4,accord:4,javascript:[1,4],appreci:4,kei:[0,6,4],postgresql_psycopg2:[],job:[],here:4,purpl:3,addit:4,cyclemap:[0,6],both:3,last:4,expos:3,admin:[1,3,4],gpsbabel_opt:1,etc:[6,4],instanc:[0,1,3,4],forgotten:6,freeli:3,login:3,com:6,load:[],simpli:6,technic:6,point:[1,6],color:[6,3],arriv:6,chmod:4,header:3,colon:0,littl:6,poi:3,mapquest:[0,6],mod_python:[],backend:[],quit:3,folow:1,come:3,due:6,empti:[],example_project:[0,1,4],json:4,valu:[1,3,4],administration_:[],modif:[6,3],popul:4,createlang:4,regroup:4,imag:4,understand:3,present:[0,2,3,4,5,6],"case":6,chimere_path:[1,6],look:[6,3],amend:[2,3],vanilla:[],properti:[2,1,3,6],harder:[],easier:6,trick:1,defin:[0,6],error:1,value_of_your_localnam:1,envvar:4,fixtur:4,compilemessag:[1,4],openstreetmap:[],real:3,layer:[0,6,2],customiz:6,libj:[1,4],"\u00e9tienn":[0,1,3,4,5,6],site:[2,6,3,4],destin:4,archiv:4,uncom:4,conf:4,sever:1,develop:3,welcom:[2,6],open:6,author:[0,1,3,4,5,6],media:[1,4],make:[1,3,6],exchang:[],same:[6,3,4],member:6,html:[0,3],descend:3,compat:0,document:[0,2,3,4,5,6],mod_wsgi:4,pan:6,complet:[6,4],http:[1,3,4],webserv:[2,1,4],logic:0,effect:3,solut:4,moment:[],user:[2,1,3,6,4],mani:[1,3,6],extern:[6,3],rvb:3,posgi:4,recent:3,pwprompt:4,task:6,moder:[2,6,3],center:[],chimere_app_path:[1,6],entri:3,well:[0,4],exampl:[6,4],thi:[0,1,3,4,5,6],english:3,model:[2,1,6],self:3,piec:6,propos:[6,3],explan:[],identifi:[6,3],just:[1,4],chimere_hide_propertymodel:6,obtain:4,activ:[1,6,4],insid:[6,3],human:6,touch:[1,4],flavor:6,yet:1,languag:[0,4,2],web:[0,1,6,2],easi:1,field:[1,3,6,4],particulari:[],"53k":4,shortcut:3,apache2:4,identif:3,add:[0,1,3,6],setenv:[],appli:[1,3,6],save:3,explanatori:3,match:[],bin:[1,4],applic:[6,3,4],format:3,read:3,database_engin:[],database_nam:[],password:[6,3],mod:4,linux:[1,4],insert:[],like:[1,3,6,4],semi:0,mychimere_project:4,unidecod:4,property_i_j:[],zoom:6,staticfil:1,server:[1,6,4],edit:[2,1,3,4],api:0,necessari:[1,6,4],"_static":[],django_settings_modul:[],resiz:3,page:[0,6,3,2],two:6,encount:4,www:[1,4],right:[6,3],chimere_display_area:[],manual:6,creation:4,some:[0,1,3,4],begin:[1,4],revel:[],sampl:[1,4],language_cod:4,home:[],transport:[0,6],distribut:4,lead:3,confirm:3,makemessag:4,definit:[],per:6,whole:[],libapache2:4,evolv:[],leav:[],proj:4,slash:3,three:3,localhost:[],refer:[0,3,4],core:[],plu:3,previou:1,run:1,bold:3,chimere_default_cent:[],usag:6,step:[1,3,6],squeez:[1,4],prerequisit:[2,4],wget:4,trustworthi:6,sub:3,postgresql:4,chimere_restricted_ext:[],column:3,eventuali:[],manag:[0,1,2,3,4,6],srv:[1,6],stand:4,discard:3,backup:1,disabl:[6,3],ratatouil:[],own:6,effici:3,additionn:[],pythonpath:[],submitt:3,encod:4,bound:6,automat:6,appropri:[0,6,4],been:[0,1,3,4,5,6],contrib:[1,4],openlay:0,your:[0,1,3,6,4],libgeo:4,accordingli:4,git:[1,4],fill:[],lwpostgi:[],wai:[0,4],pictur:6,lok:[0,1,3,4,5,6],secret:4,submit:[3,4],custom:[0,6,4,2],avail:[0,1,3,6,4],interfac:6,"var":[1,4],submiss:[],treat:3,"function":6,properli:6,interest:[6,3],simplejson:[1,4],forc:[2,1],ascend:3,basic:[1,3,6],back:3,pwd:1,collectstat:[1,4],link:[0,3],translat:[2,1,4],pyexiv2:[1,4],line:[1,4],"true":6,congratul:4,pull:1,made:[0,1,3],utf:4,possibl:[6,3],createus:4,checkout:[1,4],chimere_default_categori:[],pythondebug:[],rc2:[],rc3:1,below:4,limit:6,otherwis:[6,3],problem:[1,4],urn:6,crosstrack:1,gone:[],aerial:0,creat:[2,1,3,6,4],classic:3,parser:4,"char":4,exist:4,rule:[1,4],file:[0,1,3,6,4],syncdb:[1,4],chimere_default_zoom:[],check:[6,3,4],probabl:[1,6],echo:4,encrypt:4,automaticali:[],todo:4,when:[6,3],detail:[0,6,3],gettext:4,"default":[0,1,6,4],old:1,valid:3,kombu:1,branch:[1,4],chimere_admin_01:[],test:1,you:[0,1,3,6,4],draw:[6,3],repeat:1,peacefrog:[1,4],symbol:[],bottom:3,drag:[6,3],database_host:[],log:[1,3,6,4],consid:1,sql:4,debian:[1,4],longer:[],migrate_properti:1,directori:[0,1,4],root_path:[],descript:[1,6,4],dgango:[],chown:[1,4],time:[6,4]},objtypes:{},titles:["Chim\u00e8re customisation","Upgrade","Welcome to Chim\u00e8re’s documentation!","Administration","Installation","Chim\u00e8re import/export","Configuration"],objnames:{},filenames:["customisation","upgrade","index","administration","install","import_export","configuration"]}) \ No newline at end of file diff --git a/docs/_build/html/upgrade.html b/docs/_build/html/upgrade.html index 2304c83..37ac898 100644 --- a/docs/_build/html/upgrade.html +++ b/docs/_build/html/upgrade.html @@ -92,7 +92,7 @@ If you are considering to contribute on Chimère get the Git master.

    Then install the new dependencies:

    apt-get install -t squeeze-backports python-django python-django-south \
                        python-simplejson libjs-jquery-ui python-pyexiv2 \
    -                   python-feedparser javascript-common
    + python-feedparser javascript-common libjs-jquery
    diff --git a/docs/_static/chimere_admin_modified_management.png b/docs/_static/chimere_admin_modified_management.png new file mode 100644 index 0000000..84e069e Binary files /dev/null and b/docs/_static/chimere_admin_modified_management.png differ diff --git a/docs/administration.rst b/docs/administration.rst index 75d8761..2f8ddb5 100644 --- a/docs/administration.rst +++ b/docs/administration.rst @@ -60,7 +60,7 @@ Item list #. search items by word (not available for all type of items) #. this filter box permit to filter current entries with some criteria (not available for all type of items) -#. the header of the table is clickable. Click on an header sort the items by +#. the header of the table is cliquable. Click on an header sort the items by this header (ascending or descending). Multiple header sort is possible (the number on the right of the header explain the order of sorting). #. each item can be checked (for applying an action) or selected (by clicking on @@ -81,36 +81,120 @@ Item form #. the form has to be validated by one of theses actions buttons. They are self-explanatory. +Status +****** + +*Status* is a property attached to each geographic item in Chimère. To +administrate efficiently Chimère you need to understand the mean of each status. + +- **Submited**: Status of a new item freshly proposed by an end user. This item + is not visible on the map. +- **Available**: Status of an item visible on the map. +- **Disabled**: Status of a discarded item. +- **Modified**: Status of an amendment proposed by an end-user. +- **Imported**: Status of a newly imported item. Import and export operations + need that all items with *imported* status are treated (validated, disabled + or deleted). + + Managing news ------------- A news system is available. -All you have to to do is to click on the Add button near News. -For each news you have to provided a name and a content. The content can contain HTML tags. -The avaibility is set with a checkbox. +All you have to to do is to click on the **Add** button near News. +For each news you have to provided a name and a content. The content can contain +HTML tags. +The availability is set with a checkbox. Creating categories/subcategories --------------------------------- -Before adding categories you have to set some icons. Theses icons appears on the map and in the categories' box on the main map. -Be careful to resize correctly your icons. Indeed the icon will be presented at their real size on the map. -To add icons: the Add button near Icons. +Before adding categories you have to set some icons. Theses icons appears on the +map and in the categories' box on the main map. +Be careful to resize correctly your icons. Indeed the icon will be presented at +their real size on the map. +To add icons: the **Add** button near Icons. + +Categories are in fact only containers for subcategories. You'll have to provide +only a name and an order. +To add categories: the **Add** button near categories (quite clear now, isn't +it?) + +Fields of subcategories are: an associated category, a name, an icon, an order, +a color and an element type. +Theses fields are mainly quite self- explanatory. +The color is used to draw routes (if this subcategory contains routes). If it a +basic color it can be set with the English name (for instance: *red*, *blue*, +*yellow* or *purple*) otherwise you can put the HTML RVB code (for instance +*#9227c9*). +The element type is the type of element the subcategory can contain: POI, route +or both. + +Edition/moderation of items +--------------------------- + +The moderation step is quite simple. It works the same with POIs and routes. +The moderator can access to all POIs (or routes) by clicking on them on the +list. -Categories are in fact only containers for subcategories. You'll have to provide only a name and an order. -To add categories: the Add button near categories (quite clear now, isn't it?) +A search field is available to search by name but the more interesting is to +filter POIs (or route) by state and by subcategory. -Fields of subcategories are: an associated category, a name, an icon, an order, a color and an element type. -Theses fields are mainly quite self-explainatory. -The color is used to draw routes (if this subcategory contains routes). If it a basic color it can be set with the english name (for instance: "red", "blue", "yellow" or "purple") otherwise you can put the HTML RVB code (for instance "#9227c9"). -The element type is the type of element the subcategory can contain: POI, route or both. +There is a some actions available in the action list. -Moderation ----------- +- **Delete** to delete selected items. A confirmation step is displayed. +- **Validate** to set the status *Available* to selected items. +- **Disable** to set teh status *Disabled* to selected items. This is useful to + keep items you don't want to be exposed on the map. +- **Managed modified items** to manage the amendment made by end users on the + main site cf. to :ref:`managing-modified`. Modified item has to be treated + one by one. +- **Export to...** to export selected item to the selected format. -The moderation step is quite simple. It works the same with POIs and routes. -The moderator can access to all POIs (or routes) by clicking on the Modify button. -A search field is available to search by name but the more interesting is to filter POIs (or route) by state and by subcategory. -Then to modify an item you have to click on his name. -The submission can now freely modified. Compared to the main submission interface there is only on field add: the state field. To be publish in the main site the item must have the state: Available. -If an item is not revelant the Delete button permit to remove it. +To modify an item, classically you have to click on his name. +Then you access to a form to freely modify the item. +In this form there is all data available to the end user form plus some extra +fields. The *Import fields* only make sense with data imported from an external +source or for data to be exported to OSM cf. to the :ref:`import section +` of this documentation. *Associated items fields* are read only +fields that list items associated to the current one (reference item of an +amendment, associated file of a route). + +Associated multimedia items are at the bottom of the form. You can freely add, +change items and change their order with drag and drop. + +Don't forget to validate your change with one of the **Save** buttons at the +bottom of the form (it is easily forgot when you change multimedia items). + +If an item is not relevant the **Delete** button permit to remove it. + +.. _managing-modified: + +Managing end user amendment +--------------------------- + +Amendment can be proposed on the main site by end-users. +In Chimère an amendment is a new item with the status *Modified* and with a link +to the reference item modified. + +.. Note:: + If you are logged as an administrator and make changes on the map with the + end user form there will be directly validated. + +A special form has been developed to facilitate the processing of theses +modified items. + +You can access to this special form with the action *Managed modified items*. + +.. image:: _static/chimere_admin_modified_management.png + +This form is a table with three columns. + +#. The first column display the information for the reference item. +#. The second column display the information proposed by the submitter. +#. The third column is a list of checkboxes. For each row checked, after the + validation, the value of the modified item will replace the value of the + reference item. + +To reject all modification validate the form with no checkbox checked. diff --git a/docs/configuration.rst b/docs/configuration.rst index f8bed2b..0565509 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -33,6 +33,16 @@ To access theses pages you have to identify you with an account with *staff* and A *superuser* account is created at the initialization of the database. +Configuring the sites framework +------------------------------- + +*Sites* framework allow you to serve the same content on different domains. +Most of you will probably use only one domain but this unique domain has to +be configured. This is done in the web administration interface in *Sites > Sites* +You only need to change *example.com* by your domain name. If you forgot to +do that functionality such as RSS feeds will not work properly. + +.. _managing-areas: Managing areas -------------- @@ -40,29 +50,36 @@ Managing areas An *Area* is the base of your map. It defines: * a name: a human readable label for this area. +* an associated URN (*not mandatory*): the name of the area as a web ressource. + In practice, if the area is not the default area the URN is used at the end of + the default URL to access to this area. This is not mandatory but necessary + for each area that is not the default one. * a welcome message (*not mandatory*): this message is displayed once a day per user arriving on the map. -* a map bounding box: this is the default area to display when arriving on the - map. -* restriction on the bounding box: if set to restricted, the end user can't pan - outside the defined bounding box. -* available layers (*not mandatory* OSM Mapnik is used by default): OSM Mapnik - render, OSM MapQuest render, OSM Transport Map render, OSM CycleMap are - available by default. You can add new custom layer cf. :ref:`managing-layers`. -* categories restriction (*not mandatory*): if no restriction is set all - categories are available. +* an order (to sort areas). +* an availability. +* a default state. The /default/ area is viewed by default. Only one area can + be the default: activating this state disable it on the possible other area + with a default state. * default checked categories (*not mandatory*). -* an external CSS file (*not mandatory*): an URL to an external CSS file. * if categories are displayed dynamically (if dynamically is set, the end user only view categories witch have items on the map section the user currently see). -* an associated URN (*not mandatory*): the name of the area as a web ressource. - In practice, if the area is not the default area the URN is used at the end of - the default URL to access to this area. This is not mandatory but necessary - for each area that is not the default one. +* categories restriction (*not mandatory*): if no restriction is set all + categories are available. +* an external CSS file (*not mandatory*): an URL to an external CSS file. +* restriction on the bounding box: if set to restricted, the end user can't pan + outside the defined bounding box. Due to technical reasons, there is at this + time no restriction on the zoom. +* a map bounding box: this is the area to display when arriving on the map. If + the area is restricted it will be the bounding box that restrict the end user. + Hold the control key, click and drag to draw the bounding box. +* available layers (*not mandatory* OSM Mapnik is used by default): OSM Mapnik + render, OSM MapQuest render, OSM Transport Map render, OSM CycleMap are + available by default. You can add new custom layer cf. :ref:`managing-layers`. *Areas* are customizable directly on the web administration interface in -*Chimere/Areas*. +*Chimere > Areas*. As there is little chance that the default area is appropriate for you, you'll have to set at least one default area. @@ -92,8 +109,8 @@ and a default password (the user can change it on in own later). Then complete the other pieces of information. -Check the case: *Staff status* (or this user will not be able to log to -the administration website). +Check the case: *Staff status* (or this user will not be able to log to the +administration website). If this account is a new technical administrator, check *Superuser status* (this user must be trustworthy!). Otherwise you'll have to give permissions to this @@ -151,15 +168,19 @@ model*). The administration page ask you for: * a name, -* an order (to order between other properties), +* an order (to sort properties), * an availability to the end user (this can be used to set hidden properties), * a mandatory status, * the categories the property applied to (if no categories selected it applied to all), * the type: text, long text, password or date. -To make this property available it is necessary to reload your webserver (the +To make this property available it is necessary to reload your web server (the property is cached). All forms are then automatically updated with this new field. +If you don't want to allow add and modification of properties you can disable +this form by setting CHIMERE_HIDE_PROPERTYMODEL to *True* in your +*local_settings.py* file. + diff --git a/docs/customisation.rst b/docs/customisation.rst index e27be01..19002dc 100644 --- a/docs/customisation.rst +++ b/docs/customisation.rst @@ -12,13 +12,41 @@ This documents presents the installation of Chimère. The version has been updated for version 2.0.0. -Updating the design -------------------- - -You can of course customize Chimère with your own CSS. To do that just edit the file static/styles.css. - -After this basic configuration done the harder is done. You can do now application administration tasks. - .. _managing-layers: + Managing layers --------------- + +There is some different layers available by default in Chimère (OSM Mapnik, OSM +Mapquest, OSM Transport map, OSM Cyclemap). You can add some extra layer using +the web administration pages of Chimère. The new layer is defined with the +appropriate `Openlayers `_ JS code. This JS code must +be a compatible Openlayers Layer instance with no ending semi-colon. For +instance defining a Bing layer can be done with this kind of code:: + + new OpenLayers.Layer.Bing({ + name: "Aerial", + key: "my-bing-API-key", + type: "Aerial"}) + + +Refer to the `Openlayers documentation API +`_ +for more details. + + +Customizing the layout and the design +------------------------------------- + +If you only want to customize the CSS, the easiest way to do it is to add a +link to an extra CSS to your *Areas* cf. :ref:`managing-areas`. + +If you want to do larger changes in the layout and the style the (well named) +example_project can be customized to fit your needs. Each template file present +in the *chimere/templates* directory can be copied in your *myproject/templates* +directory and then modified. +You only need to copy files that you want to modify. Theses files are in +Django template language mainly made of pure HTML with some logic. Refer to +the `Django template documentation `_ +for more details. + diff --git a/docs/import_export.rst b/docs/import_export.rst index 890a644..3d4b0ed 100644 --- a/docs/import_export.rst +++ b/docs/import_export.rst @@ -11,4 +11,7 @@ Chimère import/export This documents presents the administration of Chimère. The version has been updated for version 2.0.0. +.. _importing: +Importing +--------- diff --git a/docs/index.rst b/docs/index.rst index 45f40e0..ee1dd6f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -12,6 +12,6 @@ Welcome to Chimère's documentation! install upgrade configuration - customisation administration import_export + customisation -- cgit v1.2.3 From af8522d68d00ff30bc188513525020f0eda3ae2d Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 7 Dec 2012 02:54:15 +0100 Subject: Admin: improve non overloading imports * improve non overloading import management in OSM * add a warning message to "modified" items form --- chimere/admin.py | 54 +++++++++++++++++----- .../admin/chimere/marker/change_form.html | 13 ++++++ .../templates/admin/chimere/route/change_form.html | 1 + chimere/tests.py | 22 +++++++++ chimere/utils.py | 34 ++++++++------ 5 files changed, 97 insertions(+), 27 deletions(-) create mode 100644 chimere/templates/admin/chimere/marker/change_form.html create mode 120000 chimere/templates/admin/chimere/route/change_form.html (limited to 'chimere/admin.py') diff --git a/chimere/admin.py b/chimere/admin.py index 2d5f8bf..0f17d30 100644 --- a/chimere/admin.py +++ b/chimere/admin.py @@ -95,39 +95,44 @@ def export_to_csv(modeladmin, request, queryset): export_to_csv.short_description = _(u"Export to CSV") def managed_modified(modeladmin, request, queryset): + # not very clean... There is must be a better way to do that + redirect_url = request.get_full_path().split('admin_modification')[0] if queryset.count() != 1: messages.error(request, _(u"Only one item can be managed at a " u"time.")) - return HttpResponseRedirect(request.get_full_path()) + return HttpResponseRedirect(redirect_url) item = queryset.all()[0] - if not item.status == 'M': + if not item.ref_item or item.ref_item == item: try: - item = modeladmin.model.objects.get(ref_item=item, status='M') + item = modeladmin.model.objects.get(ref_item=item) except ObjectDoesNotExist: messages.error(request, _(u"No modified item associated " u"to the selected item.")) - return HttpResponseRedirect(request.get_full_path()) + return HttpResponseRedirect(redirect_url) item_ref = item.ref_item if request.POST.get('rapprochement'): couple = [(item, item_ref)] if hasattr(item, 'associated_marker'): couple.append((item.associated_marker.all()[0], item_ref.associated_marker.all()[0])) - updated_keys = dict(request.POST) + updated = dict(request.POST) # clean for k in ('action', 'rapprochement', 'index', '_selected_action'): - if k in updated_keys: - updated_keys.pop(k) + if k in updated: + updated.pop(k) for idx, cpl in enumerate(couple): it, it_ref = cpl # don't copy geometry of associated items if idx: for k in ('route', 'point'): - if k in updated_keys: - updated_keys.pop(k) + if k in updated: + updated.pop(k) + updated_keys = updated.keys() + if it.status == 'I': + updated_keys.append('import_version') for k in updated_keys: - if not request.POST[k]: + if k != 'import_version' and not request.POST[k]: continue if hasattr(it_ref, k): c_value = getattr(it_ref, k) @@ -149,7 +154,7 @@ def managed_modified(modeladmin, request, queryset): it.delete() item.delete() messages.success(request, _(u"Modified item traited.")) - return HttpResponseRedirect(request.get_full_path()) + return HttpResponseRedirect(redirect_url) return render_to_response('admin/chimere/managed_modified.html', {'item':item, 'item_ref':item_ref}, context_instance=RequestContext(request)) @@ -229,7 +234,24 @@ class MarkerAdmin(admin.ModelAdmin): qs = qs.order_by(*ordering) return qs.distinct() -class RouteAdmin(admin.ModelAdmin): + def admin_modification(self, request, item_id): + ''' + Redirect to the marker modification form + ''' + return managed_modified(self, request, + Marker.objects.filter(pk=item_id)) + def get_urls(self): + from django.conf.urls.defaults import * + urls = super(MarkerAdmin, self).get_urls() + my_urls = patterns('', + url(r'^admin_modification/(?P\d+)/$', + self.admin_site.admin_view(self.admin_modification), + name='admin-modification'), + ) + return my_urls + urls + + +class RouteAdmin(MarkerAdmin): """ Specialized the Route field. """ @@ -261,6 +283,7 @@ class RouteAdmin(admin.ModelAdmin): 'has_associated_marker') }), ) + inlines = [] def queryset(self, request): qs = self.model._default_manager.get_query_set() @@ -275,6 +298,13 @@ class RouteAdmin(admin.ModelAdmin): qs = qs.order_by(*ordering) return qs + def admin_modification(self, request, item_id): + ''' + Redirect to the route modification form + ''' + return managed_modified(self, request, + Route.objects.filter(pk=item_id)) + class LayerInline(admin.TabularInline): model = AreaLayers extra = 1 diff --git a/chimere/templates/admin/chimere/marker/change_form.html b/chimere/templates/admin/chimere/marker/change_form.html new file mode 100644 index 0000000..64c48f9 --- /dev/null +++ b/chimere/templates/admin/chimere/marker/change_form.html @@ -0,0 +1,13 @@ +{% extends "admin/change_form.html" %} +{% load i18n %} +{% block field_sets %} +{% if original.ref_item and original.ref_item != orginal %} +

    +{% url admin:admin-modification object_id as rapprochement_form %} +{% blocktrans %} +This item has a reference item associated to it. You should treat it via the rapprochement form. +{% endblocktrans %} +

    +{% endif %} +{{ block.super }} +{% endblock %} diff --git a/chimere/templates/admin/chimere/route/change_form.html b/chimere/templates/admin/chimere/route/change_form.html new file mode 120000 index 0000000..21811b6 --- /dev/null +++ b/chimere/templates/admin/chimere/route/change_form.html @@ -0,0 +1 @@ +../marker/change_form.html \ No newline at end of file diff --git a/chimere/tests.py b/chimere/tests.py index 1622923..20c0f29 100644 --- a/chimere/tests.py +++ b/chimere/tests.py @@ -389,6 +389,28 @@ class RapprochementTest(TestCase): for k in new_vals: self.assertEqual(getattr(ref_marker, k), new_vals[k]) + def test_managed_modified_imported_markers(self): + ref_marker = self.markers[0] + new_vals = {'name':"Marker 1 - modified", + 'point':GEOSGeometry('SRID=4326;POINT(-4 48)')} + values = {'status':'I', 'ref_item':ref_marker, 'import_version':42} + values.update(new_vals) + modified_marker = Marker.objects.create(**values) + self.assertNotEqual(ref_marker.import_version, + modified_marker.import_version) + modified_marker.categories.add(ref_marker.categories.all()[0]) + response = self.client.post('/admin/chimere/marker/', + data={'action':['managed_modified'], + 'index':0, 'rapprochement':1, + 'name':1, 'point':1, + '_selected_action':[unicode(ref_marker.pk)] + }) + ref_marker = Marker.objects.get(pk=ref_marker.pk) + self.assertEqual(Marker.objects.filter(ref_item=ref_marker, + status='I').count(), 0) + for k in new_vals.keys() + ['import_version']: + self.assertEqual(getattr(ref_marker, k), values[k]) + def test_managed_modified_routes(self): ref_route = self.routes[0] new_vals = {'name':"Route 1 - modified", diff --git a/chimere/utils.py b/chimere/utils.py index bb24037..73eecd0 100644 --- a/chimere/utils.py +++ b/chimere/utils.py @@ -71,7 +71,7 @@ class ImportManager: pass def create_or_update_item(self, cls, values, import_key, version=None, - key='', pk=None): + key='', pk=None, overload=True): updated, created, item = False, False, None import_key = unicode(import_key).replace(':', '^') if not key: @@ -82,20 +82,24 @@ class ImportManager: 'import_source':self.importer_instance.source} try: if pk: - item = cls.objects.get(pk=pk) + ref_item = cls.objects.get(pk=pk) else: - item = cls.objects.get(**dct_import) - if version and item.import_version == int(version): + ref_item = cls.objects.get(**dct_import) + if version and ref_item.import_version == int(version): # no update since the last import - return item, None, None - for k in values: - setattr(item, k, values[k]) - try: - item.save() - except TypeError: - # error on data source - return None, False, False - updated = True + return ref_item, None, None + if not overload and item.modified_since_import: + dct_import['ref_item'] = ref_item + else: + item = ref_item + for k in values: + setattr(item, k, values[k]) + try: + item.save() + except TypeError: + # error on data source + return None, False, False + updated = True except ObjectDoesNotExist: pass if not item: @@ -680,7 +684,7 @@ class OSMManager(ImportManager): or u'ODbL', 'import_version':version} item, updated, created = self.create_or_update_item( - Route, dct, node_id, version) + Route, dct, node_id, version, overload=False) if updated: updated_item += 1 if created: @@ -713,7 +717,7 @@ class OSMManager(ImportManager): or u'ODbL', 'import_version':version} item, updated, created = self.create_or_update_item( - Marker, dct, node_id, version) + Marker, dct, node_id, version, overload=False) if updated: updated_item += 1 if created: -- cgit v1.2.3