From 2bb1fb8f44bcd39c1f54b33377212636ae8c9558 Mon Sep 17 00:00:00 2001 From: Vladimir Vissoultchev Date: Tue, 28 Jul 2015 19:51:40 +0300 Subject: [PATCH] Use EscapePound in link hrefs in diff/file views --- templates/repo/diff.tmpl | 16 ++++++++-------- templates/repo/home.tmpl | 3 ++- templates/repo/view_file.tmpl | 6 +++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl index b9dc87de7c..268bbc166e 100644 --- a/templates/repo/diff.tmpl +++ b/templates/repo/diff.tmpl @@ -6,7 +6,7 @@ {{if .IsDiffCompare }}
@@ -16,7 +16,7 @@ {{else}}
- {{.i18n.Tr "repo.diff.browse_source"}} + {{.i18n.Tr "repo.diff.browse_source"}}

{{RenderCommitMessage .Commit.Message $.RepoLink}}

@@ -37,7 +37,7 @@ {{.Commit.Author.Name}} {{end}} - {{TimeSince .Commit.Author.When $.Lang}} + {{TimeSince .Commit.Author.When $.Lang}}

@@ -90,9 +90,9 @@ {{end}}
{{if $file.IsDeleted}} - {{$.i18n.Tr "repo.diff.view_file"}} + {{$.i18n.Tr "repo.diff.view_file"}} {{else}} - {{$.i18n.Tr "repo.diff.view_file"}} + {{$.i18n.Tr "repo.diff.view_file"}} {{end}} {{$file.Name}}
@@ -100,7 +100,7 @@
{{if $isImage}}
- +
{{else}} @@ -114,7 +114,7 @@ - + @@ -126,7 +126,7 @@ {{end}} -
+
{{end}} {{end}} diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 7a18ed985d..831a3962d8 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -50,7 +50,8 @@ {{if eq $i $l}} {{$v}} {{else}} - {{$v}} + {{ $p := index $.Paths $i}} + {{$v}} {{end}} {{end}} diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index 4d11170bd0..274c7df22e 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -13,11 +13,11 @@ {{end}} {{if not .ReadmeInList}} {{if not .IsCommit}} - + {{end}} - + @@ -47,4 +47,4 @@
{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}
{{$line.Content}}
{{end}}
- \ No newline at end of file +