feat: zjazd (meeting) on readings and materials
The Pulpit hero lists what to read for the current or next zjazd, so readings and materials get a nullable meeting_id (FK to jz_bm_meetings, ON DELETE SET NULL, indexed). The reading admin form gets a "Na zjazd" picker, the student reading JSON carries meeting_id, and the management /readings records filter and validate it.
This commit is contained in:
@@ -54,3 +54,14 @@ func courseRelation(foreignKey string) cabana.FieldRelationContract {
|
||||
LabelColumn: "name",
|
||||
}
|
||||
}
|
||||
|
||||
// meetingRelation is the belongsTo picker of a meeting_id column (zjazd).
|
||||
func meetingRelation() cabana.FieldRelationContract {
|
||||
return cabana.FieldRelationContract{
|
||||
Field: "meeting",
|
||||
Kind: "belongsTo",
|
||||
NewRelated: func() any { return &models.Meeting{} },
|
||||
ForeignKey: "meeting_id",
|
||||
LabelColumn: "number",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user