1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

refactor: redesign login page

refactor: redesign signup page
refactor: redesign summary page
This commit is contained in:
Ferdinand Mütsch
2021-12-15 22:46:02 +01:00
parent ee501ca3c5
commit 44a2e609fb
19 changed files with 562 additions and 458 deletions

View File

@ -55,8 +55,6 @@ type SummaryViewModel struct {
User *User
AvatarURL string
LanguageColors map[string]string
EditorColors map[string]string
OSColors map[string]string
Error string
Success string
ApiKey string
@ -225,6 +223,27 @@ func (s *Summary) TotalTimeByFilters(filters *Filters) time.Duration {
return 0
}
func (s *Summary) MaxBy(entityType uint8) *SummaryItem {
var max *SummaryItem
mappedItems := s.MappedItems()
if items := mappedItems[entityType]; len(*items) > 0 {
for _, item := range *items {
if max == nil || item.Total > max.Total {
max = item
}
}
}
return max
}
func (s *Summary) MaxByToString(entityType uint8) string {
max := s.MaxBy(entityType)
if max == nil {
return "-"
}
return max.Key
}
func (s *Summary) WithResolvedAliases(resolve AliasResolver) *Summary {
processAliases := func(origin []*SummaryItem) []*SummaryItem {
target := make([]*SummaryItem, 0)