Compare commits
No commits in common. "c79dbc7cfac6806f468b7c010b51b9985e850b6e" and "f73dc7c3cf9a12897e7b9e5a0cdadef9a10de961" have entirely different histories.
c79dbc7cfa
...
f73dc7c3cf
|
@ -1,11 +1,6 @@
|
|||
Changelog
|
||||
=========
|
||||
|
||||
0.7.3
|
||||
-----
|
||||
|
||||
* 'show_deleted_objects' boolean attribute in GASDeleteView
|
||||
|
||||
0.7.2
|
||||
-----
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
{% block content %}
|
||||
<p>{{ confirmation_text }}</p>
|
||||
|
||||
{% if show_deleted_objects %}
|
||||
<h2>{% trans "Summary" %}</h2>
|
||||
<ul>
|
||||
{% for model_name, object_count in deleted_model_count.items %}
|
||||
|
@ -16,7 +15,6 @@
|
|||
</ul>
|
||||
<h2>{% trans "Objects" %}</h2>
|
||||
<ul>{{ deleted_objects|unordered_list }}</ul>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" action=".">{% csrf_token %}
|
||||
<button type="submit">{% trans 'Delete' %}</button>
|
||||
|
|
|
@ -217,7 +217,6 @@ class GASDeleteView(GASMixin, DeleteView):
|
|||
template_name = "gas/delete_confirmation.html"
|
||||
confirmation_text = _("Are you sure you want to delete {object}?")
|
||||
deleted_text = _("{object} deleted.")
|
||||
show_deleted_objects = True
|
||||
|
||||
def get_confirmation_text(self):
|
||||
return self.confirmation_text.format(object=self.object)
|
||||
|
@ -240,15 +239,11 @@ class GASDeleteView(GASMixin, DeleteView):
|
|||
def get_context_data(self, **kwargs):
|
||||
ctx = super().get_context_data(**kwargs)
|
||||
|
||||
if self.show_deleted_objects:
|
||||
deleted_objects, deleted_model_count = self.get_deleted_objects()
|
||||
else:
|
||||
deleted_objects = deleted_model_count = None
|
||||
|
||||
ctx.update({
|
||||
'confirmation_text': self.get_confirmation_text(),
|
||||
'cancel_url': self.get_success_url(),
|
||||
'show_deleted_objects': self.show_deleted_objects,
|
||||
'deleted_objects': deleted_objects,
|
||||
'deleted_model_count': deleted_model_count,
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue