forked from forgejo/forgejo
[FEAT] Restrict file size of blame operation
- Currently there exists a restriction to not render and show files that are larger than what's configured in `[UI].MAX_DISPLAY_FILE_SIZE`. - Apply the same restriction to the blame operation as well, as the blame operation can be seen as displaying a file. - Add integration test. - Ref: #2394
This commit is contained in:
parent
b604b89108
commit
d8a267d3ab
3 changed files with 75 additions and 9 deletions
|
@ -30,6 +30,15 @@
|
|||
</h4>
|
||||
<div class="ui attached table unstackable segment">
|
||||
<div class="file-view code-view unicode-escaped">
|
||||
{{if .IsFileTooLarge}}
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="gt-text-center gt-p-1"><strong>{{ctx.Locale.Tr "repo.file_too_large"}}</strong></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{{else}}
|
||||
<table>
|
||||
<tbody>
|
||||
{{range $row := .BlameRows}}
|
||||
|
@ -75,6 +84,7 @@
|
|||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue