Skip to content

Commit a305c37

Browse files
JakobDevsilverwindGiteaBot
authored
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 <[email protected]> Co-authored-by: Giteabot <[email protected]>
1 parent bc51e25 commit a305c37

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

options/locale/locale_en-US.ini

+1
Original file line numberDiff line numberDiff line change
@@ -1156,6 +1156,7 @@ video_not_supported_in_browser = Your browser does not support the HTML5 'video'
11561156
audio_not_supported_in_browser = Your browser does not support the HTML5 'audio' tag.
11571157
stored_lfs = Stored with Git LFS
11581158
symbolic_link = Symbolic link
1159+
executable_file = Executable File
11591160
commit_graph = Commit Graph
11601161
commit_graph.select = Select branches
11611162
commit_graph.hide_pr_refs = Hide Pull Requests

routers/web/repo/view.go

+1
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
390390
ctx.Data["IsRepresentableAsText"] = isRepresentableAsText
391391
ctx.Data["IsDisplayingSource"] = isDisplayingSource
392392
ctx.Data["IsDisplayingRendered"] = isDisplayingRendered
393+
ctx.Data["IsExecutable"] = entry.IsExecutable()
393394

394395
isTextSource := fInfo.isTextFile || isDisplayingSource
395396
ctx.Data["IsTextSource"] = isTextSource

templates/repo/file_info.tmpl

+5
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,9 @@
2525
{{.LexerName}}
2626
</div>
2727
{{end}}
28+
{{if .IsExecutable}}
29+
<div class="file-info-entry">
30+
{{.locale.Tr "repo.executable_file"}}
31+
</div>
32+
{{end}}
2833
</div>

0 commit comments

Comments
 (0)