Mercurial > kallithea
diff pylons_app/templates/files/files_source.html @ 485:9836541b0509 celery
added limit for showing pygemntized source codes larger than 250kb.
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 18 Sep 2010 00:50:54 +0200 |
parents | 0ebec9b88d13 |
children | 15f837c62fa5 |
line wrap: on
line diff
--- a/pylons_app/templates/files/files_source.html Fri Sep 17 23:57:22 2010 +0200 +++ b/pylons_app/templates/files/files_source.html Sat Sep 18 00:50:54 2010 +0200 @@ -8,9 +8,11 @@ <dd>${h.format_byte_size(c.files_list.size,binary=True)}</dd> <dt>${_('Options')}</dt> <dd>${h.link_to(_('show annotation'), - h.url('files_annotate_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))} + h.url('files_annotate_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))} + / ${h.link_to(_('show as raw'), + h.url('files_raw_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))} / ${h.link_to(_('download as raw'), - h.url('files_raw_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))} + h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))} </dd> <dt>${_('History')}</dt> <dd> @@ -32,7 +34,12 @@ <div class="commit">"${c.files_list.last_changeset.message}"</div> </div> <div class="code-body"> - ${h.pygmentize(c.files_list,linenos=True,anchorlinenos=True,lineanchors='S',cssclass="code-highlight")} + % if c.files_list.size < c.file_size_limit: + ${h.pygmentize(c.files_list,linenos=True,anchorlinenos=True,lineanchors='S',cssclass="code-highlight")} + %else: + ${_('File is to big to display')} ${h.link_to(_('show as raw'), + h.url('files_raw_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))} + %endif </div> </div>