controllers

package
v0.0.0-...-253fa15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//SUCCESS result type
	SUCCESS = "success"
	//ERROR result type
	ERROR = "error"
	//INVALID validation result type
	INVALID = "invalid"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

type Admin struct {
	*revel.Controller
}

Admin implements logic to CRUD data for admin functions.

func (Admin) ChangeRole

func (c Admin) ChangeRole(user models.User) revel.Result

ChangeRole of an user. Sends a notification e-mail on success. - Roles: admin (activated)

func (Admin) ChangeUserData

func (c Admin) ChangeUserData(user models.User) revel.Result

ChangeUserData updates the salutation, first name, last name and e-mail of an user. - Roles: admin (activated)

func (Admin) Dashboard

func (c Admin) Dashboard() revel.Result

Dashboard rendering. The dashboard shows page statistics. - Roles: admin (activated)

func (Admin) DeleteCategory

func (c Admin) DeleteCategory(ID int, table string) revel.Result

DeleteCategory deletes a category. - Roles: admin (activated)

func (Admin) DeleteGroup

func (c Admin) DeleteGroup(ID int) revel.Result

DeleteGroup deletes a group. Groups can only be deleted if they have no children and contain no active courses. Upon deletion, all inactive courses of that group become the children of the parent group. - Roles: admin (activated)

func (Admin) DeleteHelpPageEntry

func (c Admin) DeleteHelpPageEntry(ID int, table string) revel.Result

DeleteHelpPageEntry deletes a FAQ or news feed entry. - Roles: admin (activated)

func (Admin) Index

func (c Admin) Index() revel.Result

Index of the administration page. - Roles: admin (activated)

func (Admin) InsertCategory

func (c Admin) InsertCategory(category models.Category, table string) revel.Result

InsertCategory inserts the new category as a FAQ category or a news feed category. - Roles: admin (activated)

func (Admin) InsertGroup

func (c Admin) InsertGroup(group models.Group) revel.Result

InsertGroup inserts a new group. A group can be the child of another group or a root group. Each active course must be part of a group. - Roles: admin (activated)

func (Admin) InsertHelpPageEntry

func (c Admin) InsertHelpPageEntry(entry models.HelpPageEntry) revel.Result

InsertHelpPageEntry inserts a new entry, which is either a FAQ or a news feed entry. - Roles: admin (activated)

func (Admin) InsertLogEntries

func (c Admin) InsertLogEntries() revel.Result

InsertLogEntries inserts all new log entries of the error log file. These are all log entries appended after the last executing of this controller. - Roles: admin (activated)

func (Admin) LogEntries

func (c Admin) LogEntries() revel.Result

LogEntries rendering. Loads all not yet solved log entries of the error log. - Roles: admin (activated)

func (Admin) Roles

func (c Admin) Roles() revel.Result

Roles renders all users with elevated roles (ADMIN or CREATOR). - Roles: admin (activated)

func (Admin) SearchUser

func (c Admin) SearchUser(value string, searchInactive bool) revel.Result

SearchUser renders search results for a search value. The search results are a slice of users. - Roles: admin (activated)

func (Admin) SolveLogEntry

func (c Admin) SolveLogEntry(entry models.LogEntry) revel.Result

SolveLogEntry solves a log entry. Any log entry being solved is no longer shown when rendering all log entries. - Roles: admin (activated)

func (Admin) UpdateCategory

func (c Admin) UpdateCategory(category models.Category, table string) revel.Result

UpdateCategory updates the name of a category. - Roles: admin (activated)

func (Admin) UpdateGroup

func (c Admin) UpdateGroup(group models.Group) revel.Result

UpdateGroup updates the name and the course limit of a group. - Roles: admin (activated)

func (Admin) UpdateHelpPageEntry

func (c Admin) UpdateHelpPageEntry(entry models.HelpPageEntry) revel.Result

UpdateHelpPageEntry updates a FAQ or news feed entry. - Roles: admin (activated)

func (Admin) Users

func (c Admin) Users(ID int) revel.Result

Users rendering. Loads a modal for loading user details. Also loads the details of the provided user (if ID != 0). - Roles: admin (activated)

type App

type App struct {
	*revel.Controller
}

App implements logic to CRUD general page data.

func (App) ChangeLanguage

func (c App) ChangeLanguage(language string) revel.Result

