summaryrefslogtreecommitdiffstats
path: root/templates/repo
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-11-07 16:44:25 -0500
committerUnknwon <joe2010xtmf@163.com>2014-11-07 16:44:25 -0500
commit35977cd34cd635bca7f07ed2eb1fba0df9944e1d (patch)
treef12c39c762ce686e47eae6bf7282d08e12b1e10f /templates/repo
parentabc57b6e439c5ab9c3b6ed2cedeb10d50f5ae619 (diff)
downloadgitea-35977cd34cd635bca7f07ed2eb1fba0df9944e1d.tar.gz
gitea-35977cd34cd635bca7f07ed2eb1fba0df9944e1d.zip
continue work on #255
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/header.tmpl4
-rw-r--r--templates/repo/home.tmpl10
-rw-r--r--templates/repo/sidebar.tmpl2
-rw-r--r--templates/repo/view_file.tmpl8
-rw-r--r--templates/repo/view_list.tmpl4
5 files changed, 14 insertions, 14 deletions
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl
index 976c8e0c00..2344311d61 100644
--- a/templates/repo/header.tmpl
+++ b/templates/repo/header.tmpl
@@ -25,8 +25,8 @@
<p class="text-center" id="repo-clone-help">{{$.i18n.Tr "repo.clone_helper" | Str2html}}</p>
<hr/>
<div class="text-center" id="repo-clone-zip">
- <a class="btn btn-green btn-radius" href="{{$.RepoLink}}/archive/{{$.BranchName}}.zip"><i class="octicon octicon-file-zip"></i>ZIP</a>
- <a class="btn btn-green btn-radius" href="{{$.RepoLink}}/archive/{{$.BranchName}}.tar.gz"><i class="octicon octicon-file-zip"></i>TAR.GZ</a>
+ <a class="btn btn-green btn-radius" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.zip"><i class="octicon octicon-file-zip"></i>ZIP</a>
+ <a class="btn btn-green btn-radius" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.tar.gz"><i class="octicon octicon-file-zip"></i>TAR.GZ</a>
</div>
</div>
</div>
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index 4928033fc2..acfdc38bd6 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -31,26 +31,26 @@
</ul>
<ul class="menu menu-vertical switching-list {{if .IsTag}}hide{{end}}" id="repo-branch-list">
{{range .Branches}}
- <li {{if eq . $.BranchName}}class="checked"{{end}}><a href="{{$.RepoLink}}/src/{{.}}"><i class="octicon octicon-check"></i>{{.}}</a></li>
+ <li {{if eq . $.BranchName}}class="checked"{{end}}><a href="{{$.RepoLink}}/src/{{EscapePound .}}"><i class="octicon octicon-check"></i>{{.}}</a></li>
{{end}}
</ul>
<ul class="menu menu-vertical switching-list {{if not .IsTag}}hide{{end}}" id="repo-tag-list">
{{range .Tags}}
- <li {{if eq . $.BranchName}}class="checked"{{end}}><a href="{{$.RepoLink}}/src/{{.}}"><i class="octicon octicon-check"></i>{{.}}</a></li>
+ <li {{if eq . $.BranchName}}class="checked"{{end}}><a href="{{$.RepoLink}}/src/{{EscapePound .}}"><i class="octicon octicon-check"></i>{{.}}</a></li>
{{end}}
</ul>
</div>
</div>
</li>
<li id="repo-bread" class="breads">
- <a class="title bread" href="{{.RepoLink}}">{{.Repository.Name}}</a>
+ <a class="title bread" href="{{.RepoLink}}/src/{{EscapePound .BranchName}}">{{.Repository.Name}}</a>
{{ $n := len .Treenames}}
{{ $l := Subtract $n 1}}
{{range $i, $v := .Treenames}}
{{if eq $i $l}}
- <span class="bread">{{$v}}</span>
+ <span class="bread">{{EscapePound $v}}</span>
{{else}}
- <span class="bread"><a href="{{$.BranchLink}}/{{index $.Paths $i}}">{{$v}}</a></span>
+ <span class="bread"><a href="{{EscapePound $.BranchLink}}/{{index $.Paths $i}}">{{$v}}</a></span>
{{end}}
{{end}}
</li>
diff --git a/templates/repo/sidebar.tmpl b/templates/repo/sidebar.tmpl
index 7a00dbb8c3..9d6abb47bc 100644
--- a/templates/repo/sidebar.tmpl
+++ b/templates/repo/sidebar.tmpl
@@ -9,7 +9,7 @@
<li class="border-bottom"></li>
<li class="head">{{if .IsViewBranch}}{{.BranchName}}{{else}}{{ShortSha .BranchName}}{{end}}</li>
<li>
- <a class="radius" href="{{.RepoLink}}/commits/{{.BranchName}}"><i class="octicon octicon-history"></i>{{.i18n.Tr "repo.commits"}} <span class="num right label label-gray label-radius">{{.CommitsCount}}</span></a>
+ <a class="radius" href="{{.RepoLink}}/commits/{{EscapePound .BranchName}}"><i class="octicon octicon-history"></i>{{.i18n.Tr "repo.commits"}} <span class="num right label label-gray label-radius">{{.CommitsCount}}</span></a>
</li>
<!-- <li>
<a class="radius" href="{{.RepoLink}}/branches"><i class="octicon octicon-git-branch"></i>Branches<span class="num right label label-gray label-radius">{{.BrancheCount}}</span></a>
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
index 4e2d4fc64c..d33cc95023 100644
--- a/templates/repo/view_file.tmpl
+++ b/templates/repo/view_file.tmpl
@@ -12,10 +12,10 @@
<strong class="file-name">{{.FileName}}</strong><span class="file-size">{{FileSize .FileSize}}</span>
{{end}}
{{if not .ReadmeInList}}
- <a class="right" href="{{.RepoLink}}/commits/{{.BranchName}}/{{.TreeName}}">
+ <a class="right" href="{{.RepoLink}}/commits/{{EscapePound .BranchName}}/{{.TreeName}}">
<button class="btn btn-medium btn-gray btn-right-radius btn-comb">{{.i18n.Tr "repo.file_history"}}</button>
</a>
- <a class="right" href="{{.FileLink}}">
+ <a class="right" href="{{EscapePound .FileLink}}">
<button class="btn btn-medium btn-gray btn-left-radius btn-comb">{{.i18n.Tr "repo.file_raw"}}</button>
</a>
{{end}}
@@ -26,9 +26,9 @@
{{else if not .IsFileText}}
<div class="view-raw">
{{if .IsImageFile}}
- <img src="{{.FileLink}}">
+ <img src="{{EscapePound .FileLink}}">
{{else}}
- <a href="{{.FileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.i18n.Tr "repo.file_view_raw"}}</a>
+ <a href="{{EscapePound .FileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.i18n.Tr "repo.file_view_raw"}}</a>
{{end}}
</div>
{{else if .FileSize}}
diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl
index 032b9e0f1b..e65d7c1134 100644
--- a/templates/repo/view_list.tmpl
+++ b/templates/repo/view_list.tmpl
@@ -18,7 +18,7 @@
{{if .HasParentPath}}
<tr class="has-parent">
<td class="icon"></td>
- <td class="name"><a href="{{.BranchLink}}{{.ParentPath}}">..</a></td>
+ <td class="name"><a href="{{EscapePound .BranchLink}}{{.ParentPath}}">..</a></td>
<td class="msg"></td>
<td class="age"></td>
</tr>
@@ -39,7 +39,7 @@
<span class="octicon octicon-file-{{if or $entry.IsDir}}directory{{else}}text{{end}}"></span>
</td>
<td class="name">
- <a href="{{$.BranchLink}}/{{$.TreePath}}{{$entry.Name}}" class="text-truncate">{{$entry.Name}}</a>
+ <a href="{{EscapePound $.BranchLink}}/{{$.TreePath}}{{$entry.Name}}" class="text-truncate">{{$entry.Name}}</a>
</td>
{{end}}
<td class="msg">