Fixes and improvements

* moves diff_states message back to table top for direct presentation in compensation/detail/view.html
* removes diff_states rendering in deadline card in compensation/detail/view.html
* fixes before_state adding based on GET parameter
* refactors UserActionlogEntryEnum into a UserAction TextChoice (Django 3.x)
* adds ordering of compensation states depending on surface value
* refactors ServerMessageImportance from enum into TextChoice (Django 3.x)
* adds/updates translations
This commit is contained in:
mipel
2021-08-03 17:22:41 +02:00
parent 816600535a
commit cd5b2e264b
17 changed files with 215 additions and 164 deletions

View File

@@ -1,9 +1,9 @@
import uuid
from django.utils.translation import gettext_lazy as _
from django.contrib.auth.models import User
from django.db import models
from konova.enums import UserActionLogEntryEnum
from user.enums import UserNotificationEnum
@@ -41,6 +41,16 @@ class KonovaUserExtension(models.Model):
notifications = models.ManyToManyField(UserNotification, related_name="+")
class UserAction(models.TextChoices):
"""
Defines different possible user actions for UserActionLogEntry
"""
CHECKED = "checked", _("Checked")
RECORDED = "recorded", _("Recorded")
CREATED = "created", _("Created")
DELETED = "deleted", _("Deleted")
class UserActionLogEntry(models.Model):
""" Wraps a user action log entry
@@ -58,7 +68,7 @@ class UserActionLogEntry(models.Model):
null=True,
blank=True,
help_text="Short name for performed action - optional",
choices=UserActionLogEntryEnum.as_choices(drop_empty_choice=True),
choices=UserAction.choices,
)
def __str__(self):