@@ -208,7 +208,9 @@ def appeals(self, instance):
208208 appeals .short_description = 'Appeals'
209209
210210 # To add the 'Notify subscribers now' button
211- change_form_template = "admin/emergency_changeform.html"
211+ # WikiJS links added
212+ change_form_template = "admin/emergency_change_form.html"
213+ change_list_template = "admin/emergency_change_list.html"
212214
213215 # Overwriting readonly fields for Edit mode
214216 def changeform_view (self , request , * args , ** kwargs ):
@@ -292,6 +294,9 @@ class FieldReportAdmin(CompareVersionAdmin, RegionRestrictedAdmin, TranslationAd
292294 readonly_fields = ('report_date' , 'created_at' , 'updated_at' )
293295 list_filter = [MembershipFilter ]
294296 actions = ['create_events' , 'export_field_reports' , ]
297+ # WikiJS links added
298+ change_form_template = "admin/fieldreport_change_form.html"
299+ change_list_template = "admin/fieldreport_change_list.html"
295300
296301 def create_events (self , request , queryset ):
297302 for report in queryset :
@@ -370,6 +375,10 @@ class AppealAdmin(CompareVersionAdmin, RegionRestrictedAdmin, TranslationAdmin):
370375 actions = ['create_events' , 'confirm_events' ]
371376 autocomplete_fields = ('event' , 'country' ,)
372377
378+ # WikiJS links added
379+ change_form_template = "admin/appeal_change_form.html"
380+ change_list_template = "admin/appeal_change_list.html"
381+
373382 def create_events (self , request , queryset ):
374383 for appeal in queryset :
375384 event = models .Event .objects .create (
@@ -595,6 +604,10 @@ class SituationReportAdmin(CompareVersionAdmin, RegionRestrictedAdmin, Translati
595604 region_in = 'event__regions__in'
596605 autocomplete_fields = ('event' ,)
597606
607+ # WikiJS links added
608+ change_form_template = "admin/situationreport_change_form.html"
609+ change_list_template = "admin/situationreport_change_list.html"
610+
598611 def get_queryset (self , request ):
599612 return super ().get_queryset (request ).select_related ('type' , 'event' )
600613
@@ -611,9 +624,8 @@ class SituationReportTypeAdmin(CompareVersionAdmin):
611624class CronJobAdmin (CompareVersionAdmin ):
612625 list_display = ('name' , 'created_at' , 'num_result' , 'status' )
613626 search_fields = ('name' , 'created_at' ,)
614- readonly_fields = ('created_at' ,)
627+ readonly_fields = ('created_at' , 'message_display' , )
615628 list_filter = ('status' , 'name' )
616- readonly_fields = ('message_display' ,)
617629
618630 def message_display (self , obj ):
619631 style_class = {
@@ -757,6 +769,26 @@ def get_actions(self, request):
757769 return actions
758770
759771
772+ class CountryOfFieldReportToReviewAdmin (admin .ModelAdmin ):
773+ list_display = ('country' ,)
774+
775+ @classmethod
776+ def has_delete_permission (cls , request , obj = None ):
777+ return request .user .is_superuser
778+
779+ @classmethod
780+ def has_view_permission (cls , request , obj = None ):
781+ return request .user .is_superuser
782+
783+ @classmethod
784+ def has_change_permission (cls , request , obj = None ):
785+ return request .user .is_superuser
786+
787+ @classmethod
788+ def has_add_permission (cls , request , obj = None ):
789+ return request .user .is_superuser
790+
791+
760792admin .site .register (models .DisasterType , DisasterTypeAdmin )
761793admin .site .register (models .Event , EventAdmin )
762794admin .site .register (models .GDACSEvent , GdacsAdmin )
@@ -784,6 +816,7 @@ def get_actions(self, request):
784816admin .site .register (models .MainContact , MainContactAdmin )
785817admin .site .register (models .UserCountry , UserCountryAdmin )
786818admin .site .register (models .UserRegion , UserRegionAdmin )
819+ admin .site .register (models .CountryOfFieldReportToReview , CountryOfFieldReportToReviewAdmin )
787820# admin.site.register(Revision, RevisionAdmin)
788821
789822admin .site .site_url = 'https://' + settings .FRONTEND_URL
0 commit comments