Compare commits
2 Commits
f73dc7c3cf
...
c79dbc7cfa
Author | SHA1 | Date |
---|---|---|
Ales (Shagi) Zabala Alava | c79dbc7cfa | |
Ales (Shagi) Zabala Alava | 93a3b944d3 |
|
@ -1,6 +1,11 @@
|
||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
0.7.3
|
||||||
|
-----
|
||||||
|
|
||||||
|
* 'show_deleted_objects' boolean attribute in GASDeleteView
|
||||||
|
|
||||||
0.7.2
|
0.7.2
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,16 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<p>{{ confirmation_text }}</p>
|
<p>{{ confirmation_text }}</p>
|
||||||
|
|
||||||
<h2>{% trans "Summary" %}</h2>
|
{% if show_deleted_objects %}
|
||||||
<ul>
|
<h2>{% trans "Summary" %}</h2>
|
||||||
{% for model_name, object_count in deleted_model_count.items %}
|
<ul>
|
||||||
<li>{{ model_name|capfirst }}: {{ object_count }}</li>
|
{% for model_name, object_count in deleted_model_count.items %}
|
||||||
{% endfor %}
|
<li>{{ model_name|capfirst }}: {{ object_count }}</li>
|
||||||
</ul>
|
{% endfor %}
|
||||||
<h2>{% trans "Objects" %}</h2>
|
</ul>
|
||||||
<ul>{{ deleted_objects|unordered_list }}</ul>
|
<h2>{% trans "Objects" %}</h2>
|
||||||
|
<ul>{{ deleted_objects|unordered_list }}</ul>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<form method="post" action=".">{% csrf_token %}
|
<form method="post" action=".">{% csrf_token %}
|
||||||
<button type="submit">{% trans 'Delete' %}</button>
|
<button type="submit">{% trans 'Delete' %}</button>
|
||||||
|
|
|
@ -217,6 +217,7 @@ class GASDeleteView(GASMixin, DeleteView):
|
||||||
template_name = "gas/delete_confirmation.html"
|
template_name = "gas/delete_confirmation.html"
|
||||||
confirmation_text = _("Are you sure you want to delete {object}?")
|
confirmation_text = _("Are you sure you want to delete {object}?")
|
||||||
deleted_text = _("{object} deleted.")
|
deleted_text = _("{object} deleted.")
|
||||||
|
show_deleted_objects = True
|
||||||
|
|
||||||
def get_confirmation_text(self):
|
def get_confirmation_text(self):
|
||||||
return self.confirmation_text.format(object=self.object)
|
return self.confirmation_text.format(object=self.object)
|
||||||
|
@ -239,11 +240,15 @@ class GASDeleteView(GASMixin, DeleteView):
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
ctx = super().get_context_data(**kwargs)
|
ctx = super().get_context_data(**kwargs)
|
||||||
|
|
||||||
deleted_objects, deleted_model_count = self.get_deleted_objects()
|
if self.show_deleted_objects:
|
||||||
|
deleted_objects, deleted_model_count = self.get_deleted_objects()
|
||||||
|
else:
|
||||||
|
deleted_objects = deleted_model_count = None
|
||||||
|
|
||||||
ctx.update({
|
ctx.update({
|
||||||
'confirmation_text': self.get_confirmation_text(),
|
'confirmation_text': self.get_confirmation_text(),
|
||||||
'cancel_url': self.get_success_url(),
|
'cancel_url': self.get_success_url(),
|
||||||
|
'show_deleted_objects': self.show_deleted_objects,
|
||||||
'deleted_objects': deleted_objects,
|
'deleted_objects': deleted_objects,
|
||||||
'deleted_model_count': deleted_model_count,
|
'deleted_model_count': deleted_model_count,
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[metadata]
|
[metadata]
|
||||||
name = django-gas
|
name = django-gas
|
||||||
version = 0.7.2
|
version = 0.7.3
|
||||||
description = An alternative to django admin
|
description = An alternative to django admin
|
||||||
long_description = file: readme.md, changelog.md, collaborators.md
|
long_description = file: readme.md, changelog.md, collaborators.md
|
||||||
long_description_content_type = text/markdown
|
long_description_content_type = text/markdown
|
||||||
|
|
Loading…
Reference in New Issue