summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorKim Carlbäcker <kim.carlbacker@gmail.com>2016-07-12 00:21:26 +0200
committer无闻 <u@gogs.io>2016-07-12 06:21:26 +0800
commitf4ab50501ebc3d216dd216c72f5f8ff53fa6efc1 (patch)
tree787acd1bf0d3a69c348c509a299e27995b094190 /templates
parentde10387f41c02aef2d97ca5f247a422f18e6fb38 (diff)
downloadgitea-f4ab50501ebc3d216dd216c72f5f8ff53fa6efc1.tar.gz
gitea-f4ab50501ebc3d216dd216c72f5f8ff53fa6efc1.zip
[Fix] Don't display way too large files #1513 (#3253)
* Add MaxDisplayFileSize setting * Don't show files that are too large * Localized FileTooLarge * Change IsFileTooBig => IsFileTooLarge
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/view_file.tmpl4
1 files changed, 4 insertions, 0 deletions
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
index 9868072313..cd0caf10f9 100644
--- a/templates/repo/view_file.tmpl
+++ b/templates/repo/view_file.tmpl
@@ -41,8 +41,12 @@
<table>
<tbody>
<tr>
+ {{if .IsFileTooLarge}}
+ <td><strong>{{.i18n.Tr "repo.file_too_large"}}</strong></td>
+ {{else}}
<td class="lines-num"></td>
<td class="lines-code"><pre><code class="{{.HighlightClass}}"><ol class="linenums">{{.FileContent}}</ol></code></pre></td>
+ {{end}}
</tr>
</tbody>
</table>