Integrate templates into bindata optionally (#314)
Integrated optional bindata for the templates
This commit is contained in:
parent
1b5b297c39
commit
83ed234472
15 changed files with 274 additions and 107 deletions
|
@ -11,12 +11,12 @@ import (
|
|||
"code.gitea.io/git"
|
||||
"code.gitea.io/gitea/models"
|
||||
"code.gitea.io/gitea/modules/cron"
|
||||
"code.gitea.io/gitea/modules/highlight"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/mailer"
|
||||
"code.gitea.io/gitea/modules/markdown"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/ssh"
|
||||
"code.gitea.io/gitea/modules/template/highlight"
|
||||
macaron "gopkg.in/macaron.v1"
|
||||
)
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/template"
|
||||
"code.gitea.io/gitea/modules/templates"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -74,7 +74,7 @@ func editFile(ctx *context.Context, isNewFile bool) {
|
|||
|
||||
d, _ := ioutil.ReadAll(dataRc)
|
||||
buf = append(buf, d...)
|
||||
if content, err := template.ToUTF8WithErr(buf); err != nil {
|
||||
if content, err := templates.ToUTF8WithErr(buf); err != nil {
|
||||
if err != nil {
|
||||
log.Error(4, "ToUTF8WithErr: %v", err)
|
||||
}
|
||||
|
|
|
@ -16,11 +16,11 @@ import (
|
|||
"code.gitea.io/gitea/models"
|
||||
"code.gitea.io/gitea/modules/base"
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/modules/highlight"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/markdown"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/template"
|
||||
"code.gitea.io/gitea/modules/template/highlight"
|
||||
"code.gitea.io/gitea/modules/templates"
|
||||
"github.com/Unknwon/paginater"
|
||||
)
|
||||
|
||||
|
@ -164,7 +164,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
|
|||
} else {
|
||||
// Building code view blocks with line number on server side.
|
||||
var fileContent string
|
||||
if content, err := template.ToUTF8WithErr(buf); err != nil {
|
||||
if content, err := templates.ToUTF8WithErr(buf); err != nil {
|
||||
if err != nil {
|
||||
log.Error(4, "ToUTF8WithErr: %s", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue