summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-12-09 00:32:53 -0500
committerUnknwon <u@gogs.io>2015-12-09 00:32:53 -0500
commita576224d0ea0a6a48207002229ae38937bd038a3 (patch)
tree479bb167651a1301ca71b7175078c1e1be1336c0
parent989f30eb416f2d8709aaff9c235d555f8b109e36 (diff)
downloadgitea-a576224d0ea0a6a48207002229ae38937bd038a3.tar.gz
gitea-a576224d0ea0a6a48207002229ae38937bd038a3.zip
unified name: IsViewBranch, IsViewCommit and IsViewTag
-rw-r--r--conf/app.ini4
-rw-r--r--gogs.go2
-rw-r--r--modules/middleware/context.go6
-rw-r--r--modules/middleware/repo.go14
-rw-r--r--routers/repo/view.go3
-rw-r--r--templates/.VERSION2
-rw-r--r--templates/repo/home.tmpl4
-rw-r--r--templates/repo/view_file.tmpl2
-rw-r--r--templates/repo/wiki/view.tmpl2
9 files changed, 18 insertions, 21 deletions
diff --git a/conf/app.ini b/conf/app.ini
index ab8bd9f566..d086eb7014 100644
--- a/conf/app.ini
+++ b/conf/app.ini
@@ -265,8 +265,8 @@ ADDR =
; For "smtp" mode only
[log.smtp]
LEVEL =
-; Name displayed in mail title, default is "Diagnostic message from serve"
-SUBJECT = Diagnostic message from serve
+; Name displayed in mail title, default is "Diagnostic message from server"
+SUBJECT = Diagnostic message from server
; Mail server
HOST =
; Mailer user name and password
diff --git a/gogs.go b/gogs.go
index bae977212a..f4e8697b38 100644
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting"
)
-const APP_VER = "0.7.35.1208 Beta"
+const APP_VER = "0.7.35.1209 Beta"
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
diff --git a/modules/middleware/context.go b/modules/middleware/context.go
index 7528e2a7a4..5784d756b2 100644
--- a/modules/middleware/context.go
+++ b/modules/middleware/context.go
@@ -29,9 +29,9 @@ import (
type RepoContext struct {
AccessMode models.AccessMode
IsWatching bool
- IsBranch bool
- IsTag bool
- IsCommit bool
+ IsViewBranch bool
+ IsViewTag bool
+ IsViewCommit bool
Repository *models.Repository
Owner *models.User
Commit *git.Commit
diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go
index c52c162f0d..5a9ee0c0d1 100644
--- a/modules/middleware/repo.go
+++ b/modules/middleware/repo.go
@@ -263,7 +263,7 @@ func RepoRef() macaron.Handler {
return
}
ctx.Repo.CommitID = ctx.Repo.Commit.ID.String()
- ctx.Repo.IsBranch = true
+ ctx.Repo.IsViewBranch = true
} else {
hasMatched := false
@@ -286,7 +286,7 @@ func RepoRef() macaron.Handler {
}
if ctx.Repo.GitRepo.IsBranchExist(refName) {
- ctx.Repo.IsBranch = true
+ ctx.Repo.IsViewBranch = true
ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetCommitOfBranch(refName)
if err != nil {
@@ -296,7 +296,7 @@ func RepoRef() macaron.Handler {
ctx.Repo.CommitID = ctx.Repo.Commit.ID.String()
} else if ctx.Repo.GitRepo.IsTagExist(refName) {
- ctx.Repo.IsTag = true
+ ctx.Repo.IsViewTag = true
ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetCommitOfTag(refName)
if err != nil {
ctx.Handle(500, "GetCommitOfTag", err)
@@ -304,7 +304,7 @@ func RepoRef() macaron.Handler {
}
ctx.Repo.CommitID = ctx.Repo.Commit.ID.String()
} else if len(refName) == 40 {
- ctx.Repo.IsCommit = true
+ ctx.Repo.IsViewCommit = true
ctx.Repo.CommitID = refName
ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetCommit(refName)
@@ -321,9 +321,9 @@ func RepoRef() macaron.Handler {
ctx.Repo.BranchName = refName
ctx.Data["BranchName"] = ctx.Repo.BranchName
ctx.Data["CommitID"] = ctx.Repo.CommitID
- ctx.Data["IsBranch"] = ctx.Repo.IsBranch
- ctx.Data["IsTag"] = ctx.Repo.IsTag
- ctx.Data["IsCommit"] = ctx.Repo.IsCommit
+ ctx.Data["IsViewBranch"] = ctx.Repo.IsViewBranch
+ ctx.Data["IsViewTag"] = ctx.Repo.IsViewTag
+ ctx.Data["IsViewCommit"] = ctx.Repo.IsViewCommit
ctx.Repo.CommitsCount, err = ctx.Repo.Commit.CommitsCount()
if err != nil {
diff --git a/routers/repo/view.go b/routers/repo/view.go
index 98b44f42e3..361d77a85a 100644
--- a/routers/repo/view.go
+++ b/routers/repo/view.go
@@ -53,9 +53,6 @@ func Home(ctx *middleware.Context) {
treeLink += "/" + treename
}
- isViewBranch := ctx.Repo.IsBranch
- ctx.Data["IsViewBranch"] = isViewBranch
-
treePath := treename
if len(treePath) != 0 {
treePath = treePath + "/"
diff --git a/templates/.VERSION b/templates/.VERSION
index d8afdb4079..33860edec4 100644
--- a/templates/.VERSION
+++ b/templates/.VERSION
@@ -1 +1 @@
-0.7.35.1208 Beta \ No newline at end of file
+0.7.35.1209 Beta \ No newline at end of file
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index 12820e46b3..ccbe6639cf 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -39,14 +39,14 @@
</span>
</a>
<a class="reference column" href="#" data-target="#tag-list">
- <span class="text {{if .IsTag}}black{{end}}">
+ <span class="text {{if .IsViewTag}}black{{end}}">
<i class="reference tags icon"></i> {{.i18n.Tr "repo.tags"}}
</span>
</a>
</div>
</div>
</div>
- <div id="branch-list" class="scrolling menu" {{if .IsTag}}style="display: none"{{end}}>
+ <div id="branch-list" class="scrolling menu" {{if .IsViewTag}}style="display: none"{{end}}>
{{range .Branches}}
<div class="item {{if eq $.BranchName .}}selected{{end}}" data-url="{{$.RepoLink}}/src/{{EscapePound .}}">{{.}}</div>
{{end}}
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
index cf6198195a..021a62f1d1 100644
--- a/templates/repo/view_file.tmpl
+++ b/templates/repo/view_file.tmpl
@@ -14,7 +14,7 @@
{{if not .ReadmeInList}}
<div class="ui right">
<div class="ui small grey basic buttons">
- {{if not .IsCommit}}
+ {{if not .IsViewCommit}}
<a class="ui button" href="{{.RepoLink}}/src/{{.CommitID}}/{{EscapePound .TreeName}}">{{.i18n.Tr "repo.file_permalink"}}</a>
{{end}}
<a class="ui button" href="{{.RepoLink}}/commits/{{EscapePound .BranchName}}/{{EscapePound .TreeName}}">{{.i18n.Tr "repo.file_history"}}</a>
diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl
index cd7642bcc2..050c34b0a9 100644
--- a/templates/repo/wiki/view.tmpl
+++ b/templates/repo/wiki/view.tmpl
@@ -18,7 +18,7 @@
<i class="filter icon"></i>
<input name="search" placeholder="{{.i18n.Tr "repo.wiki.filter_page"}}...">
</div>
- <div class="scrolling menu" {{if .IsTag}}style="display: none"{{end}}>
+ <div class="scrolling menu">
{{range .Pages}}
<div class="item {{if eq $.Title .Name}}selected{{end}}" data-url="{{$.RepoLink}}/wiki/{{.URL}}">{{.Name}}</div>
{{end}}