ChangeLanguage changes the language, then redirects to the page currently set as currPath. - Roles: all

func (App) DataPrivacy

func (c App) DataPrivacy() revel.Result

DataPrivacy renders the data privacy page. - Roles: all (except not activated users)

func (App) FAQs

func (c App) FAQs() revel.Result

FAQs renders the FAQs page. - Roles: all (except not activated users)

func (App) Groups

func (c App) Groups(prefix string) revel.Result

Groups renders all groups and their children recursively. - Roles: all (except not activated users)

func (App) Imprint

func (c App) Imprint() revel.Result

Imprint renders the imprint page. - Roles: all (except not activated users)

func (App) Index

func (c App) Index() revel.Result

Index renders the landing page of the application. - Roles: all (except not activated users)

func (App) News

func (c App) News() revel.Result

News renders the news feed page. - Roles: all (except not activated users)

type Course

type Course struct {
	*revel.Controller
}

Course implements logic to load courses.

func (Course) Allowlist

func (c Course) Allowlist(ID int) revel.Result

Allowlist of a course. - Roles: creator and editors of this course.

func (Course) Blocklist

func (c Course) Blocklist(ID int) revel.Result

Blocklist of a course. - Roles: creator and editors of this course.

func (Course) CalendarEvent

func (c Course) CalendarEvent(ID, courseID, shift int, monday string, day int) revel.Result

CalendarEvent of a course. Loads a specific calender event as defined by monday. - Roles: if public all, else logged in users.

func (Course) CalendarEvents

func (c Course) CalendarEvents(ID int) revel.Result

CalendarEvents of a course. - Roles: if public all, else logged in users.

func (Course) EditorInstructorList

func (c Course) EditorInstructorList(ID int) revel.Result

EditorInstructorList of a course. - Roles: if public all, else logged in users.

func (Course) Events

func (c Course) Events(ID int) revel.Result

Events of a course. - Roles: if public all, else logged in users.

func (Course) Meetings

func (c Course) Meetings(ID int) revel.Result

Meetings of an event. - Roles: if public all, else logged in users.

func (Course) Open

func (c Course) Open(ID int) revel.Result

Open an already existing course for enrollment. - Roles: if public all, else logged in users.

func (Course) Path

func (c Course) Path(ID int) revel.Result

Path of a course. - Roles: if public all, else logged in users.

func (Course) Restrictions

func (c Course) Restrictions(ID int) revel.Result

Restrictions of a course. - Roles: if public all, else logged in users.

func (Course) Search

func (c Course) Search(value string) revel.Result

Search for a specific course. Roles: all (except not activated users).

type Creator

type Creator struct {
	*revel.Controller
}

Creator implements logic to manage courses.

func (Creator) Activate

func (c Creator) Activate(ID int) revel.Result

Activate a course draft. - Roles: creator of the course

func (Creator) Delete

func (c Creator) Delete(ID int) revel.Result

Delete a course (draft). - Roles: creator of the course

func (Creator) Duplicate

func (c Creator) Duplicate(ID int, title string) revel.Result

Duplicate a course draft. - Roles: creator of the course

func (Creator) Expire

func (c Creator) Expire(ID int) revel.Result

Expire an active course. - Roles: creator of the course

func (Creator) New

func (c Creator) New(param models.NewCourseParam, file []byte) revel.Result

New creates a new inactive course according to the specified parameters. - Roles: creator

func (Creator) Search

func (c Creator) Search(value string) revel.Result

Search returns all courses matching a search value for which the user has edit rights.

type Edit

type Edit struct {
	*revel.Controller
}

Edit implements logic to edit course data.

func (Edit) ChangeBool

func (c Edit) ChangeBool(ID int, listType string, option bool) revel.Result

ChangeBool toggles the provided boolean value of a course. - Roles: creator and editors of the course

func (Edit) ChangeEnrollLimit

func (c Edit) ChangeEnrollLimit(ID int, fieldID string, value int) revel.Result

ChangeEnrollLimit changes the enrollment limit of a course. - Roles: creator and editors of the course

func (Edit) ChangeGroup

func (c Edit) ChangeGroup(ID, parentID int, conf models.EditEMailConfig) revel.Result

ChangeGroup of a course. - Roles: creator and editors of the course

func (Edit) ChangeRestriction

