View Source ZoonkWeb.Plugs.Course (Zoonk v0.3.0-alpha)

Mounts the course data and permissions.

Link to this section Summary

Functions

Fetches the course's data from the database.

Handles mounting the course data to a LiveView.

Requires a school manager or course teacher to access a page.

Link to this section Functions

Link to this function

fetch_course(conn, opts)

View Source
@spec fetch_course(Plug.Conn.t(), Keyword.t()) :: Plug.Conn.t()

Fetches the course's data from the database.

Link to this function

on_mount(atom, params, session, socket)

View Source

Handles mounting the course data to a LiveView.

on_mount-options

on_mount options

  • :mount_course - Mounts the course from the course_slug paramater.
  • :mount_lesson - Mounts the lesson from the lesson_id paramater.
Link to this function

require_manager_or_course_teacher(conn, opts)

View Source
@spec require_manager_or_course_teacher(Plug.Conn.t(), Keyword.t()) :: Plug.Conn.t()

Requires a school manager or course teacher to access a page.