mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Show if File is Executable (#25287)
This simply shows if a File has the executable Permission  --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
		@@ -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.
 | 
					audio_not_supported_in_browser = Your browser does not support the HTML5 'audio' tag.
 | 
				
			||||||
stored_lfs = Stored with Git LFS
 | 
					stored_lfs = Stored with Git LFS
 | 
				
			||||||
symbolic_link = Symbolic link
 | 
					symbolic_link = Symbolic link
 | 
				
			||||||
 | 
					executable_file = Executable File
 | 
				
			||||||
commit_graph = Commit Graph
 | 
					commit_graph = Commit Graph
 | 
				
			||||||
commit_graph.select = Select branches
 | 
					commit_graph.select = Select branches
 | 
				
			||||||
commit_graph.hide_pr_refs = Hide Pull Requests
 | 
					commit_graph.hide_pr_refs = Hide Pull Requests
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -390,6 +390,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
 | 
				
			|||||||
	ctx.Data["IsRepresentableAsText"] = isRepresentableAsText
 | 
						ctx.Data["IsRepresentableAsText"] = isRepresentableAsText
 | 
				
			||||||
	ctx.Data["IsDisplayingSource"] = isDisplayingSource
 | 
						ctx.Data["IsDisplayingSource"] = isDisplayingSource
 | 
				
			||||||
	ctx.Data["IsDisplayingRendered"] = isDisplayingRendered
 | 
						ctx.Data["IsDisplayingRendered"] = isDisplayingRendered
 | 
				
			||||||
 | 
						ctx.Data["IsExecutable"] = entry.IsExecutable()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	isTextSource := fInfo.isTextFile || isDisplayingSource
 | 
						isTextSource := fInfo.isTextFile || isDisplayingSource
 | 
				
			||||||
	ctx.Data["IsTextSource"] = isTextSource
 | 
						ctx.Data["IsTextSource"] = isTextSource
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -25,4 +25,9 @@
 | 
				
			|||||||
			{{.LexerName}}
 | 
								{{.LexerName}}
 | 
				
			||||||
		</div>
 | 
							</div>
 | 
				
			||||||
	{{end}}
 | 
						{{end}}
 | 
				
			||||||
 | 
						{{if .IsExecutable}}
 | 
				
			||||||
 | 
							<div class="file-info-entry">
 | 
				
			||||||
 | 
								{{.locale.Tr "repo.executable_file"}}
 | 
				
			||||||
 | 
							</div>
 | 
				
			||||||
 | 
						{{end}}
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user