func (c Edit) ChangeRestriction(ID int, restriction models.Restriction) revel.Result

ChangeRestriction adds/edits a degree/course of study/semester restriction of a course. - Roles: creator and editors of the course

func (Edit) ChangeText

func (c Edit) ChangeText(ID int, fieldID, value string, conf models.EditEMailConfig) revel.Result

ChangeText changes the text of the provided column. - Roles: creator and editors of the course

func (Edit) ChangeTimestamp

func (c Edit) ChangeTimestamp(ID int, fieldID, date, time string,
	conf models.EditEMailConfig) revel.Result

ChangeTimestamp changes the specified timestamp. - Roles: creator and editors of the course

func (Edit) ChangeUserList

func (c Edit) ChangeUserList(ID, userID int, listType string) revel.Result

ChangeUserList adds a user to the user list of a course. - Roles: creator and editors of the course

func (Edit) ChangeViewMatrNr

func (c Edit) ChangeViewMatrNr(ID, userID int, listType string, option bool) revel.Result

ChangeViewMatrNr toggles the matriculation number restrictions of an editor/instructor. - Roles: creator and editors of the course

func (Edit) DeleteFromUserList

func (c Edit) DeleteFromUserList(ID, userID int, listType string) revel.Result

DeleteFromUserList removes a user from the user list of a course. - Roles: creator and editors of the course

func (Edit) DeleteRestriction

func (c Edit) DeleteRestriction(ID, restrictionID int) revel.Result

DeleteRestriction of a course. - Roles: creator and editors of this course

func (Edit) Download

func (c Edit) Download(ID int, filename string) revel.Result

Download a course as JSON. - Roles: creator of the course

func (Edit) NewEvent

func (c Edit) NewEvent(ID int, value, eventType string,
	conf models.EditEMailConfig) revel.Result

NewEvent creates a new blank event in a course. - Roles: creator and editors of this course.

func (Edit) Open

func (c Edit) Open(ID int) revel.Result

Open an already existing course for modification, etc. - Roles: creator and editors of this course

func (Edit) SearchUser

func (c Edit) SearchUser(ID int, value, listType string, searchInactive bool) revel.Result

SearchUser searches for users for the different user lists. - Roles: creator and editors of the course

func (Edit) Validate

func (c Edit) Validate(ID int) revel.Result

Validate all course data. - Roles: creator and editors of this course

type EditCalendarEvent

type EditCalendarEvent struct {
	*revel.Controller
}

EditCalendarEvent implements logic to CRUD calendar event data.

func (EditCalendarEvent) ChangeException

func (c EditCalendarEvent) ChangeException(ID, courseID int, exception models.Exception) revel.Result

ChangeException edits or adds an exception. Exceptions block slots of a day template. - Roles: creator and editors of the course of the calendar event

func (EditCalendarEvent) ChangeText

func (c EditCalendarEvent) ChangeText(ID int, fieldID, value string) revel.Result

ChangeText of the provided column of a calendar event. - Roles: creator and editors of the course of the calendar event

func (EditCalendarEvent) Delete

func (c EditCalendarEvent) Delete(ID, courseID int) revel.Result

Delete calendar event. - Roles: creator and editors of the course of the calendar event

func (EditCalendarEvent) DeleteDayTemplate

func (c EditCalendarEvent) DeleteDayTemplate(ID, courseID int) revel.Result

DeleteDayTemplate of a calendar event. - Roles: creator and editors of the course of the calendar event

func (EditCalendarEvent) DeleteException

func (c EditCalendarEvent) DeleteException(ID, courseID int) revel.Result

DeleteException of a calendar event. - Roles: creator and editors of the course of the calendar event

func (EditCalendarEvent) Duplicate

func (c EditCalendarEvent) Duplicate(ID, courseID int) revel.Result

Duplicate calendar event. - Roles: creator and editors of the course of the event

func (EditCalendarEvent) EditDayTemplate

func (c EditCalendarEvent) EditDayTemplate(ID, courseID int, tmpl models.DayTmpl) revel.Result

EditDayTemplate edits a repeatable blueprint of a day. - Roles: creator and editors of the course of the calendar event

func (EditCalendarEvent) NewDayTemplate

func (c EditCalendarEvent) NewDayTemplate(ID, courseID int, tmpl models.DayTmpl) revel.Result

