86_User_suggestions_and_feedback #106
@ -50,7 +50,7 @@
|
||||
<td class="align-middle">{{ deadline.comment }}</td>
|
||||
<td>
|
||||
{% if is_default_member and has_access %}
|
||||
<button data-form-url="{% url 'deadline-remove' deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove deadline' %}">
|
||||
<button data-form-url="{% url 'compensation:deadline-remove' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove deadline' %}">
|
||||
{% fa5_icon 'trash' %}
|
||||
</button>
|
||||
{% endif %}
|
||||
|
@ -118,26 +118,27 @@
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-12 col-lg-6">
|
||||
{% include 'compensation/detail/compensation/includes/states-before.html' %}
|
||||
<div id="related_data">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-12 col-lg-6">
|
||||
{% include 'compensation/detail/compensation/includes/states-before.html' %}
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-12 col-lg-6">
|
||||
{% include 'compensation/detail/compensation/includes/states-after.html' %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-12 col-lg-6">
|
||||
{% include 'compensation/detail/compensation/includes/states-after.html' %}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-12 col-lg-6">
|
||||
{% include 'compensation/detail/compensation/includes/actions.html' %}
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-12 col-lg-6">
|
||||
{% include 'compensation/detail/compensation/includes/deadlines.html' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-12 col-lg-6">
|
||||
{% include 'compensation/detail/compensation/includes/actions.html' %}
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-12 col-lg-6">
|
||||
{% include 'compensation/detail/compensation/includes/deadlines.html' %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-12 col-lg-6">
|
||||
{% include 'compensation/detail/compensation/includes/documents.html' %}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-12 col-lg-6">
|
||||
{% include 'compensation/detail/compensation/includes/documents.html' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -23,6 +23,7 @@ urlpatterns = [
|
||||
path('<id>/state/<state_id>/remove', state_remove_view, name='state-remove'),
|
||||
path('<id>/action/<action_id>/remove', action_remove_view, name='action-remove'),
|
||||
path('<id>/deadline/new', deadline_new_view, name="new-deadline"),
|
||||
path('<id>/deadline/<deadline_id>/remove', deadline_remove_view, name='deadline-remove'),
|
||||
path('<id>/report', report_view, name='report'),
|
||||
|
||||
# Documents
|
||||
|
@ -13,6 +13,7 @@ from intervention.models import Intervention
|
||||
from konova.contexts import BaseContext
|
||||
from konova.decorators import *
|
||||
from konova.forms import RemoveModalForm, SimpleGeomForm
|
||||
from konova.models import Deadline
|
||||
from konova.sub_settings.context_settings import TAB_TITLE_IDENTIFIER
|
||||
from konova.utils.documents import get_document, remove_document
|
||||
from konova.utils.generators import generate_qr_code
|
||||
@ -276,7 +277,8 @@ def new_document_view(request: HttpRequest, id: str):
|
||||
form = NewCompensationDocumentForm(request.POST or None, request.FILES or None, instance=comp, request=request)
|
||||
return form.process_request(
|
||||
request,
|
||||
msg_success=_("Document added")
|
||||
msg_success=_("Document added"),
|
||||
redirect_url=reverse("compensation:detail", args=(id,)) + "#related_data"
|
||||
)
|
||||
|
||||
|
||||
@ -345,7 +347,8 @@ def state_new_view(request: HttpRequest, id: str):
|
||||
form = NewStateModalForm(request.POST or None, instance=comp, request=request)
|
||||
return form.process_request(
|
||||
request,
|
||||
msg_success=_("State added")
|
||||
msg_success=_("State added"),
|
||||
redirect_url=reverse("compensation:detail", args=(id,)) + "#related_data"
|
||||
)
|
||||
|
||||
|
||||
@ -366,7 +369,8 @@ def action_new_view(request: HttpRequest, id: str):
|
||||
form = NewActionModalForm(request.POST or None, instance=comp, request=request)
|
||||
return form.process_request(
|
||||
request,
|
||||
msg_success=_("Action added")
|
||||
msg_success=_("Action added"),
|
||||
redirect_url=reverse("compensation:detail", args=(id,)) + "#related_data"
|
||||
)
|
||||
|
||||
|
||||
@ -387,7 +391,31 @@ def deadline_new_view(request: HttpRequest, id: str):
|
||||
form = NewDeadlineModalForm(request.POST or None, instance=comp, request=request)
|
||||
return form.process_request(
|
||||
request,
|
||||
msg_success=_("Deadline added")
|
||||
msg_success=_("Deadline added"),
|
||||
redirect_url=reverse("compensation:detail", args=(id,)) + "#related_data"
|
||||
)
|
||||
|
||||
|
||||
@login_required
|
||||
@default_group_required
|
||||
@shared_access_required(Compensation, "id")
|
||||
def deadline_remove_view(request: HttpRequest, id: str, deadline_id: str):
|
||||
""" Renders a form for removing deadlines from a compensation
|
||||
|
||||
Args:
|
||||
request (HttpRequest): The incoming request
|
||||
id (str): The compensation's id
|
||||
deadline_id (str): The deadline's id
|
||||
|
||||
Returns:
|
||||
|
||||
"""
|
||||
deadline = get_object_or_404(Deadline, id=deadline_id)
|
||||
form = RemoveModalForm(request.POST or None, instance=deadline, request=request)
|
||||
return form.process_request(
|
||||
request,
|
||||
msg_success=_("Deadline removed"),
|
||||
redirect_url=reverse("compensation:detail", args=(id,)) + "#related_data"
|
||||
)
|
||||
|
||||
|
||||
@ -409,7 +437,8 @@ def state_remove_view(request: HttpRequest, id: str, state_id: str):
|
||||
form = RemoveModalForm(request.POST or None, instance=state, request=request)
|
||||
return form.process_request(
|
||||
request,
|
||||
msg_success=_("State removed")
|
||||
msg_success=_("State removed"),
|
||||
redirect_url=reverse("compensation:detail", args=(id,)) + "#related_data"
|
||||
)
|
||||
|
||||
|
||||
@ -431,7 +460,8 @@ def action_remove_view(request: HttpRequest, id: str, action_id: str):
|
||||
form = RemoveModalForm(request.POST or None, instance=action, request=request)
|
||||
return form.process_request(
|
||||
request,
|
||||
msg_success=_("Action removed")
|
||||
msg_success=_("Action removed"),
|
||||
redirect_url=reverse("compensation:detail", args=(id,)) + "#related_data"
|
||||
)
|
||||
|
||||
|
||||
|
@ -3,12 +3,15 @@
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
<th scope="col" class="w-25">
|
||||
{% trans 'Timestamp' %}
|
||||
</th>
|
||||
<th scope="col">
|
||||
{% trans 'Action' %}
|
||||
</th>
|
||||
<th scope="col">
|
||||
{% trans 'Details' %}
|
||||
</th>
|
||||
<th scope="col">
|
||||
{% trans 'User' %}
|
||||
</th>
|
||||
@ -23,6 +26,9 @@
|
||||
<td>
|
||||
{{ entry.action_humanize}}
|
||||
</td>
|
||||
<td>
|
||||
{{ entry.comment|default_if_none:"-" }}
|
||||
</td>
|
||||
<td>
|
||||
{{entry.user}}
|
||||
</td>
|
||||
|
Loading…
Reference in New Issue
Block a user