Documentation ¶
Index ¶
- Constants
- Variables
- func AskCreateCourse(w fyne.Window, img []byte, courseName string, optional ...string)
- func ConfigureDateDropdownVerification(dateDropdown *widget.SelectEntry, course *SelectionTracker, ...)
- func CoursesScreen(w fyne.Window) fyne.CanvasObject
- func DetectAttendancyState(item *AttendanceRow)
- func DisplayInserCourseDialog(w fyne.Window)
- func DisplayInsertStudentDialog(w fyne.Window)
- func GetAttendancies(course int, date time.Time) ([]string, []bool)
- func GetImageByDate(title string, date time.Time) []byte
- func InsertList(w fyne.Window, img []byte, courseName string, optional ...string)
- func InsertStudent(w fyne.Window, form *dialog.CustomDialog, studentEntry *widget.Entry, ...) func()
- func LandingScreen(_ fyne.Window) fyne.CanvasObject
- func LoadImage(w fyne.Window, f fyne.URIReadCloser) []byte
- func LoadOverviewWidgets(w fyne.Window, grid *fyne.Container)
- func LoadVerificationWidgets(course int, date time.Time) *fyne.Container
- func MapBooleans(b bool) string
- func OpenImageUpload(w fyne.Window, optional ...string)
- func OverviewScreen(w fyne.Window) fyne.CanvasObject
- func RefreshCourseAttendancy(table *fyne.Container, course string, date string)
- func RefreshDateDropdown(dateDropdown *widget.SelectEntry, course string)
- func RefreshSelection(selection *SelectionTracker) string
- func RefreshStudentAttendancyList(table *fyne.Container, course string, student string, ...)
- func RefreshStudentDropdown(studentDropdown *widget.SelectEntry, course string)
- func ReturnAttendanceTable(header1 string, header2 string) (*fyne.Container, *fyne.Container)
- func ReturnConfirmButton(w fyne.Window, widgetList *fyne.Container, optional []time.Time, course int, ...) *widget.Button
- func ReturnCourseDropdown(selectionTracker *SelectionTracker, selection *widget.Label, ...) *widget.Select
- func ReturnCourseInsertButton(w fyne.Window) *widget.Button
- func ReturnDateDropdown(dates []string) *widget.SelectEntry
- func ReturnEditDropdown(w fyne.Window, courseDropdown *widget.Select, dateDropdown *widget.SelectEntry, ...) *widget.Select
- func ReturnExitButton(w fyne.Window) *widget.Button
- func ReturnHeader(pageTitle string) *canvas.Text
- func ReturnMailRefreshContainer(w fyne.Window) *tappableImage
- func ReturnNavBar(setContent func(s yaac_frontend_settings.Setting)) *widget.Tree
- func ReturnNonAttending(attendance []yaac_shared.Attendance) []string
- func ReturnStudentDropdown(studentNames []string, student *SelectionTracker, selection *widget.Label, ...) *widget.SelectEntry
- func ReturnStudentInsertButton(w fyne.Window) *widget.Button
- func ReturnToPreviousPage(w fyne.Window, course int, optional []time.Time, courseTable *fyne.Container)
- func ReturnUpdatedAttendancies(attendances []bool, list []yaac_shared.AttendanceList) []yaac_shared.Attendance
- func ReturnVerificationHeader() *fyne.Container
- func ReturnVerifyImageContainer(w fyne.Window) *tappableImage
- func RotateImage(img []byte) *canvas.Image
- func SettingsScreen(w fyne.Window) fyne.CanvasObject
- func ShowFileDialog(w fyne.Window, courseName string, optional ...string)
- func ShowImage(w fyne.Window, course string, date string)
- func StudentScreen(w fyne.Window) fyne.CanvasObject
- func UpdateList(w fyne.Window, attendances []bool, course int, date time.Time)
- func ValidateCourseInput(courseEntry *widget.Entry, fileUpload *widget.Button)
- func ValidateInput(studentEntry *widget.Entry, courseEntry *widget.Entry, ...)
- func VerificationScreen(w fyne.Window, img []byte, course int, courseTable *fyne.Container, ...) fyne.CanvasObject
- func VerifyList(w fyne.Window, course string, date string, courseTable *fyne.Container)
- type AttendanceRow
- type FrontendMain
- type OverviewWidget
- type Page
- type SelectionTracker
- type VerificationWidget
Constants ¶
const DATE_FORMAT = "2006-01-02"
Variables ¶
var ( Pages = map[string]Page{ "home": {"Home", LandingScreen, true}, "overview": {"Übersicht", OverviewScreen, true}, "courses": {"Kurse", CoursesScreen, true}, "students": {"Studenten", StudentScreen, true}, "settings": {"Einstellungen", SettingsScreen, true}, } PagesIndex = map[string][]string{ "": {"home", "overview", "courses", "students", "settings"}, } )
Defines the actual Mapping from each Page struct to it's respective index
Functions ¶
func AskCreateCourse ¶
Ask if the user wants to create a new course with the given name an create it, if user agrees
func ConfigureDateDropdownVerification ¶
func ConfigureDateDropdownVerification(dateDropdown *widget.SelectEntry, course *SelectionTracker, selection *widget.Label, courseTable *fyne.Container, editDropdown *widget.Select)
ConfigureDateDropdownVerification is responsible for configuring the verification process for text inputs passing the dateDropdown, course SelectionTracker, selection Label, courseTable Container as well as the editDropdown for further processing.
func CoursesScreen ¶
func CoursesScreen(w fyne.Window) fyne.CanvasObject
func DetectAttendancyState ¶
func DetectAttendancyState(item *AttendanceRow)
DetectAttendancyState will detect the current attendancies state and change frame color accordingly for each AttendanceRow
func DisplayInserCourseDialog ¶
func DisplayInserCourseDialog(w fyne.Window)
ReturnCourseInsertButton returns the configured courseInsertButton
func DisplayInsertStudentDialog ¶
func DisplayInsertStudentDialog(w fyne.Window)
ReturnStudentInsertButton returns the configured courseInsertButton
func GetAttendancies ¶
GetAttendancies returns all attendancies using the courseID and date for the selected List. Returning the studentNames and isAttending values in two seperate lists for LoadVerificationWidgets to use.
func GetImageByDate ¶
GetImageByDate requests the latest list regarding a defined date from the dataset
func InsertList ¶
InsertList will finally construct a yaac_shared.AttendanceList object from the previously gathered functions and push it on the database.
func InsertStudent ¶
func InsertStudent(w fyne.Window, form *dialog.CustomDialog, studentEntry *widget.Entry, courseEntry *widget.Entry, isImmatriculated *widget.Check) func()
InsertStudent collects all of the forms entries as input and builds student struct out of them to push on the db.
func LandingScreen ¶
func LandingScreen(_ fyne.Window) fyne.CanvasObject
func LoadOverviewWidgets ¶
func LoadOverviewWidgets(w fyne.Window, grid *fyne.Container)
LoadOverviewWidgets loads all OverviewWidgets for each course and adds them to the overviewGrid
func LoadVerificationWidgets ¶
LoadVerificationWidgets loads all attendancies as VerificationWidgets into a container.
func MapBooleans ¶
MapBooleans will map the booleans to be displayed accordingly on the frontend
func OpenImageUpload ¶
func OpenImageUpload(w fyne.Window, optional ...string)
OpenImageUpload opens a customized FileDialog Window with the possibility to pass optional parameters. - Optional[0]=Course Name - Optional[1]=List Date These values will be passed to the function ShowFileDialog to handle the actual file upload.
func OverviewScreen ¶
func OverviewScreen(w fyne.Window) fyne.CanvasObject
func RefreshCourseAttendancy ¶
RefreshCourseAttendancy is responsible for refreshing the course attendancy list as soon as a date and a course has been selected
func RefreshDateDropdown ¶
func RefreshDateDropdown(dateDropdown *widget.SelectEntry, course string)
RefreshDateDropdown is responsible for refreshing the date dropdown as soon as course has been selected
func RefreshSelection ¶
func RefreshSelection(selection *SelectionTracker) string
RefreshSelection is responsible for refreshing the selection text on changes by using the SelectionTracker struct for student and course view
func RefreshStudentAttendancyList ¶
func RefreshStudentAttendancyList(table *fyne.Container, course string, student string, selection *SelectionTracker)
RefreshStudentAttendancyList is responsible for refreshing the attedanceTable list as soon as a course and a student has been selected
func RefreshStudentDropdown ¶
func RefreshStudentDropdown(studentDropdown *widget.SelectEntry, course string)
RefreshStudentDropdown is responsible for refreshing the studentDropdown list as soon as a course has been selected
func ReturnAttendanceTable ¶
ReturnAttendanceTable returns the configured attendanceTable as well the tableHeader for the courses and student view
func ReturnConfirmButton ¶
func ReturnConfirmButton(w fyne.Window, widgetList *fyne.Container, optional []time.Time, course int, courseTable *fyne.Container) *widget.Button
ReturnConfirmButton returns the configured VerificationHeader passing the window,widgetList, optional params []time.Time,courseID and courseTable. These values will be used to update the attendancees when the button gets clicked
func ReturnCourseDropdown ¶
func ReturnCourseDropdown(selectionTracker *SelectionTracker, selection *widget.Label, dependingDropdown *widget.SelectEntry, source string) *widget.Select
ReturnCourseDropdown returns the configured courseDropdown passing the SelectionTracker Struct, selection Label, dependingDropdown and source(course|student) since they will be necessary for change handling for use in course and student view.
func ReturnCourseInsertButton ¶
ReturnCourseInsertButton returns the configured courseInsertButton
func ReturnDateDropdown ¶
func ReturnDateDropdown(dates []string) *widget.SelectEntry
ReturnDateDropdown returns the configured dateDropdown passing the dates list
func ReturnEditDropdown ¶
func ReturnEditDropdown(w fyne.Window, courseDropdown *widget.Select, dateDropdown *widget.SelectEntry, courseTable *fyne.Container) *widget.Select
ReturnEditDropdown returns the configured editDropdown passing the fyne.Window(for redirection),courseDropdown,dateDropdown, courseTable since they will be necessary for change handling.
func ReturnExitButton ¶
ReturnExit returns the configured exitButton to exit the current Page and return to lastView.
func ReturnHeader ¶
ReturnHeader will return the canvas.Text objet of each page
func ReturnMailRefreshContainer ¶
func ReturnMailRefreshContainer(w fyne.Window) *tappableImage
ReturnVerifyImageContainer returns the buttonImageContaier containing the image for insertList Button.
func ReturnNavBar ¶
func ReturnNavBar(setContent func(s yaac_frontend_settings.Setting)) *widget.Tree
ReturnNavBar returns the fully configured navBar tree responsbile for the settingsPage Navigation passing the SetContent funtion
func ReturnNonAttending ¶
func ReturnNonAttending(attendance []yaac_shared.Attendance) []string
ReturnNonAttending extracts the non attending students given a certain list of attendances(List).
func ReturnStudentDropdown ¶
func ReturnStudentDropdown(studentNames []string, student *SelectionTracker, selection *widget.Label, attendanceTable *fyne.Container) *widget.SelectEntry
ReturnStudentDropdown returns the configured studentDropdown passing the studentNames list,selectionTracker,selection label and the attendance Table
func ReturnStudentInsertButton ¶
ReturnStudentInsertButton returns the configured studentInsertButton
func ReturnToPreviousPage ¶
func ReturnToPreviousPage(w fyne.Window, course int, optional []time.Time, courseTable *fyne.Container)
ReturnToPreviousPage executes a command to return to the previousPage passing the window, courseId,optional params []time.Time and courseTable. Depending on the fact if optional params are passed or not the command decides where to navigate to.
func ReturnUpdatedAttendancies ¶
func ReturnUpdatedAttendancies(attendances []bool, list []yaac_shared.AttendanceList) []yaac_shared.Attendance
ReturnUpdatedAttendancies provides UpdateList all updatedAttendancies by using the VerificationWidgets Checkbox values and construting an Attendance object for each.
func ReturnVerificationHeader ¶
func ReturnVerificationHeader() *fyne.Container
ReturnVerificationHeader returns the configured VerificationHeader including navBar extern layout
func ReturnVerifyImageContainer ¶
func ReturnVerifyImageContainer(w fyne.Window) *tappableImage
ReturnVerifyImageContainer returns the buttonImageContaier containing the image for insertList Button.
func RotateImage ¶
RotateImage will rotate images if necessary so they can be displayed vertically
func SettingsScreen ¶
func SettingsScreen(w fyne.Window) fyne.CanvasObject
func ShowFileDialog ¶
Show file selection dialog
func ShowImage ¶
ShowImage will display the currently selected list in a seperate window passing course and date.
func StudentScreen ¶
func StudentScreen(w fyne.Window) fyne.CanvasObject
func UpdateList ¶
UpdateList updates all new attendancies by initializing a AttedanceList Object as soon as the confirmButton gets clicked.
func ValidateCourseInput ¶
ValidateCourseInput will validate the current input regarding the courseEntry on length and syn
func ValidateInput ¶
func ValidateInput(studentEntry *widget.Entry, courseEntry *widget.Entry, confirmButton *widget.Button)
ValidateInput takes the two entries studentEntry, courseEntry as input and decides regarding their validity to enable the ConfirmButton
func VerificationScreen ¶
func VerifyList ¶
VerifyList will redirect the user to the Verification Page passing the currently selected course,date, courseTable
Types ¶
type AttendanceRow ¶
type AttendanceRow struct { widget.BaseWidget // contains filtered or unexported fields }
Declaration of custom AttendanceRow Struct for course and student view
func NewAttendanceRow ¶
func NewAttendanceRow(dateText string, stateText string) *AttendanceRow
func (*AttendanceRow) CreateRenderer ¶
func (item *AttendanceRow) CreateRenderer() fyne.WidgetRenderer
type FrontendMain ¶
func New ¶
func New(mvvm shared.MVVM) *FrontendMain
type OverviewWidget ¶
type OverviewWidget struct { widget.BaseWidget // contains filtered or unexported fields }
Declaration of custom Overwidget Struct
func NewOverviewWidget ¶
func NewOverviewWidget(w fyne.Window, title string, courseId int, nonAttending []string, totalStudents int) *OverviewWidget
func (*OverviewWidget) CreateRenderer ¶
func (item *OverviewWidget) CreateRenderer() fyne.WidgetRenderer
type SelectionTracker ¶
type SelectionTracker struct {
// contains filtered or unexported fields
}
Declaration of SelectionTracker struct this will track the current selections for courses and students
type VerificationWidget ¶
type VerificationWidget struct { widget.BaseWidget // contains filtered or unexported fields }
Delaration of custom VerificationWidget Struct for the verification view
func NewVerificationWidget ¶
func NewVerificationWidget(student string, attendance bool, students []string, attendances []bool) *VerificationWidget
func (*VerificationWidget) CreateRenderer ¶
func (item *VerificationWidget) CreateRenderer() fyne.WidgetRenderer