feat: add admin screens, permissions and navigation

Seven admin controllers in a "Studia BM" navigation group, guarded by
jz.bm.access_courses, jz.bm.access_schedule and jz.bm.access_materials,
with Polish and English labels. Date and time fields are checked by the
models before a save and answered as 422 on the field.
This commit is contained in:
Jakub Zych
2026-10-02 14:26:26 +02:00
parent 1046237771
commit 577fa14d3d
42 changed files with 1234 additions and 11 deletions

View File

@@ -0,0 +1,16 @@
columns:
starts_at:
label: jz.bm::lang.sessions.starts_at
ends_at:
label: jz.bm::lang.sessions.ends_at
course:
label: jz.bm::lang.common.course
relation: course
select: name
searchable: true
room:
label: jz.bm::lang.sessions.room
searchable: true
is_online:
label: jz.bm::lang.sessions.is_online
type: switch

View File

@@ -0,0 +1,41 @@
fields:
course:
label: jz.bm::lang.common.course
type: relation
nameFrom: name
span: left
required: true
meeting:
label: jz.bm::lang.sessions.meeting
type: relation
nameFrom: number
span: right
emptyOption: jz.bm::lang.common.none
starts_at:
label: jz.bm::lang.sessions.starts_at
type: text
span: left
required: true
comment: jz.bm::lang.common.datetime_comment
ends_at:
label: jz.bm::lang.sessions.ends_at
type: text
span: right
required: true
comment: jz.bm::lang.common.datetime_comment
room:
label: jz.bm::lang.sessions.room
type: text
span: left
kind:
label: jz.bm::lang.sessions.kind
type: text
span: right
is_online:
label: jz.bm::lang.sessions.is_online
type: switch
span: left
notes:
label: jz.bm::lang.common.notes
type: textarea
size: small

View File

@@ -0,0 +1,17 @@
columns:
name:
label: jz.bm::lang.courses.name
searchable: true
form:
label: jz.bm::lang.courses.form_type
semester:
label: jz.bm::lang.courses.semester
lecturer:
label: jz.bm::lang.courses.lecturer
searchable: true
ects:
label: jz.bm::lang.courses.ects
elective_group:
label: jz.bm::lang.courses.elective_group
sort_order:
label: jz.bm::lang.common.sort_order

View File

@@ -0,0 +1,58 @@
fields:
name:
label: jz.bm::lang.courses.name
type: text
span: left
required: true
form:
label: jz.bm::lang.courses.form_type
type: dropdown
span: right
required: true
options:
wyklad: jz.bm::lang.forms.wyklad
cwiczenia: jz.bm::lang.forms.cwiczenia
konwersatorium: jz.bm::lang.forms.konwersatorium
seminarium: jz.bm::lang.forms.seminarium
inne: jz.bm::lang.forms.inne
semester:
label: jz.bm::lang.courses.semester
type: number
span: left
required: true
default: 1
code:
label: jz.bm::lang.courses.code
type: text
span: right
lecturer:
label: jz.bm::lang.courses.lecturer
type: text
span: left
ects:
label: jz.bm::lang.courses.ects
type: number
span: right
assessment:
label: jz.bm::lang.courses.assessment
type: text
span: left
comment: jz.bm::lang.courses.assessment_comment
elective_group:
label: jz.bm::lang.courses.elective_group
type: text
span: right
comment: jz.bm::lang.courses.elective_group_comment
sort_order:
label: jz.bm::lang.common.sort_order
type: number
span: left
default: 0
syllabus_url:
label: jz.bm::lang.courses.syllabus_url
type: text
span: right
description:
label: jz.bm::lang.common.description
type: textarea
size: large

View File

@@ -0,0 +1,12 @@
columns:
due_at:
label: jz.bm::lang.deadlines.due_at
title:
label: jz.bm::lang.common.title
searchable: true
kind:
label: jz.bm::lang.deadlines.kind
course:
label: jz.bm::lang.common.course
relation: course
select: name

View File

