diff --git a/patches/turing/0016_show_event_insertion_datetime_in_admin.patch b/patches/turing/0016_show_event_insertion_datetime_in_admin.patch new file mode 100644 index 0000000..d3b0abc --- /dev/null +++ b/patches/turing/0016_show_event_insertion_datetime_in_admin.patch @@ -0,0 +1,23 @@ +diff --git a/engine/admin.py b/engine/admin.py +index 84dbdc1..9575d17 100644 +--- a/engine/admin.py ++++ b/engine/admin.py +@@ -6,11 +6,15 @@ from django.contrib.auth.admin import UserAdmin + # Register your models here. + admin.site.register(Gara) + admin.site.register(Squadra) +-admin.site.register(Evento, SimpleHistoryAdmin) +-admin.site.register(Consegna, SimpleHistoryAdmin) +-admin.site.register(Jolly) + admin.site.register(Soluzione) + ++class EventAdmin(SimpleHistoryAdmin): ++ readonly_fields = ('orario',) ++ ++admin.site.register(Consegna, EventAdmin) ++admin.site.register(Jolly, EventAdmin) ++admin.site.register(Bonus, EventAdmin) ++ + class MyUserAdmin(UserAdmin): + list_display = ('username', 'email', 'first_name', 'last_name', 'gender', 'is_staff') + fieldsets = ( diff --git a/patches/turing/README.md b/patches/turing/README.md index d433a9f..715a1f1 100644 --- a/patches/turing/README.md +++ b/patches/turing/README.md @@ -18,3 +18,4 @@ This directory contains a few local patches. Most of them are related to changes 13. `0013_display_protocol_numbers.patch`: display the protocol number (primary key in the database) and the insertion date when adding a new answer or jolly selection through the web interface. 14. `0014_classification_time_from_server.patch`: stop using `Date.now()` in the calculation of the classification and use the server datetime instead, since the browser date may not agree with the one on the server. 15. `0015_manual_bonus.patch`: add feature to assign (positive or negative) bonus to a team. As a side effect, for simplicity of the implementation of the new feature the commentary has been disabled. +16. `0016_show_event_insertion_datetime_in_admin.patch`: show date and time of the creation of an event in the admin panel. diff --git a/patches/turing/apply_patches.sh b/patches/turing/apply_patches.sh index 9ca6eaa..55e6fc7 100755 --- a/patches/turing/apply_patches.sh +++ b/patches/turing/apply_patches.sh @@ -46,4 +46,5 @@ else apply_patch 0013_display_protocol_numbers.patch apply_patch 0014_classification_time_from_server.patch apply_patch 0015_manual_bonus.patch + apply_patch 0016_show_event_insertion_datetime_in_admin.patch fi