NewDayTemplate creates a repeatable blueprint of a day. - Roles: creator and editors of the course of the calendar event

type EditEvent

type EditEvent struct {
	*revel.Controller
}

EditEvent implements logic to edit event data.

func (EditEvent) ChangeBool

func (c EditEvent) ChangeBool(ID int, listType string, option bool) revel.Result

ChangeBool toggles the provided boolean value of an event. - Roles: creator and editors of the course of the event

func (EditEvent) ChangeCapacity

func (c EditEvent) ChangeCapacity(ID int, fieldID string, value int) revel.Result

ChangeCapacity changes the capacity of an event. - Roles: creator and editors of the course of the event

func (EditEvent) ChangeEnrollmentKey

func (c EditEvent) ChangeEnrollmentKey(ID int, key1, key2, fieldID string) revel.Result

ChangeEnrollmentKey sets an enrollment key. - Roles: creator and editors of the course of the event

func (EditEvent) ChangeText

func (c EditEvent) ChangeText(ID int, fieldID, value string,
	conf models.EditEMailConfig) revel.Result

ChangeText changes the text of the provided column. - Roles: creator and editors of the course of the event

func (EditEvent) Delete

func (c EditEvent) Delete(ID, courseID int) revel.Result

Delete event. - Roles: creator and editors of the course of the event

func (EditEvent) DeleteEnrollmentKey

func (c EditEvent) DeleteEnrollmentKey(ID int) revel.Result

DeleteEnrollmentKey of an event. - Roles: creator and editors of the course of the event

func (EditEvent) Duplicate

func (c EditEvent) Duplicate(ID, courseID int) revel.Result

Duplicate event. - Roles: creator and editors of the course of the event

func (EditEvent) NewMeeting

func (c EditEvent) NewMeeting(ID int, option models.MeetingInterval,
	conf models.EditEMailConfig) revel.Result

NewMeeting creates a new blank meeting that is part of an event. - Roles: creator and editors of the course of the event

type EditMeeting

type EditMeeting struct {
	*revel.Controller
}

EditMeeting implements logic to edit meeting data.

func (EditMeeting) Delete

func (c EditMeeting) Delete(ID, eventID int,
	conf models.EditEMailConfig) revel.Result

Delete meeting. - Roles: creator and editors of the course of the meeting

func (EditMeeting) Duplicate

func (c EditMeeting) Duplicate(ID, eventID int,
	conf models.EditEMailConfig) revel.Result

Duplicate meeting. - Roles: creator and editors of the course of the meeting

func (EditMeeting) Edit

func (c EditMeeting) Edit(ID int, meeting models.Meeting,
	conf models.EditEMailConfig) revel.Result

Edit meeting. - Roles: creator and editors of the course of the meeting

type Enrollment

type Enrollment struct {
	*revel.Controller
}

Enrollment implements logic to enroll in events.

func (Enrollment) Enroll

func (c Enrollment) Enroll(ID int, key, comment string) revel.Result

Enroll a user in an event. - Roles: logged in and activated users

func (Enrollment) EnrollInSlot

func (c Enrollment) EnrollInSlot(ID, courseID, year, day int, startTime, endTime,
	date string, monday string) revel.Result

EnrollInSlot enrolls a user in a time slot of a day in a calendar event. - Roles: logged in and activated users

func (Enrollment) Unsubscribe

func (c Enrollment) Unsubscribe(ID int) revel.Result

Unsubscribe a user from an event. - Roles: logged in and activated users

func (Enrollment) UnsubscribeFromSlot

func (c Enrollment) UnsubscribeFromSlot(slotID, eventID, courseID, day int,
	monday string) revel.Result

UnsubscribeFromSlot deletes a slot of an user.

type ErrorType

type ErrorType int

ErrorType is a type for encoding different errors.

func (ErrorType) String

func (s ErrorType) String() string

type Manage

type Manage struct {
	*revel.Controller
}

Manage implements the course management page.

func (Manage) Active

func (c Manage) Active() revel.Result

Active renders the active courses page. - Roles: creator, editors and instructors

func (Manage) Drafts

func (c Manage) Drafts() revel.Result

Drafts renders the drafts page. - Roles: creator and editors

func (Manage) Expired

func (c Manage) Expired() revel.Result

