files_browser_tree.mako
116 lines
| 5.0 KiB
| application/x-mako
|
MakoHtmlLexer
r4032 | <%namespace name="base" file="/base/base.mako"/> | |||
r5261 | <%doc> | |||
Please note the content of this file is cached, so changes here might not be reflected when editing. | ||||
add ?no-cache=true into the file url to disable caches. | ||||
e.g | ||||
http://docker-dev:10020/ipython/files/master/IPython/frontend/html/notebook/static?no-cache=1 | ||||
</%doc> | ||||
r3655 | <% | |||
r4372 | at_ref = request.GET.get('at') | |||
if at_ref: | ||||
query={'at': at_ref} | ||||
r4373 | default_landing_ref = at_ref or c.rhodecode_db_repo.landing_ref_name | |||
r3655 | else: | |||
query=None | ||||
r4373 | default_landing_ref = c.commit.raw_id | |||
r3655 | %> | |||
<div id="file-tree-wrapper" class="browser-body ${('full-load' if c.full_load else '')}"> | ||||
r4511 | <table class="code-browser rctable table-bordered"> | |||
r1282 | <thead> | |||
<tr> | ||||
<th>${_('Name')}</th> | ||||
<th>${_('Size')}</th> | ||||
<th>${_('Modified')}</th> | ||||
<th>${_('Last Commit')}</th> | ||||
<th>${_('Author')}</th> | ||||
</tr> | ||||
</thead> | ||||
<tbody id="tbody"> | ||||
r3706 | <tr> | |||
<td colspan="5"> | ||||
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'), limit_items=True)} | |||
r1282 | </td> | |||
r3706 | </tr> | |||
r3941 | ||||
<% has_files = False %> | ||||
r5261 | % if not c.file.is_submodule(): | |||
% for cnt, node in enumerate(c.file): | ||||
<% has_files = True %> | ||||
<tr class="parity${(cnt % 2)}"> | ||||
<td class="td-componentname"> | ||||
% if node.is_submodule(): | ||||
<span class="submodule-dir"> | ||||
% if node.url.startswith('http://') or node.url.startswith('https://'): | ||||
<a href="${node.url}"> | ||||
<i class="icon-directory browser-dir"></i><span class="tooltip-hovercard" data-hovercard-alt="${node.url}" data-hovercard-url="javascript:renderTemplate('submoduleHovercard', {'submodule_url':'${node.url}'})">${node.name}</span> | ||||
</a> | ||||
% else: | ||||
<i class="icon-directory browser-dir"></i><span class="tooltip-hovercard" data-hovercard-alt="${node.url}" data-hovercard-url="javascript:renderTemplate('submoduleHovercard', {'submodule_url':'${node.url}'})">${node.name}</span> | ||||
% endif | ||||
</span> | ||||
% else: | ||||
<a href="${h.repo_files_by_ref_url(c.repo_name, c.rhodecode_db_repo.repo_type, f_path=h.safe_str(node.path), ref_name=default_landing_ref, commit_id=c.commit.raw_id, query=query)}"> | ||||
<i class="${('icon-file-text browser-file' if node.is_file() else 'icon-directory browser-dir')}"></i>${node.name} | ||||
r1282 | </a> | |||
% endif | ||||
r5261 | </td> | |||
%if node.is_file(): | ||||
<td class="td-size" data-attr-name="size"> | ||||
% if c.full_load: | ||||
<span data-size="${node.size}">${h.format_byte_size_binary(node.size)}</span> | ||||
% else: | ||||
${_('Loading ...')} | ||||
% endif | ||||
</td> | ||||
<td class="td-time" data-attr-name="modified_at"> | ||||
% if c.full_load: | ||||
<span data-date="${node.last_commit.date}">${h.age_component(node.last_commit.date)}</span> | ||||
% endif | ||||
</td> | ||||
<td class="td-hash" data-attr-name="commit_id"> | ||||
% if c.full_load: | ||||
<div class="tooltip-hovercard" data-hovercard-alt="${node.last_commit.message}" data-hovercard-url="${h.route_path('hovercard_repo_commit', repo_name=c.repo_name, commit_id=node.last_commit.raw_id)}"> | ||||
<pre data-commit-id="${node.last_commit.raw_id}">r${node.last_commit.idx}:${node.last_commit.short_id}</pre> | ||||
</div> | ||||
% endif | ||||
</td> | ||||
<td class="td-user" data-attr-name="author"> | ||||
% if c.full_load: | ||||
<span data-author="${node.last_commit.author}">${h.gravatar_with_user(request, node.last_commit.author, tooltip=True)|n}</span> | ||||
% endif | ||||
</td> | ||||
%else: | ||||
<td></td> | ||||
<td></td> | ||||
<td></td> | ||||
<td></td> | ||||
%endif | ||||
</tr> | ||||
% endfor | ||||
% endif | ||||
r3941 | ||||
% if not has_files: | ||||
<tr> | ||||
<td colspan="5"> | ||||
##empty-dir mostly SVN | ||||
r5261 | ||||
## submodule if we somehow endup | ||||
% if c.file.is_submodule(): | ||||
r5262 | <span class="submodule-dir"> | |||
<strong>Submodule Node</strong><br/> | ||||
${h.escape(c.file.name)} | ||||
<pre>${c.file.url}</pre> | ||||
</span> | ||||
r5261 | %endif | |||
r3941 | </td> | |||
</tr> | ||||
% endif | ||||
r1282 | </tbody> | |||
<tbody id="tbody_filtered"></tbody> | ||||
</table> | ||||
</div> | ||||