# 86 Viewport jump Intervention
* adds direct jump of viewport on related-data action (create/delete)
This commit is contained in:
parent
0fb27f979f
commit
6dbf87a8de
@ -533,7 +533,8 @@ def new_deduction_view(request: HttpRequest, id: str):
|
||||
form = NewDeductionModalForm(request.POST or None, instance=acc, request=request)
|
||||
return form.process_request(
|
||||
request,
|
||||
msg_success=_("Deduction added")
|
||||
msg_success=_("Deduction added"),
|
||||
redirect_url=reverse("compensation:detail", args=(id,)) + "#related_data"
|
||||
)
|
||||
|
||||
|
||||
|
@ -5,6 +5,7 @@ Contact: michel.peltriaux@sgdnord.rlp.de
|
||||
Created on: 09.08.21
|
||||
|
||||
"""
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.http import HttpRequest
|
||||
@ -33,7 +34,8 @@ def new_payment_view(request: HttpRequest, intervention_id: str):
|
||||
form = NewPaymentForm(request.POST or None, instance=intervention, request=request)
|
||||
return form.process_request(
|
||||
request,
|
||||
msg_success=_("Payment added")
|
||||
msg_success=_("Payment added"),
|
||||
redirect_url=reverse("intervention:detail", args=(intervention_id,)) + "#related_data"
|
||||
)
|
||||
|
||||
|
||||
@ -54,5 +56,6 @@ def payment_remove_view(request: HttpRequest, id: str):
|
||||
return form.process_request(
|
||||
request=request,
|
||||
msg_success=_("Payment removed"),
|
||||
redirect_url=reverse("intervention:detail", args=(payment.intervention_id,)) + "#related_data"
|
||||
)
|
||||
|
||||
|
@ -26,6 +26,10 @@ class Revocation(BaseResource):
|
||||
self.document.delete(*args, **kwargs)
|
||||
super().delete()
|
||||
|
||||
@property
|
||||
def intervention(self):
|
||||
return self.legal.intervention
|
||||
|
||||
|
||||
class RevocationDocument(AbstractDocument):
|
||||
"""
|
||||
|
@ -136,6 +136,7 @@
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div id="related_data">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-12 col-lg-6">
|
||||
{% include 'intervention/detail/includes/compensations.html' %}
|
||||
@ -159,6 +160,7 @@
|
||||
<div class="col-sm-12 col-md-12 col-lg-6">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% with 'btn-modal' as btn_class %}
|
||||
|
@ -129,7 +129,8 @@ def new_document_view(request: HttpRequest, id: str):
|
||||
form = NewInterventionDocumentForm(request.POST or None, request.FILES or None, instance=intervention, request=request)
|
||||
return form.process_request(
|
||||
request,
|
||||
msg_success=_("Document added")
|
||||
msg_success=_("Document added"),
|
||||
redirect_url=reverse("intervention:detail", args=(id,)) + "#related_data"
|
||||
)
|
||||
|
||||
|
||||
@ -348,10 +349,12 @@ def remove_revocation_view(request: HttpRequest, id: str):
|
||||
|
||||
"""
|
||||
obj = Revocation.objects.get(id=id)
|
||||
|
||||
form = RemoveModalForm(request.POST or None, instance=obj, request=request)
|
||||
return form.process_request(
|
||||
request,
|
||||
_("Revocation removed"),
|
||||
redirect_url=reverse("intervention:detail", args=(obj.intervention.id,)) + "#related_data"
|
||||
)
|
||||
|
||||
|
||||
@ -455,7 +458,8 @@ def new_revocation_view(request: HttpRequest, id: str):
|
||||
form = NewRevocationModalForm(request.POST or None, request.FILES or None, instance=intervention, request=request)
|
||||
return form.process_request(
|
||||
request,
|
||||
msg_success=_("Revocation added")
|
||||
msg_success=_("Revocation added"),
|
||||
redirect_url=reverse("intervention:detail", args=(id,)) + "#related_data"
|
||||
)
|
||||
|
||||
|
||||
@ -502,7 +506,8 @@ def new_deduction_view(request: HttpRequest, id: str):
|
||||
form = NewDeductionModalForm(request.POST or None, instance=intervention, request=request)
|
||||
return form.process_request(
|
||||
request,
|
||||
msg_success=_("Deduction added")
|
||||
msg_success=_("Deduction added"),
|
||||
redirect_url=reverse("intervention:detail", args=(id,)) + "#related_data",
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user