Some minor changes

This commit is contained in:
Unknwon 2016-03-06 16:40:04 -05:00
parent 12b5a76b0d
commit 58f0c68151
6 changed files with 90 additions and 107 deletions

View file

@ -1,6 +1,5 @@
[run] [run]
init_cmds = [ init_cmds = [
#["grep", "-rn", "FIXME", "."],
["make", "build-dev", "TAGS=sqlite"], ["make", "build-dev", "TAGS=sqlite"],
["./gogs", "web"] ["./gogs", "web"]
] ]

21
.gitignore vendored
View file

@ -8,31 +8,12 @@ data/
.idea/ .idea/
*.iml *.iml
public/img/avatar/ public/img/avatar/
files/
*.o
*.a
*.so
_obj
_test
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe *.exe
*.exe~ *.exe~
/gogs /gogs
profile/ profile/
__pycache__
*.pem *.pem
output* output*
.brackets.json
docker/fig.yml
docker/docker/Dockerfile
docker/docker/init_gogs.sh
gogs.sublime-project gogs.sublime-project
gogs.sublime-workspace gogs.sublime-workspace
.tags* /release
release

View file

@ -53,3 +53,9 @@ clean-mac: clean
test: test:
go test -cover -race ./... go test -cover -race ./...
fixme:
grep -rnw "FIXME" routers models modules
todo:
grep -rnw "TODO" routers models modules

View file

@ -7,7 +7,6 @@ package cmd
import ( import (
"crypto/tls" "crypto/tls"
"fmt" "fmt"
gotmpl "html/template"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/http/fcgi" "net/http/fcgi"
@ -126,7 +125,7 @@ func newMacaron() *macaron.Macaron {
)) ))
m.Use(macaron.Renderer(macaron.RenderOptions{ m.Use(macaron.Renderer(macaron.RenderOptions{
Directory: path.Join(setting.StaticRootPath, "templates"), Directory: path.Join(setting.StaticRootPath, "templates"),
Funcs: []gotmpl.FuncMap{template.Funcs}, Funcs: template.NewFuncMap(),
IndentJSON: macaron.Env != macaron.PROD, IndentJSON: macaron.Env != macaron.PROD,
})) }))

View file

@ -1,7 +1,3 @@
Execute following command in ROOT directory when anything is changed: Execute following command in ROOT directory when anything is changed:
$ go-bindata -o=modules/bindata/bindata.go -ignore="\\.DS_Store|README.md" -pkg=bindata conf/... $ make bindata
Add -debug flag to make life easier in development(somehow isn't working):
$ go-bindata -debug -o=modules/bindata/bindata.go -ignore="\\.DS_Store|README.md" -pkg=bindata conf/...

View file

@ -22,7 +22,8 @@ import (
"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )
var Funcs template.FuncMap = map[string]interface{}{ func NewFuncMap() []template.FuncMap {
return []template.FuncMap{map[string]interface{}{
"GoVer": func() string { "GoVer": func() string {
return strings.Title(runtime.Version()) return strings.Title(runtime.Version())
}, },
@ -102,6 +103,7 @@ var Funcs template.FuncMap = map[string]interface{}{
"ThemeColorMetaTag": func() string { "ThemeColorMetaTag": func() string {
return setting.ThemeColorMetaTag return setting.ThemeColorMetaTag
}, },
}}
} }
func Safe(raw string) template.HTML { func Safe(raw string) template.HTML {