1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-07-25 18:15:24 +02:00

Added valid field and logic for Achievement

This commit is contained in:
Ehouarn
2025-07-22 01:30:47 +02:00
parent db4d0dd83a
commit c66cc14576
9 changed files with 152 additions and 31 deletions

View File

@ -65,6 +65,23 @@ class AchievementTable(tables.Table):
"""
List recent achievements.
"""
validate = tables.LinkColumn(
'family:achievement_validate',
args=[A('id')],
verbose_name=_("Validate"),
text=_("Validate"),
orderable=False,
attrs={
'th': {
'id': 'validate-achievement-header'
},
'a': {
'class': 'btn btn-success',
'data-type': 'validate-achievement'
}
},
)
delete = tables.LinkColumn(
'family:achievement_delete',
args=[A('id')],
@ -73,11 +90,11 @@ class AchievementTable(tables.Table):
orderable=False,
attrs={
'th': {
'id': 'delete-membership-header'
'id': 'delete-achievement-header'
},
'a': {
'class': 'btn btn-danger',
'data-type': 'delete-membership'
'data-type': 'delete-achievement'
}
},
)
@ -87,10 +104,11 @@ class AchievementTable(tables.Table):
'class': 'table table-condensed table-striped table-hover'
}
model = Achievement
fields = ('family', 'challenge', 'challenge__points', 'obtained_at', )
fields = ('family', 'challenge', 'challenge__points', 'obtained_at', 'valid')
template_name = 'django_tables2/bootstrap4.html'
order_by = ('-obtained_at',)
class FamilyAchievementTable(tables.Table):
"""
Table des défis réalisés par une famille spécifique.
@ -102,4 +120,4 @@ class FamilyAchievementTable(tables.Table):
attrs = {
'class': 'table table-condensed table-striped table-hover'
}
order_by = ('-obtained_at',)
order_by = ('-obtained_at',)