Documentation
¶
Index ¶
- Variables
- func ConfigGinRouter(router *gin.Engine)
- func HandleValidLogin(c *gin.Context, data *tools.SessionData)
- func IsFreshInstallation(c *gin.Context, usersDao dao.UsersDao) (bool, error)
- func SetLoginRedirectCookie(c *gin.Context)
- type CacheMetrics
- type ChatData
- type HealthCheckData
- type IndexData
- type LectureUnitsPageData
- type LiveLectureManagementData
- type WatchPageData
Constants ¶
This section is empty.
Variables ¶
var VersionTag string
Functions ¶
func ConfigGinRouter ¶
func HandleValidLogin ¶
func HandleValidLogin(c *gin.Context, data *tools.SessionData)
HandleValidLogin starts a session and redirects the user to the page they were trying to access.
func IsFreshInstallation ¶
IsFreshInstallation Checks whether there are users in the database and returns true if so, false if not.
func SetLoginRedirectCookie ¶ added in v1.7.10
SetLoginRedirectCookie stores where to send the user once they have logged in.
It has to happen while serving the login page, before the user picks between the internal form and an external identity provider, because an external login leaves the site entirely and comes back without the original query string. It is exported so that the route serving the SPA login page keeps the same behaviour.
Types ¶
type CacheMetrics ¶
type HealthCheckData ¶
type HealthCheckData struct {
Version string `json:"version"`
CacheMetrics CacheMetrics `json:"cacheMetrics"`
}
type IndexData ¶
type IndexData struct {
VersionTag string
TUMLiveContext tools.TUMLiveContext
CanonicalURL tools.CanonicalURL
Branding tools.Branding
WikiURL string
// Only the course editor still sets these, to mark a course as being of a past
// semester. EditCoursePage fills them; nothing else does.
CurrentYear int
CurrentTerm string
}
IndexData is what every server-rendered page needs: who is asking, and how the installation presents itself. The course and semester listings it used to carry went with the start page, which the SPA serves.
func NewIndexData ¶
func NewIndexData() IndexData
func NewIndexDataWithContext ¶
type LectureUnitsPageData ¶
type LectureUnitsPageData struct {
IndexData IndexData
Lecture model.Stream
Units []model.StreamUnit
}
type WatchPageData ¶
type WatchPageData struct {
IsAdminOfCourse bool // is current user admin or lecturer who created this course
IsHighlightPage bool
AlertsEnabled bool // whether the alert config is set
Version string
Unit *model.StreamUnit
Presets []model.CameraPreset
Progress model.StreamProgress
IndexData IndexData
Description template.HTML
CutOffLength int // The maximum length for the preview of a description.
LectureHallName string
ChatData ChatData
}
WatchPageData contains all the metadata that is related to the watch page.
func (*WatchPageData) Prepare ¶
func (d *WatchPageData) Prepare(c *gin.Context, lectureHallsDao dao.LectureHallsDao) error
Prepare populates the data for the watch page.