validate changes and add button to restore them

This commit is contained in:
Laura Klünder 2017-06-25 15:36:51 +02:00
parent cd7d131750
commit 289297294e
4 changed files with 119 additions and 6 deletions

View file

@ -120,10 +120,19 @@ def group_changes(changeset, can_edit=False, show_history=False):
change_data = {
'pk': change.pk,
'author': change.author,
'created': _('created at %(datetime)s') % {'datetime': date_format(change.created, 'DATETIME_FORMAT')},
'discarded': change.discarded_by_id is not None,
}
if show_history:
change_data.update({
'created': _('created at %(datetime)s') % {'datetime': date_format(change.created, 'DATETIME_FORMAT')},
})
else:
change_data.update({
'apply_problem': change.check_apply_problem(),
'can_restore': change.can_restore,
})
changes.append(change_data)
if change.action == 'create':
change_data.update({
'icon': 'plus',