##// END OF EJS Templates
Added tag v5.3.1 for changeset bd23a920e83f
Added tag v5.3.1 for changeset bd23a920e83f

File last commit:

r5274:6d0b768f default
r5570:65455dcb stable
Show More
files_source.mako
189 lines | 8.0 KiB | application/x-mako | MakoHtmlLexer
templating: use .mako as extensions for template files.
r1282 <%namespace name="sourceblock" file="/codeblocks/source.mako"/>
files: use ref names in the url, and make usage of default landing refs....
r4372 <%
at_ref = request.GET.get('at')
if at_ref:
query={'at': at_ref}
default_commit_id = at_ref or c.rhodecode_db_repo.landing_ref_name
else:
query=None
default_commit_id = c.commit.raw_id
%>
files: updated based on new design
r3706 <div id="codeblock" class="browserblock">
<div class="browser-header">
<div class="browser-nav">
<div class="pull-left">
## loads the history for a file
${h.hidden('file_refs_filter')}
</div>
<div class="pull-right">
## Download
% if c.lf_node:
<a class="btn btn-default" href="${h.route_path('repo_file_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path, _query=dict(lf=1))}">
${_('Download largefile')}
</a>
% else:
<a class="btn btn-default" href="${h.route_path('repo_file_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path)}">
${_('Download file')}
</a>
% endif
%if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
## on branch head, can edit files
dan
file: new file editors...
r3754 %if c.on_branch_head and c.branch_or_raw_id:
files: updated based on new design
r3706 ## binary files are delete only
% if c.file.is_binary:
feat(ui): added ability to replace binary file through UI, added related tests. Fixes: RCCE-19
r5274 ${h.link_to(_('Replace'), h.route_path('repo_files_upload_file', repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path, _query={'upload_binary': 'true'}), class_="btn btn-default active tooltip", title=_('You can replace content of your binary file'))}
files: use ref names in the url, and make usage of default landing refs....
r4372 ${h.link_to(_('Delete'), h.route_path('repo_files_remove_file',repo_name=c.repo_name,commit_id=c.branch_or_raw_id,f_path=c.f_path, _query=query),class_="btn btn-danger")}
files: updated based on new design
r3706 % else:
files: use ref names in the url, and make usage of default landing refs....
r4372 <a class="btn btn-default" href="${h.route_path('repo_files_edit_file',repo_name=c.repo_name,commit_id=c.branch_or_raw_id,f_path=c.f_path, _query=query)}">
files: updated based on new design
r3706 ${_('Edit on branch: ')}<code>${c.branch_name}</code>
</a>
files: use ref names in the url, and make usage of default landing refs....
r4372 <a class="btn btn-danger" href="${h.route_path('repo_files_remove_file',repo_name=c.repo_name,commit_id=c.branch_or_raw_id,f_path=c.f_path, _query=query)}">
files: updated based on new design
r3706 ${_('Delete')}
</a>
% endif
## not on head, forbid all
% else:
${h.link_to(_('Edit'), '#Edit', class_="btn btn-default disabled tooltip", title=_('Editing files allowed only when on branch head commit'))}
${h.link_to(_('Delete'), '#Delete', class_="btn btn-default btn-danger disabled tooltip", title=_('Deleting files allowed only when on branch head commit'))}
% endif
%endif
</div>
</div>
<div id="file_history_container"></div>
</div>
</div>
Liviu
fixed path file_source style to match files_tree view
r3722 <div class="codeblock">
<div class=" codeblock-header">
files: moved source path to lower position according to the design
r3715 <div class="file-filename">
ui: links to tags/branches/bookmarks render that in a context of summary page for better navigation.
r4977 <i class="icon-file"></i> ${c.file.name}
files: moved source path to lower position according to the design
r3715 </div>
<div class="file-stats">
files: handle long paths in nicer UI.
r3136
Liviu
fixed path file_source style to match files_tree view
r3722 <div class="stats-info">
dan
file-source: ensure over size limit files never do any content fetching when viewing the files....
r3897 <span class="stats-first-item">
% if c.file_size_too_big:
0 ${(_('lines'))}
% else:
${c.file.lines()[0]} ${_ungettext('line', 'lines', c.file.lines()[0])}
% endif
</span>
files: moved source path to lower position according to the design
r3715
Liviu
fixed path file_source style to match files_tree view
r3722 <span> | ${h.format_byte_size_binary(c.file.size)}</span>
% if c.lf_node:
<span title="${_('This file is a pointer to large binary file')}"> | ${_('LargeFile')} ${h.format_byte_size_binary(c.lf_node.size)} </span>
% endif
dan
file-source: ensure over size limit files never do any content fetching when viewing the files....
r3897 <span>
| ${c.file.mimetype}
</span>
% if not c.file_size_too_big:
<span> |
${h.get_lexer_for_filenode(c.file).__class__.__name__}
</span>
% endif
Liviu
fixed path file_source style to match files_tree view
r3722 </div>
Liviu
file summary and codeblock styles adjustments
r3668 </div>
templating: use .mako as extensions for template files.
r1282 </div>
files: moved source path to lower position according to the design
r3715
Liviu
fixed path file_source style to match files_tree view
r3722 <div class="path clear-fix">
<div class="pull-left">
files: use a common function to handle url-by-refs, and fix landing refs for SVN....
r4373 ${h.files_breadcrumbs(c.repo_name, c.rhodecode_db_repo.repo_type, c.commit.raw_id, c.file.path, c.rhodecode_db_repo.landing_ref_name, request.GET.get('at'))}
files: moved source path to lower position according to the design
r3715 </div>
Liviu
fixed path file_source style to match files_tree view
r3722 <div class="pull-right stats">
<a id="file_history_overview" href="#loadHistory">
${_('History')}
</a>
|
%if c.annotate:
${h.link_to(_('Source'), h.route_path('repo_files', repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path))}
%else:
${h.link_to(_('Annotation'), h.route_path('repo_files:annotated',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path))}
%endif
| ${h.link_to(_('Raw'), h.route_path('repo_file_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path))}
files: don't expose copy content if this is a binary file
r4043 % if not c.file.is_binary:
ui: make copy content actions not use grey....
r4100 |<a href="#copySource" onclick="return false;" class="no-grey clipboard-action" data-clipboard-text="${c.file.content}">${_('Copy content')}</a>
files: fixed label for copy-path action.
r4369 |<a href="#copyPermaLink" onclick="return false;" class="no-grey clipboard-action" data-clipboard-text="${h.route_url('repo_files', repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path)}">${_('Copy permalink')}</a>
files: don't expose copy content if this is a binary file
r4043 % endif
files: moved source path to lower position according to the design
r3715
Liviu
fixed path file_source style to match files_tree view
r3722 </div>
<div class="clear-fix"></div>
</div>
<div class="code-body clear-fix ">
%if c.file.is_binary:
<% rendered_binary = h.render_binary(c.repo_name, c.file)%>
% if rendered_binary:
files: fixed unicode problems on image preview, and make images center, no-stretch.
r4344 <div class="text-center">
Liviu
fixed path file_source style to match files_tree view
r3722 ${rendered_binary}
files: fixed unicode problems on image preview, and make images center, no-stretch.
r4344 </div>
Liviu
fixed path file_source style to match files_tree view
r3722 % else:
<div>
dan
file-source: ensure over size limit files never do any content fetching when viewing the files....
r3897 ${_('Binary file ({})').format(c.file.mimetype)}
Liviu
fixed path file_source style to match files_tree view
r3722 </div>
% endif
%else:
dan
file-source: ensure over size limit files never do any content fetching when viewing the files....
r3897 % if c.file_size_too_big:
${_('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'),
h.route_path('repo_file_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path))}
% else:
%if c.renderer and not c.annotate:
## pick relative url based on renderer
<%
relative_urls = {
'raw': h.route_path('repo_file_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path),
'standard': h.route_path('repo_files',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path),
}
%>
templates: use string content when possible
r5044 ${h.render(c.file.str_content, renderer=c.renderer, relative_urls=relative_urls)}
templating: use .mako as extensions for template files.
r1282 %else:
dan
file-source: ensure over size limit files never do any content fetching when viewing the files....
r3897 <table class="cb codehilite">
%if c.annotate:
<% color_hasher = h.color_hasher() %>
%for annotation, lines in c.annotated_lines:
${sourceblock.render_annotation_lines(annotation, lines, color_hasher)}
%endfor
%else:
%for line_num, tokens in enumerate(c.lines, 1):
${sourceblock.render_line(line_num, tokens)}
%endfor
%endif
</table>
templating: use .mako as extensions for template files.
r1282 %endif
dan
file-source: ensure over size limit files never do any content fetching when viewing the files....
r3897 % endif
templating: use .mako as extensions for template files.
r1282 %endif
</div>
files: moved source path to lower position according to the design
r3715
</div>
dan
files: added option to use highlight marker to show keywords inside file source.
r3315
<script type="text/javascript">
% if request.GET.get('mark'):
$(function(){
$(".codehilite").mark(
"${request.GET.get('mark')}",
{
"className": 'match',
"accuracy": "complementary",
"ignorePunctuation": ":._(){}[]!'+=".split(""),
"each": function(el) {
// and also highlight lines !
$($(el).closest('tr')).find('td.cb-lineno').addClass('cb-line-selected');
}
}
);
});
% endif
</script>