@@ -0,0 +1,33 @@
fields:
title:
label: jz.bm::lang.common.title
type: text
span: left
required: true
due_at:
label: jz.bm::lang.deadlines.due_at
type: text
span: right
required: true
comment: jz.bm::lang.common.datetime_comment
kind:
label: jz.bm::lang.deadlines.kind
type: dropdown
span: left
required: true
options:
zaliczenie: jz.bm::lang.deadline_kinds.zaliczenie
egzamin: jz.bm::lang.deadline_kinds.egzamin
praca: jz.bm::lang.deadline_kinds.praca
organizacyjne: jz.bm::lang.deadline_kinds.organizacyjne
inne: jz.bm::lang.deadline_kinds.inne
course:
label: jz.bm::lang.common.course
type: relation
nameFrom: name
span: right
emptyOption: jz.bm::lang.common.none
description:
label: jz.bm::lang.common.description
type: textarea
size: small

View File

@@ -0,0 +1,15 @@
columns:
title:
label: jz.bm::lang.common.title
searchable: true
type:
label: jz.bm::lang.materials.type
course:
label: jz.bm::lang.common.course
relation: course
select: name
published_at:
label: jz.bm::lang.materials.published_at
created_at:
label: jz.bm::lang.common.created_at
type: datetime

View File

@@ -0,0 +1,46 @@
# Attached files (system_files, field "files") have no form widget yet; see
# the TODO on materialsAdmin.AdminFieldRelations.
fields:
title:
label: jz.bm::lang.common.title
type: text
span: left
required: true
type:
label: jz.bm::lang.materials.type
type: dropdown
span: right
required: true
options:
pdf: jz.bm::lang.material_types.pdf
notatka: jz.bm::lang.material_types.notatka
link: jz.bm::lang.material_types.link
inne: jz.bm::lang.material_types.inne
course:
label: jz.bm::lang.common.course
type: relation
nameFrom: name
span: left
emptyOption: jz.bm::lang.common.none
published_at:
label: jz.bm::lang.materials.published_at
type: text
span: right
comment: jz.bm::lang.materials.published_at_comment
source:
label: jz.bm::lang.common.source
type: text
span: left
url:
label: jz.bm::lang.common.url
type: text
span: right
tags:
label: jz.bm::lang.materials.tags
type: relation
nameFrom: name
body:
label: jz.bm::lang.materials.body
type: textarea
size: giant
comment: jz.bm::lang.materials.body_comment

View File

@@ -0,0 +1,11 @@
columns:
number:
label: jz.bm::lang.meetings.number
starts_on:
label: jz.bm::lang.meetings.starts_on
ends_on:
label: jz.bm::lang.meetings.ends_on
notes:
label: jz.bm::lang.common.notes
searchable: true
sortable: false

View File

@@ -0,0 +1,22 @@
fields:
number:
label: jz.bm::lang.meetings.number
type: number
span: left
required: true
starts_on:
label: jz.bm::lang.meetings.starts_on
type: text
span: left
required: true
comment: jz.bm::lang.common.date_comment
ends_on:
label: jz.bm::lang.meetings.ends_on
type: text
span: right
required: true
comment: jz.bm::lang.common.date_comment
notes:
label: jz.bm::lang.common.notes
type: textarea
size: small

View File

@@ -0,0 +1,17 @@
columns:
title:
label: jz.bm::lang.common.title
searchable: true
author:
label: jz.bm::lang.readings.author
searchable: true
course:
label: jz.bm::lang.common.course
relation: course
select: name
searchable: true
is_required:
label: jz.bm::lang.readings.is_required
type: switch
sort_order:
label: jz.bm::lang.common.sort_order

View File

@@ -0,0 +1,33 @@
fields:
course:
label: jz.bm::lang.common.course
type: relation
nameFrom: name
span: left
required: true
is_required:
label: jz.bm::lang.readings.is_required
type: switch
span: right
title:
label: jz.bm::lang.common.title
type: text
span: left
required: true
author:
label: jz.bm::lang.readings.author
type: text
span: right
source:
label: jz.bm::lang.common.source
type: text
span: left
url:
label: jz.bm::lang.common.url
type: text
span: right
sort_order:
label: jz.bm::lang.common.sort_order
type: number
span: left
default: 0

7
models/tags/columns.yaml Normal file
View File

@@ -0,0 +1,7 @@
columns:
name:
label: jz.bm::lang.tags.name
searchable: true
slug:
label: jz.bm::lang.tags.slug
searchable: true

11
models/tags/fields.yaml Normal file
View File

@@ -0,0 +1,11 @@
fields:
name:
label: jz.bm::lang.tags.name
type: text
span: left
required: true
slug:
label: jz.bm::lang.tags.slug
type: text
span: right
required: true