Show More
@@ -668,7 +668,10 b' class RepoFilesView(RepoAppView):' | |||
|
668 | 668 | |
|
669 | 669 | c.file_source_page = 'true' |
|
670 | 670 | c.file_last_commit = c.file.last_commit |
|
671 | if c.file.size < c.visual.cut_off_limit_diff: | |
|
671 | ||
|
672 | c.file_size_too_big = c.file.size > c.visual.cut_off_limit_file | |
|
673 | ||
|
674 | if not c.file_size_too_big: | |
|
672 | 675 | if c.annotate: # annotation has precedence over renderer |
|
673 | 676 | c.annotated_lines = filenode_as_annotated_lines_tokens( |
|
674 | 677 | c.file |
@@ -60,14 +60,28 b'' | |||
|
60 | 60 | <div class="file-stats"> |
|
61 | 61 | |
|
62 | 62 | <div class="stats-info"> |
|
63 | <span class="stats-first-item">${c.file.lines()[0]} ${_ungettext('line', 'lines', c.file.lines()[0])}</span> | |
|
63 | <span class="stats-first-item"> | |
|
64 | % if c.file_size_too_big: | |
|
65 | 0 ${(_('lines'))} | |
|
66 | % else: | |
|
67 | ${c.file.lines()[0]} ${_ungettext('line', 'lines', c.file.lines()[0])} | |
|
68 | % endif | |
|
69 | </span> | |
|
64 | 70 | |
|
65 | 71 | <span> | ${h.format_byte_size_binary(c.file.size)}</span> |
|
66 | 72 | % if c.lf_node: |
|
67 | 73 | <span title="${_('This file is a pointer to large binary file')}"> | ${_('LargeFile')} ${h.format_byte_size_binary(c.lf_node.size)} </span> |
|
68 | 74 | % endif |
|
69 | <span> | ${c.file.mimetype} </span> | |
|
70 | <span> | ${h.get_lexer_for_filenode(c.file).__class__.__name__}</span> | |
|
75 | <span> | |
|
76 | | ${c.file.mimetype} | |
|
77 | </span> | |
|
78 | ||
|
79 | % if not c.file_size_too_big: | |
|
80 | <span> | | |
|
81 | ${h.get_lexer_for_filenode(c.file).__class__.__name__} | |
|
82 | </span> | |
|
83 | % endif | |
|
84 | ||
|
71 | 85 | </div> |
|
72 | 86 | </div> |
|
73 | 87 | </div> |
@@ -94,18 +108,20 b'' | |||
|
94 | 108 | </div> |
|
95 | 109 | |
|
96 | 110 | <div class="code-body clear-fix "> |
|
97 | ||
|
98 | 111 | %if c.file.is_binary: |
|
99 | 112 | <% rendered_binary = h.render_binary(c.repo_name, c.file)%> |
|
100 | 113 | % if rendered_binary: |
|
101 | 114 | ${rendered_binary} |
|
102 | 115 | % else: |
|
103 | 116 | <div> |
|
104 |
${_('Binary file ( |
|
|
117 | ${_('Binary file ({})').format(c.file.mimetype)} | |
|
105 | 118 | </div> |
|
106 | 119 | % endif |
|
107 | 120 | %else: |
|
108 | % if c.file.size < c.visual.cut_off_limit_file: | |
|
121 | % if c.file_size_too_big: | |
|
122 | ${_('File size {} is bigger then allowed limit {}. ').format(h.format_byte_size_binary(c.file.size), h.format_byte_size_binary(c.visual.cut_off_limit_file))} ${h.link_to(_('Show as raw'), | |
|
123 | h.route_path('repo_file_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path))} | |
|
124 | % else: | |
|
109 | 125 | %if c.renderer and not c.annotate: |
|
110 | 126 | ## pick relative url based on renderer |
|
111 | 127 | <% |
@@ -129,9 +145,6 b'' | |||
|
129 | 145 | %endif |
|
130 | 146 | </table> |
|
131 | 147 | %endif |
|
132 | %else: | |
|
133 | ${_('File size {} is bigger then allowed limit {}. ').format(h.format_byte_size_binary(c.file.size), h.format_byte_size_binary(c.visual.cut_off_limit_file))} ${h.link_to(_('Show as raw'), | |
|
134 | h.route_path('repo_file_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path))} | |
|
135 | 148 | %endif |
|
136 | 149 | %endif |
|
137 | 150 | </div> |
General Comments 0
You need to be logged in to leave comments.
Login now