yaac_frontend_pages

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const DATE_FORMAT = "2006-01-02"

Variables

View Source
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

func AskCreateCourse(w fyne.Window, img []byte, courseName string, optional ...string)

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

func GetAttendancies(course int, date time.Time) ([]string, []bool)

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

func GetImageByDate(title string, date time.Time) []byte

GetImageByDate requests the latest list regarding a defined date from the dataset

func InsertList

func InsertList(w fyne.Window, img []byte, courseName string, optional ...string)

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 LoadImage

func LoadImage(w fyne.Window, f fyne.URIReadCloser) []byte

Read file from fs

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

func LoadVerificationWidgets(course int, date time.Time) *fyne.Container

LoadVerificationWidgets loads all attendancies as VerificationWidgets into a container.

func MapBooleans

func MapBooleans(b bool) string

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

func RefreshCourseAttendancy(table *fyne.Container, course string, date string)

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

func ReturnAttendanceTable(header1 string, header2 string) (*fyne.Container, *fyne.Container)

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

func ReturnCourseInsertButton(w fyne.Window) *widget.Button

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

func ReturnExitButton(w fyne.Window) *widget.Button

ReturnExit returns the configured exitButton to exit the current Page and return to lastView.

func ReturnHeader

func ReturnHeader(pageTitle string) *canvas.Text

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

func ReturnStudentInsertButton(w fyne.Window) *widget.Button

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

func RotateImage(img []byte) *canvas.Image

RotateImage will rotate images if necessary so they can be displayed vertically

func SettingsScreen

func SettingsScreen(w fyne.Window) fyne.CanvasObject

func ShowFileDialog

func ShowFileDialog(w fyne.Window, courseName string, optional ...string)

Show file selection dialog

func ShowImage

func ShowImage(w fyne.Window, course string, date string)

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

func UpdateList(w fyne.Window, attendances []bool, course int, date time.Time)

UpdateList updates all new attendancies by initializing a AttedanceList Object as soon as the confirmButton gets clicked.

func ValidateCourseInput

func ValidateCourseInput(courseEntry *widget.Entry, fileUpload *widget.Button)

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 VerificationScreen(w fyne.Window, img []byte, course int, courseTable *fyne.Container, optional ...time.Time) fyne.CanvasObject

func VerifyList

func VerifyList(w fyne.Window, course string, date string, courseTable *fyne.Container)

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

type FrontendMain struct {
	MVVM shared.MVVM
}

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 Page

type Page struct {
	Title      string
	View       func(w fyne.Window) fyne.CanvasObject
	SupportWeb bool
}

Defines the Page struct which will hold each Pages properties

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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