feat: materials by zjazd in the student API and admin
The material admin form gets the "Na zjazd" picker, every student material JSON carries meeting_id, and GET /materials accepts meeting= inside the published-only scope, so the Pulpit hero can list the zjazd's materials next to its readings.
This commit is contained in:
@@ -23,6 +23,8 @@ type Material struct {
|
||||
ID uint `gorm:"column:id;primaryKey"`
|
||||
CourseID *uint `gorm:"column:course_id"`
|
||||
Course *Course `gorm:"foreignKey:CourseID"`
|
||||
MeetingID *uint `gorm:"column:meeting_id"`
|
||||
Meeting *Meeting `gorm:"foreignKey:MeetingID"`
|
||||
Title string `gorm:"column:title"`
|
||||
Type string `gorm:"column:type"`
|
||||
Body *string `gorm:"column:body"`
|
||||
@@ -43,7 +45,7 @@ func (Material) MorphName() string { return `Jz\Bm\Models\Material` }
|
||||
|
||||
// Fillable lists the columns mass assignment may set.
|
||||
func (Material) Fillable() []string {
|
||||
return []string{"course_id", "title", "type", "body", "source", "url", "published_at"}
|
||||
return []string{"course_id", "meeting_id", "title", "type", "body", "source", "url", "published_at"}
|
||||
}
|
||||
|
||||
// Rules are checked by the admin API on every save.
|
||||
|
||||
@@ -36,6 +36,13 @@ fields:
|
||||
label: jz.bm::lang.common.url
|
||||
type: text
|
||||
span: right
|
||||
meeting:
|
||||
label: jz.bm::lang.common.meeting
|
||||
type: relation
|
||||
nameFrom: number
|
||||
span: left
|
||||
emptyOption: jz.bm::lang.common.none
|
||||
comment: jz.bm::lang.common.meeting_comment
|
||||
tags:
|
||||
label: jz.bm::lang.materials.tags
|
||||
type: relation
|
||||
|
||||
Reference in New Issue
Block a user