view

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLanguageIcon

func GetLanguageIcon(language string) string

Types

type BasicViewModel

type BasicViewModel interface {
	SetError(string)
	SetSuccess(string)
}

type HomeViewModel

type HomeViewModel struct {
	SharedViewModel
	TotalHours int
	TotalUsers int
	Newsbox    *Newsbox
}

func (*HomeViewModel) WithError

func (s *HomeViewModel) WithError(m string) *HomeViewModel

func (*HomeViewModel) WithSuccess

func (s *HomeViewModel) WithSuccess(m string) *HomeViewModel

type ImprintViewModel

type ImprintViewModel struct {
	SharedViewModel
	HtmlText string
}

func (*ImprintViewModel) WithError

func (s *ImprintViewModel) WithError(m string) *ImprintViewModel

func (*ImprintViewModel) WithHtmlText

func (s *ImprintViewModel) WithHtmlText(t string) *ImprintViewModel

func (*ImprintViewModel) WithSuccess

func (s *ImprintViewModel) WithSuccess(m string) *ImprintViewModel

type LeaderboardViewModel

type LeaderboardViewModel struct {
	SharedLoggedInViewModel
	By            string
	Key           string
	Items         []*models.LeaderboardItemRanked
	TopKeys       []string
	UserLanguages map[string][]string
	IntervalLabel string
	PageParams    *utils.PageParams
}

func (*LeaderboardViewModel) ColorModifier

func (s *LeaderboardViewModel) ColorModifier(item *models.LeaderboardItemRanked, principal *models.User) string

func (*LeaderboardViewModel) LangIcon

func (s *LeaderboardViewModel) LangIcon(lang string) string

func (*LeaderboardViewModel) LastUpdate

func (s *LeaderboardViewModel) LastUpdate() time.Time

func (*LeaderboardViewModel) WithError

func (*LeaderboardViewModel) WithSuccess

type LoginViewModel

type LoginViewModel struct {
	SharedViewModel
	TotalUsers  int
	AllowSignup bool
	CaptchaId   string
	InviteCode  string
}

func (*LoginViewModel) WithError

func (s *LoginViewModel) WithError(m string) *LoginViewModel

func (*LoginViewModel) WithSuccess

func (s *LoginViewModel) WithSuccess(m string) *LoginViewModel

type Messages

type Messages struct {
	Success string
	Error   string
}

func (*Messages) SetError

func (m *Messages) SetError(message string)

func (*Messages) SetSuccess

func (m *Messages) SetSuccess(message string)

type Newsbox

type Newsbox struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

type ProjectsViewModel

type ProjectsViewModel struct {
	SharedLoggedInViewModel
	Projects   []*models.ProjectStats
	PageParams *utils.PageParams
	// contains filtered or unexported fields
}

func (*ProjectsViewModel) BackgroundIntensity

func (s *ProjectsViewModel) BackgroundIntensity(idx int) string

func (*ProjectsViewModel) LangIcon

func (s *ProjectsViewModel) LangIcon(lang string) string

func (*ProjectsViewModel) WithError

func (s *ProjectsViewModel) WithError(m string) *ProjectsViewModel

func (*ProjectsViewModel) WithSuccess

func (s *ProjectsViewModel) WithSuccess(m string) *ProjectsViewModel

type SetPasswordViewModel

type SetPasswordViewModel struct {
	LoginViewModel
	Token string
}

type SettingsVMCombinedAlias

type SettingsVMCombinedAlias struct {
	Key    string
	Type   uint8
	Values []string
}

type SettingsVMCombinedLabel

type SettingsVMCombinedLabel struct {
	Key    string
	Values []string
}

type SettingsViewModel

type SettingsViewModel struct {
	SharedLoggedInViewModel
	LanguageMappings    []*models.LanguageMapping
	Aliases             []*SettingsVMCombinedAlias
	Labels              []*SettingsVMCombinedLabel
	Projects            []string
	SubscriptionPrice   string
	DataRetentionMonths int
	UserFirstData       time.Time
	SupportContact      string
	InviteLink          string
}

func (*SettingsViewModel) SubscriptionsEnabled

func (s *SettingsViewModel) SubscriptionsEnabled() bool

func (*SettingsViewModel) WithError

func (s *SettingsViewModel) WithError(m string) *SettingsViewModel

func (*SettingsViewModel) WithSuccess

func (s *SettingsViewModel) WithSuccess(m string) *SettingsViewModel

type SharedLoggedInViewModel

type SharedLoggedInViewModel struct {
	SharedViewModel
	User   *models.User
	ApiKey string
}

type SharedViewModel

type SharedViewModel struct {
	Messages
	LeaderboardEnabled bool
	ShopEnabled        bool
	InvitesEnabled     bool
}

func NewSharedViewModel

func NewSharedViewModel(c *conf.Config, messages *Messages) SharedViewModel

type ShopViewModel added in v0.1.7

type ShopViewModel struct {
	SharedLoggedInViewModel
	Products   []*models.Product
	PageParams *utils.PageParams
}

func (*ShopViewModel) LangIcon added in v0.1.7

func (s *ShopViewModel) LangIcon(lang string) string

func (*ShopViewModel) WithError added in v0.1.7

func (s *ShopViewModel) WithError(m string) *ShopViewModel

func (*ShopViewModel) WithSuccess added in v0.1.7

func (s *ShopViewModel) WithSuccess(m string) *ShopViewModel

type SummaryViewModel

type SummaryViewModel struct {
	SharedLoggedInViewModel
	*models.Summary
	*models.SummaryParams
	AvatarURL           string
	EditorColors        map[string]string
	LanguageColors      map[string]string
	OSColors            map[string]string
	RawQuery            string
	UserFirstData       time.Time
	DataRetentionMonths int
}

func (SummaryViewModel) UserDataExpiring

func (s SummaryViewModel) UserDataExpiring() bool

func (*SummaryViewModel) WithError

func (s *SummaryViewModel) WithError(m string) *SummaryViewModel

func (*SummaryViewModel) WithSuccess

func (s *SummaryViewModel) WithSuccess(m string) *SummaryViewModel

Jump to

Keyboard shortcuts

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