aboutsummaryrefslogtreecommitdiffstats
path: root/modules/options
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2016-12-23 15:18:05 +0800
committerGitHub <noreply@github.com>2016-12-23 15:18:05 +0800
commita822bba3e1a598bf17a17d1d03cf7f1544b6de42 (patch)
tree5162b8c697e794abe21a24643b77dcb05839bf91 /modules/options
parentec1fe1183d78b64d6687226fa59c7107f7a07940 (diff)
downloadgitea-a822bba3e1a598bf17a17d1d03cf7f1544b6de42.tar.gz
gitea-a822bba3e1a598bf17a17d1d03cf7f1544b6de42.zip
Add default values for settings (#455)
* add default values for settings * more default values * more default settings and labels resource * mv locale to options
Diffstat (limited to 'modules/options')
-rw-r--r--modules/options/dynamic.go5
-rw-r--r--modules/options/static.go5
2 files changed, 10 insertions, 0 deletions
diff --git a/modules/options/dynamic.go b/modules/options/dynamic.go
index 28ed70c07d..f5235741d1 100644
--- a/modules/options/dynamic.go
+++ b/modules/options/dynamic.go
@@ -76,6 +76,11 @@ func License(name string) ([]byte, error) {
return fileFromDir(path.Join("license", name))
}
+// Labels eads the content of a specific labels from static or custom path.
+func Labels(name string) ([]byte, error) {
+ return fileFromDir(path.Join("label", name))
+}
+
// fileFromDir is a helper to read files from static or custom path.
func fileFromDir(name string) ([]byte, error) {
customPath := path.Join(setting.CustomPath, "options", name)
diff --git a/modules/options/static.go b/modules/options/static.go
index da97afb5f3..d98253f875 100644
--- a/modules/options/static.go
+++ b/modules/options/static.go
@@ -72,6 +72,11 @@ func License(name string) ([]byte, error) {
return fileFromDir(path.Join("license", name))
}
+// Labels eads the content of a specific labels from static or custom path.
+func Labels(name string) ([]byte, error) {
+ return fileFromDir(path.Join("label", name))
+}
+
// fileFromDir is a helper to read files from bindata or custom path.
func fileFromDir(name string) ([]byte, error) {
customPath := path.Join(setting.CustomPath, "options", name)