aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakobDev <jakobdev@gmx.de>2023-06-16 07:46:12 +0200
committerGitHub <noreply@github.com>2023-06-16 07:46:12 +0200
commita305c37e62eca42aaad16b4521520bad6bca58d2 (patch)
tree89baf0b20fa44b74c427e4b668bcbf317d1139a7
parentbc51e259d6442ec753846ba353395fa4fe7d0858 (diff)
downloadgitea-a305c37e62eca42aaad16b4521520bad6bca58d2.tar.gz
gitea-a305c37e62eca42aaad16b4521520bad6bca58d2.zip
Show if File is Executable (#25287)
This simply shows if a File has the executable Permission ![grafik](https://github.com/go-gitea/gitea/assets/15185051/1d50c105-6d55-4ecc-808a-c9cd5559d238) --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
-rw-r--r--options/locale/locale_en-US.ini1
-rw-r--r--routers/web/repo/view.go1
-rw-r--r--templates/repo/file_info.tmpl5
3 files changed, 7 insertions, 0 deletions
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index 65dda101f5..25456d0493 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -1156,6 +1156,7 @@ video_not_supported_in_browser = Your browser does not support the HTML5 'video'
audio_not_supported_in_browser = Your browser does not support the HTML5 'audio' tag.
stored_lfs = Stored with Git LFS
symbolic_link = Symbolic link
+executable_file = Executable File
commit_graph = Commit Graph
commit_graph.select = Select branches
commit_graph.hide_pr_refs = Hide Pull Requests
diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go
index cf719c49f0..ad87bae9b8 100644
--- a/routers/web/repo/view.go
+++ b/routers/web/repo/view.go
@@ -390,6 +390,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
ctx.Data["IsRepresentableAsText"] = isRepresentableAsText
ctx.Data["IsDisplayingSource"] = isDisplayingSource
ctx.Data["IsDisplayingRendered"] = isDisplayingRendered
+ ctx.Data["IsExecutable"] = entry.IsExecutable()
isTextSource := fInfo.isTextFile || isDisplayingSource
ctx.Data["IsTextSource"] = isTextSource
diff --git a/templates/repo/file_info.tmpl b/templates/repo/file_info.tmpl
index 580966d35c..44256a0dcb 100644
--- a/templates/repo/file_info.tmpl
+++ b/templates/repo/file_info.tmpl
@@ -25,4 +25,9 @@
{{.LexerName}}
</div>
{{end}}
+ {{if .IsExecutable}}
+ <div class="file-info-entry">
+ {{.locale.Tr "repo.executable_file"}}
+ </div>
+ {{end}}
</div>