Expired renders the expired courses page. - Roles: creator, editors and instructors

type Participants

type Participants struct {
	*revel.Controller
}

Participants implements logic to CRUD participants.

func (Participants) ChangeStatus

func (c Participants) ChangeStatus(ID, eventID int, enrolled models.Enrolled) revel.Result

ChangeStatus changes the payment status of a user in an event. - Roles: creator, editors and instructors of this course

func (Participants) Days

func (c Participants) Days(ID, eventID, shift int, t string) revel.Result

Days renders all slots of each day of a week. - Roles: creator, editors and instructors of this course

func (Participants) DeleteSlot

func (c Participants) DeleteSlot(ID, eventID, slotID int, t string) revel.Result

DeleteSlot of a calendar event.

func (Participants) Download

func (c Participants) Download(ID int, conf models.ListConf) revel.Result

Download a list of participants. - Roles: creator, editors and instructors of this course

func (Participants) EMail

func (c Participants) EMail(ID int, conf models.ListConf) revel.Result

EMail sends an e-mail to a list of participants. - Roles: creator, editors and instructors of this course

func (Participants) Enroll

func (c Participants) Enroll(ID, eventID, userID int) revel.Result

Enroll a user without validating enrollment constraints. - Roles: creator, editors and instructors of this course

func (Participants) Open

func (c Participants) Open(ID, eventID int) revel.Result

Open a course for participants management. - Roles: creator, editors and instructors of this course

func (Participants) SearchUser

func (c Participants) SearchUser(ID, eventID int, value string) revel.Result

SearchUser renders search results for a search value. - Roles: creator, editors and instructors of this course

func (Participants) Unsubscribe

func (c Participants) Unsubscribe(ID, eventID, userID int) revel.Result

Unsubscribe a user from an event. - Roles: creator, editors and instructors of this course

func (Participants) Waitlist

func (c Participants) Waitlist(ID, eventID, userID int) revel.Result

Waitlist puts a user at the wait list of an event without validating enrollment constraints. - Roles: creator, editors and instructors of this course

type User

type User struct {
	*revel.Controller
}

User implements logic to CRUD users.

func (User) ActivationPage

func (c User) ActivationPage() revel.Result

ActivationPage renders the activation page. - Roles: all

func (User) ChangePassword

func (c User) ChangePassword(oldPw, newPw1, newPw2 string) revel.Result

ChangePassword of an user. - Roles: logged in and activated extern users

func (User) Login

func (c User) Login(credentials models.Credentials) revel.Result

Login of an user. - Roles: not logged in users

func (User) LoginPage

func (c User) LoginPage() revel.Result

LoginPage renders the login page. - Roles: not logged in users

func (User) Logout

func (c User) Logout() revel.Result

Logout handles logout, deletes all session values. - Roles: all

func (User) NewActivationCode

func (c User) NewActivationCode() revel.Result

NewActivationCode sends a new activation code. - Roles: logged in and not activated users

func (User) NewPassword

func (c User) NewPassword(email string) revel.Result

NewPassword generates a new password and sends it via e-mail. - Roles: all

func (User) NewPasswordPage

func (c User) NewPasswordPage() revel.Result

NewPasswordPage renders the page to request a new password. - Roles: not logged in users

func (User) PrefLanguagePage

func (c User) PrefLanguagePage() revel.Result

PrefLanguagePage renders the page to set a preferred language. - Roles: logged in users

func (User) Profile

func (c User) Profile() revel.Result

Profile page of the user. - Roles: logged in and activated users

func (User) Registration

func (c User) Registration(user models.User) revel.Result

Registration registers a new external user and sends an activation e-mail. - Roles: not logged in users

func (User) RegistrationPage

func (c User) RegistrationPage() revel.Result

RegistrationPage renders the registration page. - Roles: not logged in users

func (User) SetPrefLanguage

func (c User) SetPrefLanguage(prefLanguage string) revel.Result

SetPrefLanguage sets the preferred language of the user. - Roles: logged in users

func (User) UpdateExternUserData

func (c User) UpdateExternUserData(user models.User) revel.Result

UpdateExternUserData of an user. - Roles: logged in and activated extern users

func (User) VerifyActivationCode

func (c User) VerifyActivationCode(activationCode string) revel.Result

VerifyActivationCode verifies an activation code. - Roles: all

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL