Преглед на файлове

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 <jakobdev@gmx.de>
Co-authored-by: silverwind <me@silverwind.io>
tags/v1.20.0-rc1
Giteabot преди 1 година
родител
ревизия
e5422db5c7
No account linked to committer's email address
променени са 3 файла, в които са добавени 7 реда и са изтрити 0 реда
  1. 1
    0
      options/locale/locale_en-US.ini
  2. 1
    0
      routers/web/repo/view.go
  3. 5
    0
      templates/repo/file_info.tmpl

+ 1
- 0
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

+ 1
- 0
routers/web/repo/view.go Целия файл

@@ -382,6 +382,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

+ 5
- 0
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>

Loading…
Отказ
Запис