@@ -130,7 +130,15 @@ def __init__(self, model, admin_site):
130130 and module_name in settings .COHIVA_ADMIN_FIELDS
131131 ):
132132 class_name = type (self ).__name__
133- for attr in ("fields" , "readonly_fields" , "list_display" , "list_filter" ):
133+ for attr in (
134+ "fields" ,
135+ "fieldsets" ,
136+ "readonly_fields" ,
137+ "search_fields" ,
138+ "autocomplete_fields" ,
139+ "list_display" ,
140+ "list_filter" ,
141+ ):
134142 setting_name = f"{ class_name } .{ attr } "
135143 if setting_name in settings .COHIVA_ADMIN_FIELDS [module_name ]:
136144 setattr (self , attr , settings .COHIVA_ADMIN_FIELDS [module_name ][setting_name ])
@@ -892,7 +900,7 @@ class RegistrationSlotAdmin(GenoBaseAdmin):
892900 autocomplete_fields = ["event" , "is_backup_for" ]
893901
894902
895- class RegistrationSlotInline (admin . TabularInline ):
903+ class RegistrationSlotInline (TabularInline ):
896904 model = RegistrationSlot
897905 fields = ["name" , "alt_text" , "max_places" , "is_backup_for" , "comment" ]
898906
@@ -909,32 +917,57 @@ def formfield_for_foreignkey(self, db_field, request=None, **kwargs):
909917@admin .register (RegistrationEvent )
910918class RegistrationEventAdmin (GenoBaseAdmin ):
911919 model = RegistrationEvent
912- fields = [
920+ fieldsets = (
921+ (
922+ None ,
923+ {
924+ "fields" : (
925+ "name" ,
926+ "description" ,
927+ "confirmation_mail_sender" ,
928+ "confirmation_mail_text" ,
929+ ("publication_type" , "active" ),
930+ ("publication_start" , "publication_end" ),
931+ "show_counter" ,
932+ )
933+ },
934+ ),
935+ (
936+ "Anmeldeformular" ,
937+ {
938+ "fields" : (
939+ ("enable_notes" , "enable_telephone" ),
940+ "check1_label" ,
941+ "check2_label" ,
942+ "check3_label" ,
943+ "check4_label" ,
944+ "check5_label" ,
945+ "text1_label" ,
946+ "text2_label" ,
947+ "text3_label" ,
948+ "text4_label" ,
949+ "text5_label" ,
950+ ),
951+ "classes" : ["tab" ],
952+ },
953+ ),
954+ (
955+ "Zusatzinfos" ,
956+ {
957+ "fields" : ("registration_link" , "comment" , "ts_created" , "ts_modified" ),
958+ "classes" : ["tab" ],
959+ },
960+ ),
961+ ("Verknüpfungen" , {"fields" : ("links" , "backlinks" ), "classes" : ["tab" ]}),
962+ )
963+ readonly_fields = ["registration_link" , "ts_created" , "ts_modified" , "links" , "backlinks" ]
964+ list_display = [
913965 "name" ,
914- "description " ,
966+ "registration_link " ,
915967 "confirmation_mail_sender" ,
916- "confirmation_mail_text" ,
917- ("publication_type" , "active" ),
918- ("publication_start" , "publication_end" ),
919- "show_counter" ,
920- ("enable_notes" , "enable_telephone" ),
921- "check1_label" ,
922- "check2_label" ,
923- "check3_label" ,
924- "check4_label" ,
925- "check5_label" ,
926- "text1_label" ,
927- "text2_label" ,
928- "text3_label" ,
929- "text4_label" ,
930- "text5_label" ,
931- "comment" ,
932- ("ts_created" , "ts_modified" ),
933- "links" ,
934- "backlinks" ,
968+ "active" ,
969+ "ts_created" ,
935970 ]
936- readonly_fields = ["ts_created" , "ts_modified" , "links" , "backlinks" ]
937- list_display = ["name" , "confirmation_mail_sender" , "active" , "ts_created" ]
938971 ordering = ("-active" , "-ts_created" )
939972 list_editable = ["active" ]
940973 search_fields = ["name" , "description" , "confirmation_mail_sender" , "comment" ]
0 commit comments