diff options
-rw-r--r-- | chimere/admin.py | 8 | ||||
-rw-r--r-- | chimere/templates/chimere/detail.html | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/chimere/admin.py b/chimere/admin.py index 889f4c2..b0d0a15 100644 --- a/chimere/admin.py +++ b/chimere/admin.py @@ -46,6 +46,12 @@ def get_areas_for_user(user): areas.add(area) return areas +def validate(modeladmin, request, queryset): + for item in queryset: + item.status = 'A' + item.save() +validate.short_description = _(u"Validate") + class MarkerAdmin(admin.ModelAdmin): """ Specialized the Point field. @@ -54,6 +60,7 @@ class MarkerAdmin(admin.ModelAdmin): list_display = ('name', 'status') list_filter = ('status', 'categories') exclude = [] + actions = [validate] if 'chimere_rss' in settings.INSTALLED_APPS: exclude.append('available_date') form = MarkerAdminForm @@ -80,6 +87,7 @@ class RouteAdmin(admin.ModelAdmin): exclude = ['height', 'width'] form = RouteAdminForm readonly_fields = ('associated_file',) + actions = [validate] def queryset(self, request): qs = self.model._default_manager.get_query_set() diff --git a/chimere/templates/chimere/detail.html b/chimere/templates/chimere/detail.html index 86ab6de..06d9385 100644 --- a/chimere/templates/chimere/detail.html +++ b/chimere/templates/chimere/detail.html @@ -7,6 +7,9 @@ <p id='detail_start_date'><label>{% trans "Date:" %}</label> <span>{{marker.start_date|date:"D d M Y"}} {% if marker.end_date %} - {{marker.end_date|date:"D d M Y"}}</p>{% endif %}</span> {% endif %} + {% if marker.description %} + <p class='description'>{{ marker.description|sanitize:"p b i br hr strong em span:style a:href:target ul li ol h1 h2 h3 h4"|safe}}</p> + {% endif %} {% for property in marker.getProperties %} <p id='{{property.propertymodel.getNamedId}}'>{{ property.value|sanitize:"p b i br hr strong em span:style a:href:target ul li ol h1 h2 h3 h4"|safe}}</p> {% endfor %} |