File tree Expand file tree Collapse file tree 2 files changed +1
-5
lines changed Expand file tree Collapse file tree 2 files changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -173,8 +173,6 @@ func editFile(ctx *context.Context, isNewFile bool) {
173173 ctx .Data ["FileSize" ] = fInfo .fileSize
174174
175175 // Only some file types are editable online as text.
176- ctx .Data ["IsFileEditable" ] = fInfo .st .IsRepresentableAsText () && ! fInfo .isLFSFile && fInfo .fileSize < setting .UI .MaxDisplayFileSize
177-
178176 if fInfo .isLFSFile {
179177 ctx .Data ["NotEditableReason" ] = ctx .Tr ("repo.editor.cannot_edit_lfs_files" )
180178 } else if ! fInfo .st .IsRepresentableAsText () {
@@ -195,8 +193,6 @@ func editFile(ctx *context.Context, isNewFile bool) {
195193 } else {
196194 // Append filename from query, or empty string to allow username the new file.
197195 treeNames = append (treeNames , fileName )
198-
199- ctx .Data ["IsFileEditable" ] = true
200196 }
201197
202198 ctx .Data ["TreeNames" ] = treeNames
Original file line number Diff line number Diff line change 2828 <input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required>
2929 </div>
3030 </div>
31- {{if .IsFileEditable }}
31+ {{if not .NotEditableReason }}
3232 <div class="field">
3333 <div class="ui top attached header">
3434 <div class="ui compact small menu small-menu-items repo-editor-menu">
You can’t perform that action at this time.
0 commit comments