summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-05-28 06:06:31 +0200
committerUnknown <joe2010xtmf@163.com>2014-05-28 06:06:31 +0200
commitff690fd9760e0cfb5ae9e49aecb7a201f7ca8304 (patch)
tree3e601c42e1fc8ff50df02bf04fb48680a031123e
parentMerge pull request #210 from brunoqc/typo (diff)
downloadforgejo-ff690fd9760e0cfb5ae9e49aecb7a201f7ca8304.tar.xz
forgejo-ff690fd9760e0cfb5ae9e49aecb7a201f7ca8304.zip
Fix #200, add VERSION to template files
-rw-r--r--.gopmfile5
-rw-r--r--cmd/web.go9
-rw-r--r--conf/README.md7
-rw-r--r--modules/bin/conf.go12
-rw-r--r--routers/repo/issue.go5
-rw-r--r--templates/VERSION (renamed from conf/VERSION)0
-rw-r--r--templates/issue/list.tmpl7
7 files changed, 24 insertions, 21 deletions
diff --git a/.gopmfile b/.gopmfile
index c58f4299d4..35f40b3943 100644
--- a/.gopmfile
+++ b/.gopmfile
@@ -8,6 +8,7 @@ github.com/Unknwon/goconfig =
github.com/codegangsta/cli =
github.com/go-martini/martini =
github.com/go-sql-driver/mysql =
+github.com/go-xorm/core =
github.com/go-xorm/xorm =
github.com/gogits/cache =
github.com/gogits/gfm =
@@ -15,12 +16,12 @@ github.com/gogits/git =
github.com/gogits/logs =
github.com/gogits/oauth2 =
github.com/gogits/session =
+github.com/juju2013/goldap =
github.com/lib/pq =
github.com/nfnt/resize =
github.com/qiniu/log =
github.com/robfig/cron =
-github.com/juju2013/goldap =
[res]
-include = templates|public|conf
+include = templates|public
diff --git a/cmd/web.go b/cmd/web.go
index f4b31dcd5d..d8d9785f35 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -7,6 +7,7 @@ package cmd
import (
"fmt"
"html/template"
+ "io/ioutil"
"net/http"
"os"
"path"
@@ -18,7 +19,6 @@ import (
"github.com/gogits/gogs/modules/auth/apiv1"
"github.com/gogits/gogs/modules/avatar"
"github.com/gogits/gogs/modules/base"
- "github.com/gogits/gogs/modules/bin"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/middleware"
"github.com/gogits/gogs/modules/middleware/binding"
@@ -40,12 +40,11 @@ and it takes care of all the other things for you`,
Flags: []cli.Flag{},
}
+// checkVersion checks if binary matches the version of temolate files.
func checkVersion() {
- // go-bindata -ignore=\\.DS_Store -o modules/bin/conf.go -pkg="bin" conf/...
- // Check if binary and static file version match.
- data, err := bin.Asset("conf/VERSION")
+ data, err := ioutil.ReadFile(path.Join(setting.StaticRootPath, "templates/VERSION"))
if err != nil {
- log.Fatal("Fail to read 'conf/VERSION': %v", err)
+ log.Fatal("Fail to read 'templates/VERSION': %v", err)
}
if string(data) != setting.AppVer {
log.Fatal("Binary and static file version does not match, did you forget to recompile?")
diff --git a/conf/README.md b/conf/README.md
new file mode 100644
index 0000000000..96e0eb2210
--- /dev/null
+++ b/conf/README.md
@@ -0,0 +1,7 @@
+## NOTICE
+
+This directory only used for development, and us [go-bindata](https://github.com/jteeuwen/go-bindata) to store in memory for releases.
+
+To apply any change in this directory, install [go-bindata](https://github.com/jteeuwen/go-bindata), and then execute following command in root of source directory:
+
+ $ go-bindata -ignore="\\.DS_Store|README.md" -o modules/bin/conf.go -pkg="bin" conf/... \ No newline at end of file
diff --git a/modules/bin/conf.go b/modules/bin/conf.go
index 17af830a7f..6779f18fd6 100644
--- a/modules/bin/conf.go
+++ b/modules/bin/conf.go
@@ -3562,17 +3562,6 @@ func conf_supervisor_ini() ([]byte, error) {
)
}
-func conf_version() ([]byte, error) {
- return bindata_read([]byte{
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x00, 0xff, 0x32, 0xd0,
- 0x33, 0xd6, 0x33, 0xd3, 0x33, 0x30, 0x35, 0x32, 0x55, 0x70, 0xcc, 0x29,
- 0xc8, 0x48, 0x04, 0x04, 0x00, 0x00, 0xff, 0xff, 0x57, 0x04, 0x8d, 0x28,
- 0x10, 0x00, 0x00, 0x00,
- },
- "conf/VERSION",
- )
-}
-
// Asset loads and returns the asset for the given name.
// It returns an error if the asset could not be found or
@@ -3616,5 +3605,4 @@ var _bindata = map[string] func() ([]byte, error) {
"conf/license/MIT License": conf_license_mit_license,
"conf/mysql.sql": conf_mysql_sql,
"conf/supervisor.ini": conf_supervisor_ini,
- "conf/VERSION": conf_version,
}
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index d09a239638..808fb52b41 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -95,6 +95,11 @@ func Issues(ctx *middleware.Context) {
// Get posters.
for i := range issues {
+ if err = issues[i].GetLabels(); err != nil {
+ ctx.Handle(500, "issue.Issues(GetLabels)", fmt.Errorf("[#%d]%v", issues[i].Id, err))
+ return
+ }
+
idx := models.PairsContains(pairs, issues[i].Id)
if filterMode == models.FM_MENTION && (idx == -1 || !pairs[idx].IsMentioned) {
diff --git a/conf/VERSION b/templates/VERSION
index c07dee8283..c07dee8283 100644
--- a/conf/VERSION
+++ b/templates/VERSION
diff --git a/templates/issue/list.tmpl b/templates/issue/list.tmpl
index aac27943f3..0fae3eb663 100644
--- a/templates/issue/list.tmpl
+++ b/templates/issue/list.tmpl
@@ -71,9 +71,12 @@
{{range .Issues}}{{if .Poster}}
<div class="list-group-item issue-item{{if not .IsRead}} unread{{end}}" id="issue-{{.Id}}">
<span class="number pull-right">#{{.Index}}</span>
- <h5 class="title"><a href="{{$.RepoLink}}/issues/{{.Index}}">{{.Name}}</a>
+ <h5 class="title">
+ <a href="{{$.RepoLink}}/issues/{{.Index}}">{{.Name}}</a>
<span class="labels">
- <span class="label" style="background-color: #28a1c5">tag</span>
+ {{range .Labels}}
+ <span class="label" style="background-color: {{.Color}}">{{.Name}}</span>
+ {{end}}
</span>
</h5>
<p class="info">