[en-US] feat: Update DATAWARE Forge themes - Set "dataware-light" as the default theme by updating DefaultTheme in modules/setting/ui.go. - Expanded the theme list to include new entries: "dataware-light2", "dataware-dark2", "dataware-dark2-deuteranopia-protanopia", and "dataware-dark2-tritanopia". - Added new theme files: • theme-dataware-dark2.css – A new optimized dark theme. • theme-dataware-dark2-deuteranopia-protanopia.css – Color adjustments for deuteranopia/protanopia in the dark2 theme. • theme-dataware-dark2-tritanopia.css – Color adjustments for tritanopia in the dark2 theme. • theme-dataware-light2.css – A new optimized light theme. - Standardized formatting changes (spacing, margins) in CSS modules (e.g., divider.css, header.css). - Redefined the color palette to align with the DATAWARE Forge visual identity, ensuring consistency and improved accessibility. These changes expand visual options and optimize the user experience for various color vision needs. [pt-BR] feat: Atualização dos temas DATAWARE Forge - Alterado o DefaultTheme para "dataware-light", definindo o tema light como padrão. - Atualizada a lista de temas para incluir os novos: "dataware-light2", "dataware-dark2", "dataware-dark2-deuteranopia-protanopia" e "dataware-dark2-tritanopia". - Adicionados novos arquivos de tema: • theme-dataware-dark2.css – Novo tema dark otimizado. • theme-dataware-dark2-deuteranopia-protanopia.css – Ajustes de cores para deuteranopia/protanopia no tema dark2. • theme-dataware-dark2-tritanopia.css – Ajustes de cores para tritanopia no tema dark2. • theme-dataware-light2.css – Novo tema light otimizado. - Padronizadas alterações de formatação (espaçamento, margens) em módulos CSS (ex.: divider.css, header.css). - Reconfigurada a paleta de cores para alinhar com a identidade DATAWARE Forge, garantindo consistência visual e melhor acessibilidade. Essas alterações ampliam as opções visuais e otimizam a experiência para diferentes necessidades de percepção de cores. Marcos A. Lucas <mlucas@dataware.com.br>
170 lines
5.5 KiB
Go
170 lines
5.5 KiB
Go
// Copyright 2023 The Gitea Authors. All rights reserved.
|
||
// SPDX-License-Identifier: MIT
|
||
|
||
package setting
|
||
|
||
import (
|
||
"time"
|
||
|
||
"code.gitea.io/gitea/modules/container"
|
||
"code.gitea.io/gitea/modules/log"
|
||
)
|
||
|
||
// UI settings
|
||
var UI = struct {
|
||
ExplorePagingNum int
|
||
SitemapPagingNum int
|
||
IssuePagingNum int
|
||
RepoSearchPagingNum int
|
||
MembersPagingNum int
|
||
FeedMaxCommitNum int
|
||
FeedPagingNum int
|
||
PackagesPagingNum int
|
||
GraphMaxCommitNum int
|
||
CodeCommentLines int
|
||
ReactionMaxUserNum int
|
||
MaxDisplayFileSize int64
|
||
ShowUserEmail bool
|
||
DefaultShowFullName bool
|
||
DefaultTheme string
|
||
Themes []string
|
||
Reactions []string
|
||
ReactionsLookup container.Set[string] `ini:"-"`
|
||
CustomEmojis []string
|
||
CustomEmojisMap map[string]string `ini:"-"`
|
||
SearchRepoDescription bool
|
||
OnlyShowRelevantRepos bool
|
||
ExploreDefaultSort string `ini:"EXPLORE_PAGING_DEFAULT_SORT"`
|
||
PreferredTimestampTense string
|
||
|
||
AmbiguousUnicodeDetection bool
|
||
SkipEscapeContexts []string
|
||
|
||
Notification struct {
|
||
MinTimeout time.Duration
|
||
TimeoutStep time.Duration
|
||
MaxTimeout time.Duration
|
||
EventSourceUpdateTime time.Duration
|
||
} `ini:"ui.notification"`
|
||
|
||
SVG struct {
|
||
Enabled bool `ini:"ENABLE_RENDER"`
|
||
} `ini:"ui.svg"`
|
||
|
||
CSV struct {
|
||
MaxFileSize int64
|
||
MaxRows int
|
||
} `ini:"ui.csv"`
|
||
|
||
Admin struct {
|
||
UserPagingNum int
|
||
RepoPagingNum int
|
||
NoticePagingNum int
|
||
OrgPagingNum int
|
||
} `ini:"ui.admin"`
|
||
User struct {
|
||
RepoPagingNum int
|
||
} `ini:"ui.user"`
|
||
Meta struct {
|
||
Author string
|
||
Description string
|
||
Keywords string
|
||
} `ini:"ui.meta"`
|
||
}{
|
||
ExplorePagingNum: 20,
|
||
SitemapPagingNum: 20,
|
||
IssuePagingNum: 20,
|
||
RepoSearchPagingNum: 20,
|
||
MembersPagingNum: 20,
|
||
FeedMaxCommitNum: 5,
|
||
FeedPagingNum: 20,
|
||
PackagesPagingNum: 20,
|
||
GraphMaxCommitNum: 100,
|
||
CodeCommentLines: 4,
|
||
ReactionMaxUserNum: 10,
|
||
MaxDisplayFileSize: 8388608,
|
||
DefaultTheme: `dataware-light`,
|
||
Themes: []string{`dataware-auto`, `dataware-light`, `dataware-light2`, `dataware-dark`, `dataware-dark2`, `dataware-auto-deuteranopia-protanopia`, `dataware-light-deuteranopia-protanopia`, `dataware-dark-deuteranopia-protanopia`, `dataware-dark2-deuteranopia-protanopia`, `dataware-auto-tritanopia`, `dataware-light-tritanopia`, `dataware-dark-tritanopia`, `dataware-dark2-tritanopia`, `forgejo-auto`, `forgejo-light`, `forgejo-dark`, `gitea-auto`, `gitea-light`, `gitea-dark`, `forgejo-auto-deuteranopia-protanopia`, `forgejo-light-deuteranopia-protanopia`, `forgejo-dark-deuteranopia-protanopia`, `forgejo-auto-tritanopia`, `forgejo-light-tritanopia`, `forgejo-dark-tritanopia`},
|
||
Reactions: []string{`+1`, `-1`, `laugh`, `hooray`, `confused`, `heart`, `rocket`, `eyes`},
|
||
CustomEmojis: []string{`git`, `gitea`, `codeberg`, `gitlab`, `github`, `gogs`, `forgejo`},
|
||
CustomEmojisMap: map[string]string{"git": ":git:", "gitea": ":gitea:", "codeberg": ":codeberg:", "gitlab": ":gitlab:", "github": ":github:", "gogs": ":gogs:", "forgejo": ":forgejo:"},
|
||
ExploreDefaultSort: "recentupdate",
|
||
PreferredTimestampTense: "mixed",
|
||
|
||
AmbiguousUnicodeDetection: true,
|
||
SkipEscapeContexts: []string{},
|
||
|
||
Notification: struct {
|
||
MinTimeout time.Duration
|
||
TimeoutStep time.Duration
|
||
MaxTimeout time.Duration
|
||
EventSourceUpdateTime time.Duration
|
||
}{
|
||
MinTimeout: 10 * time.Second,
|
||
TimeoutStep: 10 * time.Second,
|
||
MaxTimeout: 60 * time.Second,
|
||
EventSourceUpdateTime: 10 * time.Second,
|
||
},
|
||
SVG: struct {
|
||
Enabled bool `ini:"ENABLE_RENDER"`
|
||
}{
|
||
Enabled: true,
|
||
},
|
||
CSV: struct {
|
||
MaxFileSize int64
|
||
MaxRows int
|
||
}{
|
||
MaxFileSize: 524288,
|
||
MaxRows: 2500,
|
||
},
|
||
Admin: struct {
|
||
UserPagingNum int
|
||
RepoPagingNum int
|
||
NoticePagingNum int
|
||
OrgPagingNum int
|
||
}{
|
||
UserPagingNum: 50,
|
||
RepoPagingNum: 50,
|
||
NoticePagingNum: 25,
|
||
OrgPagingNum: 50,
|
||
},
|
||
User: struct {
|
||
RepoPagingNum int
|
||
}{
|
||
RepoPagingNum: 15,
|
||
},
|
||
Meta: struct {
|
||
Author string
|
||
Description string
|
||
Keywords string
|
||
}{
|
||
Author: "DATAWARE Forge – More than code, a forge of solutions.",
|
||
Description: "DATAWARE Forge is a self-hosted tool for software forge, where innovation meets collaboration. Code, management, evolution. All forged together. Your code evolves here.",
|
||
Keywords: "git,forge,dataware,datawareforge",
|
||
},
|
||
}
|
||
|
||
func loadUIFrom(rootCfg ConfigProvider) {
|
||
mustMapSetting(rootCfg, "ui", &UI)
|
||
sec := rootCfg.Section("ui")
|
||
UI.ShowUserEmail = sec.Key("SHOW_USER_EMAIL").MustBool(true)
|
||
UI.DefaultShowFullName = sec.Key("DEFAULT_SHOW_FULL_NAME").MustBool(false)
|
||
UI.SearchRepoDescription = sec.Key("SEARCH_REPO_DESCRIPTION").MustBool(true)
|
||
|
||
if UI.PreferredTimestampTense != "mixed" && UI.PreferredTimestampTense != "absolute" {
|
||
log.Fatal("ui.PREFERRED_TIMESTAMP_TENSE must be either 'mixed' or 'absolute'")
|
||
}
|
||
|
||
// OnlyShowRelevantRepos=false is important for many private/enterprise instances,
|
||
// because many private repositories do not have "description/topic", users just want to search by their names.
|
||
UI.OnlyShowRelevantRepos = sec.Key("ONLY_SHOW_RELEVANT_REPOS").MustBool(false)
|
||
|
||
UI.ReactionsLookup = make(container.Set[string])
|
||
for _, reaction := range UI.Reactions {
|
||
UI.ReactionsLookup.Add(reaction)
|
||
}
|
||
UI.CustomEmojisMap = make(map[string]string)
|
||
for _, emoji := range UI.CustomEmojis {
|
||
UI.CustomEmojisMap[emoji] = ":" + emoji + ":"
|
||
}
|
||
}
|