Skip to content

Commit e5422db

Browse files
GiteaBotJakobDevsilverwind
authored
Show if File is Executable (#25287) (#25300)
Backport #25287 by @JakobDev 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: JakobDev <[email protected]> Co-authored-by: silverwind <[email protected]>
1 parent 3a29f6a commit e5422db

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
382382
ctx.Data["IsRepresentableAsText"] = isRepresentableAsText
383383
ctx.Data["IsDisplayingSource"] = isDisplayingSource
384384
ctx.Data["IsDisplayingRendered"] = isDisplayingRendered
385+
ctx.Data["IsExecutable"] = entry.IsExecutable()
385386

386387
isTextSource := fInfo.isTextFile || isDisplayingSource
387388
ctx.Data["IsTextSource"] = isTextSource

templates/repo/file_info.tmpl

Lines changed: 5 additions & 0 deletions
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)