Linkage improvement
* adds linking to submenus * adds PaymentAdmin * adds Meta class inheritance for tables
This commit is contained in:
@@ -9,6 +9,8 @@ Created on: 16.11.20
|
||||
from abc import abstractmethod
|
||||
|
||||
from django import forms
|
||||
from django.contrib.auth.models import User
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
@@ -84,10 +86,11 @@ class RemoveForm(BaseForm):
|
||||
def is_checked(self) -> bool:
|
||||
return self.cleaned_data.get("check", False)
|
||||
|
||||
def save(self):
|
||||
def save(self, user: User):
|
||||
if self.object_to_remove is not None and self.is_checked():
|
||||
self.object_to_remove.is_active = False
|
||||
self.object_to_remove.is_deleted = True
|
||||
self.object_to_remove.deleted_on = timezone.now()
|
||||
self.object_to_remove.deleted_by = user
|
||||
self.object_to_remove.save()
|
||||
return self.object_to_remove
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
</div>
|
||||
<div class="col-md">
|
||||
<div class="row my-1">
|
||||
<a href="{% url 'home' %}">
|
||||
<a href="{% url 'intervention:new' %}">
|
||||
<button class="btn btn-default">{% fa5_icon 'plus' %} {% trans 'Create' %}</button>
|
||||
</a>
|
||||
</div>
|
||||
@@ -69,12 +69,12 @@
|
||||
</div>
|
||||
<div class="col-md">
|
||||
<div class="row my-1">
|
||||
<a href="{% url 'home' %}">
|
||||
<a href="{% url 'compensation:new' %}">
|
||||
<button class="btn btn-default">{% fa5_icon 'plus' %} {% trans 'Create' %}</button>
|
||||
</a>
|
||||
</div>
|
||||
<div class="row my-1">
|
||||
<a href="{% url 'home' %}">
|
||||
<a href="{% url 'compensation:index' %}">
|
||||
<button class="btn btn-default">{% fa5_icon 'eye' %} {% trans 'Show' %}</button>
|
||||
</a>
|
||||
</div>
|
||||
@@ -88,7 +88,7 @@
|
||||
{% trans 'Eco-account' %}
|
||||
</h4>
|
||||
<div class="row">
|
||||
<a href="{% url 'home' %}">
|
||||
<a href="{% url 'compensation:account-index' %}">
|
||||
<div class="col-sm-5">
|
||||
<div class="qs-box d-flex justify-content-center align-items-center">
|
||||
{% fa5_icon 'tree' %}
|
||||
@@ -110,12 +110,12 @@
|
||||
<div class="col-sm-12 col-lg">
|
||||
<div class="col-sm">
|
||||
<div class="row my-1">
|
||||
<a href="{% url 'home' %}">
|
||||
<a href="{% url 'compensation:account-new' %}">
|
||||
<button class="btn btn-default">{% fa5_icon 'plus' %} {% trans 'Create' %}</button>
|
||||
</a>
|
||||
</div>
|
||||
<div class="row my-1">
|
||||
<a href="{% url 'home' %}">
|
||||
<a href="{% url 'compensation:account-index' %}">
|
||||
<button class="btn btn-default">{% fa5_icon 'eye' %} {% trans 'Show' %}</button>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -30,7 +30,6 @@ urlpatterns = [
|
||||
path('', home_view, name="home"),
|
||||
path('intervention/', include("intervention.urls")),
|
||||
path('compensation/', include("compensation.urls")),
|
||||
path('eco-account/', include("intervention.urls")), #ToDo
|
||||
path('ema/', include("intervention.urls")), #ToDo
|
||||
path('organisation/', include("organisation.urls")),
|
||||
path('user/', include("user.urls")),
|
||||
|
||||
Reference in New Issue
Block a user