only ask to delete children from agenda-items, if there are some
This commit is contained in:
parent
e752ddf3ee
commit
48558504c4
@ -165,19 +165,19 @@ class ItemDelete(DeleteView):
|
|||||||
self.object.delete()
|
self.object.delete()
|
||||||
messages.success(request, _("Item <b>%s</b> was successfully deleted.") % self.object)
|
messages.success(request, _("Item <b>%s</b> was successfully deleted.") % self.object)
|
||||||
|
|
||||||
def gen_confirm_form(self, request, message, url, singleitem=None):
|
def gen_confirm_form(self, request, message, url, singleitem=False):
|
||||||
if singleitem:
|
if singleitem:
|
||||||
messages.warning(request, '%s<form action="%s" method="post"><input type="hidden" value="%s" name="csrfmiddlewaretoken"><input type="submit" value="%s" /> <input type="button" value="%s"></form>' % (message, url, csrf(request)['csrf_token'], _("Yes"), _("No")))
|
messages.warning(request, '%s<form action="%s" method="post"><input type="hidden" value="%s" name="csrfmiddlewaretoken"><input type="submit" value="%s" /> <input type="button" value="%s"></form>' % (message, url, csrf(request)['csrf_token'], _("Yes"), _("No")))
|
||||||
else:
|
else:
|
||||||
messages.warning(request, '%s<form action="%s" method="post"><input type="hidden" value="%s" name="csrfmiddlewaretoken"><input type="submit" value="%s" /> <input type="submit" name="all" value="%s" /> <input type="button" value="%s"></form>' % (message, url, csrf(request)['csrf_token'], _("Yes"), _("Yes, with all child items."), _("No")))
|
messages.warning(request, '%s<form action="%s" method="post"><input type="hidden" value="%s" name="csrfmiddlewaretoken"><input type="submit" value="%s" /> <input type="submit" name="all" value="%s" /> <input type="button" value="%s"></form>' % (message, url, csrf(request)['csrf_token'], _("Yes"), _("Yes, with all child items."), _("No")))
|
||||||
|
|
||||||
def confirm_form(self, request, object, name=None):
|
def confirm_form(self, request, object, item=None):
|
||||||
if name is None:
|
if item is None:
|
||||||
name = object
|
item = object
|
||||||
if object.children:
|
if item.get_children():
|
||||||
self.gen_confirm_form(request, _('Do you really want to delete <b>%s</b>?') % name, object.get_absolute_url('delete'), False)
|
self.gen_confirm_form(request, _('Do you really want to delete <b>%s</b>?') % item, item.get_absolute_url('delete'), False)
|
||||||
else:
|
else:
|
||||||
self.gen_confirm_form(request, _('Do you really want to delete <b>%s</b>?') % name, object.get_absolute_url('delete'), True)
|
self.gen_confirm_form(request, _('Do you really want to delete <b>%s</b>?') % item, item.get_absolute_url('delete'), True)
|
||||||
|
|
||||||
|
|
||||||
class AgendaPDF(PDFView):
|
class AgendaPDF(PDFView):
|
||||||
|
Loading…
Reference in New Issue
Block a user