From 48454beba7998cfd90d7d2b6aa085d1160032db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Zapke-Gru=CC=88ndemann?= Date: Thu, 5 Jan 2012 22:40:29 +0100 Subject: Disabled deletion of imported events. --- sublab_project/calendarium/admin.py | 2 + .../templates/calendarium/delete_confirmation.html | 47 ++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 sublab_project/calendarium/templates/calendarium/delete_confirmation.html (limited to 'sublab_project/calendarium') diff --git a/sublab_project/calendarium/admin.py b/sublab_project/calendarium/admin.py index b59025e..95d648c 100644 --- a/sublab_project/calendarium/admin.py +++ b/sublab_project/calendarium/admin.py @@ -8,6 +8,8 @@ class EventAdmin(admin.ModelAdmin): list_filter = ('source',) search_fields = ['name', 'description'] date_hierachy = 'start' + actions = None + delete_confirmation_template = 'calendarium/delete_confirmation.html' def save_model(self, request, obj, form, change): """Sets the source to "admin". diff --git a/sublab_project/calendarium/templates/calendarium/delete_confirmation.html b/sublab_project/calendarium/templates/calendarium/delete_confirmation.html new file mode 100644 index 0000000..3218665 --- /dev/null +++ b/sublab_project/calendarium/templates/calendarium/delete_confirmation.html @@ -0,0 +1,47 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} + +{% block breadcrumbs %} + +{% endblock %} + +{% block content %} +{% if perms_lacking or protected %} + {% if perms_lacking %} +

{% blocktrans with object as escaped_object %}Deleting the {{ object_name }} '{{ escaped_object }}' would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktrans %}

+ + {% endif %} + {% if protected %} +

{% blocktrans with object as escaped_object %}Deleting the {{ object_name }} '{{ escaped_object }}' would require deleting the following protected related objects:{% endblocktrans %}

+ + {% endif %} +{% else %} + {% if object.source == object.SOURCE_IMPORT %} +

Der Termin "{{ object }}" kann nicht gelöscht werden, da er importiert wurde.

+

Zurück zu den Terminen

+ {% else %} +

{% blocktrans with object as escaped_object %}Are you sure you want to delete the {{ object_name }} "{{ escaped_object }}"? All of the following related items will be deleted:{% endblocktrans %}

+ +
{% csrf_token %} +
+ + +
+
+ {% endif %} +{% endif %} +{% endblock %} -- cgit v1.2.1