1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-25 01:40:30 +02:00

Add button to update notes

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2024-03-24 11:28:41 +01:00
parent 64b7644e5e
commit 6fa3a08a72
7 changed files with 73 additions and 53 deletions

View File

@ -1,7 +1,8 @@
# Copyright (C) 2020 by Animath
# SPDX-License-Identifier: GPL-3.0-or-later
from django.urls import reverse_lazy
from django.utils import formats
from django.utils.safestring import mark_safe
from django.utils.text import format_lazy
from django.utils.translation import gettext_lazy as _
import django_tables2 as tables
@ -137,10 +138,21 @@ class NoteTable(tables.Table):
}
)
update = tables.Column(
verbose_name=_("Update"),
accessor="id",
empty_values=(),
)
def render_update(self, record):
return mark_safe(f'<button class="btn btn-info" data-bs-toggle="modal" '
f'data-bs-target="#{record.modal_name}Modal">'
f'{_("Update")}</button>')
class Meta:
attrs = {
'class': 'table table-condensed table-striped text-center',
}
model = Note
fields = ('jury', 'defender_writing', 'defender_oral', 'opponent_writing', 'opponent_oral',
'reporter_writing', 'reporter_oral', 'observer_oral',)
'reporter_writing', 'reporter_oral', 'observer_oral', 'update',)