Documentation ¶
Index ¶
- Constants
- type BaseController
- type BaseView
- func (v BaseView) FormatDailySummary(daily *timesheet.DailySummary) Values
- func (v BaseView) FormatDurationInHours(d time.Duration) string
- func (v BaseView) FormatFloat(value float64, precision int) string
- func (v BaseView) GetNextMonth(year, month int) (int, int)
- func (v BaseView) GetPreviousMonth(year, month int) (int, int)
- func (v BaseView) OvertimeClassname(duration time.Duration) string
- func (v BaseView) OvertimeClassnameThreshold(duration time.Duration, dailyMax time.Duration) string
- type Renderer
- type SessionData
- type Values
Constants ¶
const HRManagerRoleKey = "HRManager"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseController ¶ added in v0.10.0
type BaseView ¶ added in v0.10.0
type BaseView struct { }
BaseView contains some utility methods.
func (BaseView) FormatDailySummary ¶ added in v1.0.0
func (v BaseView) FormatDailySummary(daily *timesheet.DailySummary) Values
FormatDailySummary returns Values with sensible format.
func (BaseView) FormatDurationInHours ¶ added in v0.10.0
FormatDurationInHours returns a human friendly "0:00"-formatted duration. Seconds within a minute are rounded up or down to the nearest full minute. A sign ("-") is prefixed if duration is negative.
func (BaseView) FormatFloat ¶ added in v0.10.0
FormatFloat returns a string of the given float with desired digits after comma.
func (BaseView) GetNextMonth ¶ added in v0.10.0
GetNextMonth returns the numerical next month of the given input (month 1-12) The year is increased if month is >= 12.
func (BaseView) GetPreviousMonth ¶ added in v0.10.0
GetPreviousMonth returns the numerical previous month of the given input (month 1-12) The year is decreased if month is <= 1.
func (BaseView) OvertimeClassname ¶ added in v1.7.0
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer is able to render HTML templates. Templates will be compiled the first time they are requested, and cached thereafter.
type SessionData ¶ added in v0.9.0
type SessionData struct { Employee *model.Employee `json:"employee"` Roles []string `json:"roles"` }
SessionData is an additional data struct. Its purpose is to store data in a session cookie in order to avoid repetitive Odoo API calls.