From e68b9d00a6e05b3a941f63ffb696f91e554ac5ec Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 18 Oct 2024 20:33:49 +0200 Subject: Adding upstream version 9.0.3. Signed-off-by: Daniel Baumann --- templates/repo/view_file.tmpl | 158 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 templates/repo/view_file.tmpl (limited to 'templates/repo/view_file.tmpl') diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl new file mode 100644 index 0000000..d127c2e --- /dev/null +++ b/templates/repo/view_file.tmpl @@ -0,0 +1,158 @@ +
+ {{- if .FileError}} +
+
{{.FileError}}
+
+ {{end}} + {{- if .FileWarning}} +
+
{{.FileWarning}}
+
+ {{end}} + + {{if not .ReadmeInList}} +
+
+ {{template "repo/latest_commit" .}} +
+ {{if .LatestCommit}} + {{if .LatestCommit.Committer}} +
+ {{TimeSince .LatestCommit.Committer.When ctx.Locale}} +
+ {{end}} + {{end}} +
+ {{end}} + +

+
+ {{if .ReadmeInList}} + {{svg "octicon-book" 16 "tw-mr-2"}} + {{.FileName}} + {{else}} + {{template "repo/file_info" .}} + {{end}} +
+
+ {{if .HasSourceRenderedToggle}} + + {{end}} + {{if not .ReadmeInList}} +
+ {{if .SymlinkURL}} + {{ctx.Locale.Tr "repo.file_follow"}} + {{end}} + {{ctx.Locale.Tr "repo.file_raw"}} + {{if not .IsViewCommit}} + {{ctx.Locale.Tr "repo.file_permalink"}} + {{end}} + {{if .IsRepresentableAsText}} + {{ctx.Locale.Tr "repo.blame"}} + {{end}} + {{ctx.Locale.Tr "repo.file_history"}} + {{if .EscapeStatus.Escaped}} + + + {{end}} +
+ {{svg "octicon-download"}} + {{svg "octicon-copy" 14}} + {{if .EnableFeed}} + {{if .IsViewBranch}} + + {{svg "octicon-rss" 14}} + + {{else}} + + {{svg "octicon-rss" 14}} + + {{end}} + {{end}} + {{if .Repository.CanEnableEditor}} + {{if .CanEditFile}} + {{svg "octicon-pencil"}} + {{else}} + {{svg "octicon-pencil"}} + {{end}} + {{if .CanDeleteFile}} + {{svg "octicon-trash"}} + {{else}} + {{svg "octicon-trash"}} + {{end}} + {{end}} + {{else if .EscapeStatus.Escaped}} + + + {{end}} + {{if and .ReadmeInList .CanEditReadmeFile}} + {{svg "octicon-pencil"}} + {{end}} +
+

+
+ {{if not (or .IsMarkup .IsRenderedHTML)}} + {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}} + {{end}} +
+ {{if .IsMarkup}} + {{if .FileContent}}{{.FileContent}}{{end}} + {{else if .IsPlainText}} +
{{if .FileContent}}{{.FileContent}}{{end}}
+ {{else if not .IsTextSource}} +
+ {{if .IsImageFile}} + + {{else if .IsVideoFile}} + + {{else if .IsAudioFile}} + + {{else if .IsPDFFile}} +
+ {{else}} + {{ctx.Locale.Tr "repo.file_view_raw"}} + {{end}} +
+ {{else if .FileSize}} + {{if .IsFileTooLarge}} + + + + + + +
{{ctx.Locale.Tr "repo.file_too_large"}}
+ {{else}} + + + {{range $idx, $code := .FileContent}} + {{$line := Eval $idx "+" 1}} + + + {{if $.EscapeStatus.Escaped}} + + {{end}} + + + {{end}} + +
{{if (index $.LineEscapeStatus $idx).Escaped}}{{end}}{{$code}}
+ + {{end}} + {{end}} +
+
+
-- cgit v1.2.3