diff options
author | Unknwon <u@gogs.io> | 2018-03-12 15:27:21 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2018-03-12 15:27:27 -0400 |
commit | ba0a78da2ac69315dd4c40dae5405194f1afae44 (patch) | |
tree | 5844961c89a7a8eef962bb37f9ed0f07aa3373ff | |
parent | f0bbcef3a473ea72dc948ccc3537aeba7ef45e98 (diff) |
templates/repo/branches: escape pound in branch name (#4874)
-rw-r--r-- | gogs.go | 2 | ||||
-rw-r--r-- | templates/.VERSION | 2 | ||||
-rw-r--r-- | templates/repo/branches/all.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/branches/overview.tmpl | 10 |
4 files changed, 8 insertions, 8 deletions
@@ -16,7 +16,7 @@ import ( "github.com/gogits/gogs/pkg/setting" ) -const APP_VER = "0.11.37.0312" +const APP_VER = "0.11.38.0312" func init() { setting.AppVer = APP_VER diff --git a/templates/.VERSION b/templates/.VERSION index 9dbf326b..9cfaf73d 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.11.37.0312
\ No newline at end of file +0.11.38.0312
\ No newline at end of file diff --git a/templates/repo/branches/all.tmpl b/templates/repo/branches/all.tmpl index 42c67bc3..40b9d2b5 100644 --- a/templates/repo/branches/all.tmpl +++ b/templates/repo/branches/all.tmpl @@ -20,7 +20,7 @@ {{if and (and (eq $.BranchName .Name) $.IsRepositoryAdmin) (not $.Repository.IsMirror)}} <a class="ui basic blue button" href="{{$.RepoLink}}/settings/branches">{{$.i18n.Tr "repo.branches.change_default_branch"}}</a> {{else if and $.IsRepositoryWriter $.AllowPullRequest}} - <a class="ui basic button" href="{{$.RepoLink}}/compare/{{$.BranchName}}...{{.Name}}"><i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.new"}}</a> + <a class="ui basic button" href="{{$.RepoLink}}/compare/{{EscapePound $.BranchName}}...{{EscapePound .Name}}"><i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.new"}}</a> {{end}} </div> </div> diff --git a/templates/repo/branches/overview.tmpl b/templates/repo/branches/overview.tmpl index f4614369..f8becf9d 100644 --- a/templates/repo/branches/overview.tmpl +++ b/templates/repo/branches/overview.tmpl @@ -11,7 +11,7 @@ <div class="ui attached segment list"> <div class="item ui grid"> <div class="ui eleven wide column"> - {{if .DefaultBranch.IsProtected}}<i class="octicon octicon-shield"></i> {{end}}<a class="markdown" href="{{$.RepoLink}}/src/{{.DefaultBranch.Name}}"><code>{{.DefaultBranch.Name}}</code></a> + {{if .DefaultBranch.IsProtected}}<i class="octicon octicon-shield"></i> {{end}}<a class="markdown" href="{{$.RepoLink}}/src/{{EscapePound .DefaultBranch.Name}}"><code>{{.DefaultBranch.Name}}</code></a> {{$timeSince := TimeSince .DefaultBranch.Commit.Committer.When $.Lang}} <span class="ui text light grey">{{$.i18n.Tr "repo.branches.updated_by" $timeSince .DefaultBranch.Commit.Committer.Name | Safe}}</span> </div> @@ -31,13 +31,13 @@ {{range .ActiveBranches}} <div class="item ui grid"> <div class="ui eleven wide column"> - {{if .IsProtected}}<i class="octicon octicon-shield"></i> {{end}}<a class="markdown" href="{{$.RepoLink}}/src/{{.Name}}"><code>{{.Name}}</code></a> + {{if .IsProtected}}<i class="octicon octicon-shield"></i> {{end}}<a class="markdown" href="{{$.RepoLink}}/src/{{EscapePound .Name}}"><code>{{.Name}}</code></a> {{$timeSince := TimeSince .Commit.Committer.When $.Lang}} <span class="ui text light grey">{{$.i18n.Tr "repo.branches.updated_by" $timeSince .Commit.Committer.Name | Safe}}</span> </div> {{if and $.IsRepositoryWriter $.AllowPullRequest}} <div class="ui four wide column"> - <a class="ui basic button" href="{{$.RepoLink}}/compare/{{$.BranchName}}...{{.Name}}"><i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.new"}}</a> + <a class="ui basic button" href="{{$.RepoLink}}/compare/{{EscapePound $.BranchName}}...{{EscapePound .Name}}"><i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.new"}}</a> </div> {{end}} </div> @@ -53,13 +53,13 @@ {{range .StaleBranches}} <div class="item ui grid"> <div class="ui eleven wide column"> - {{if .IsProtected}}<i class="octicon octicon-shield"></i> {{end}}<a class="markdown" href="{{$.RepoLink}}/src/{{.Name}}"><code>{{.Name}}</code></a> + {{if .IsProtected}}<i class="octicon octicon-shield"></i> {{end}}<a class="markdown" href="{{$.RepoLink}}/src/{{EscapePound .Name}}"><code>{{.Name}}</code></a> {{$timeSince := TimeSince .Commit.Committer.When $.Lang}} <span class="ui text light grey">{{$.i18n.Tr "repo.branches.updated_by" $timeSince .Commit.Committer.Name | Safe}}</span> </div> {{if and $.IsRepositoryWriter $.AllowPullRequest}} <div class="ui four wide column"> - <a class="ui basic button" href="{{$.RepoLink}}/compare/{{$.BranchName}}...{{.Name}}"><i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.new"}}</a> + <a class="ui basic button" href="{{$.RepoLink}}/compare/{{EscapePound $.BranchName}}...{{EscapePound .Name}}"><i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.new"}}</a> </div> {{end}} </div> |