Этот коммит содержится в:
=Corey Hulen
2016-03-14 16:07:58 -07:00
родитель ea3f25924e
Коммит 36b17bf99d
36 изменённых файлов: 1791 добавлений и 211 удалений

Просмотреть файл

@@ -238,5 +238,7 @@ func getClientConfig(c *model.Config) map[string]string {
props["AllowCorsFrom"] = *c.ServiceSettings.AllowCorsFrom
props["EnableCompliance"] = strconv.FormatBool(*c.ComplianceSettings.Enable)
return props
}

Просмотреть файл

@@ -23,7 +23,16 @@ type HTMLTemplate struct {
}
func InitHTML() {
templatesDir := FindDir("templates")
InitHTMLWithDir("templates")
}
func InitHTMLWithDir(dir string) {
if htmlTemplates != nil {
return
}
templatesDir := FindDir(dir)
l4g.Debug(T("api.api.init.parsing_templates.debug"), templatesDir)
var err error
if htmlTemplates, err = template.ParseGlob(templatesDir + "*.html"); err != nil {

Просмотреть файл

@@ -16,7 +16,11 @@ var T i18n.TranslateFunc
var locales map[string]string = make(map[string]string)
func InitTranslations() {
i18nDirectory := FindDir("i18n")
InitTranslationsWithDir("i18n")
}
func InitTranslationsWithDir(dir string) {
i18nDirectory := FindDir(dir)
files, _ := ioutil.ReadDir(i18nDirectory)
for _, f := range files {
if filepath.Ext(f.Name()) == ".json" {

Просмотреть файл

@@ -115,6 +115,7 @@ func getClientLicense(l *model.License) map[string]string {
props["Users"] = strconv.Itoa(*l.Features.Users)
props["LDAP"] = strconv.FormatBool(*l.Features.LDAP)
props["GoogleSSO"] = strconv.FormatBool(*l.Features.GoogleSSO)
props["Compliance"] = strconv.FormatBool(*l.Features.Compliance)
props["IssuedAt"] = strconv.FormatInt(l.IssuedAt, 10)
props["StartsAt"] = strconv.FormatInt(l.StartsAt, 10)
props["ExpiresAt"] = strconv.FormatInt(l.ExpiresAt, 10)