files: restructure the files views for easier restyling

This commit is contained in:
Marcin Kuzminski 2019-05-06 18:06:00 +02:00
parent a547755acc
commit 57b0240056
6 changed files with 39 additions and 43 deletions

View file

@ -1,16 +1,5 @@
<%namespace name="base" file="/base/base.mako"/>
<div class="summary-detail-header">
<h4 class="item">
% if c.file_author:
${_('Last Author')}
% else:
${h.literal(_ungettext(u'File Author (%s)',u'File Authors (%s)',len(c.authors)) % ('<b>%s</b>' % len(c.authors))) }
% endif
</h4>
<a href="#" id="show_authors" class="action_link">${_('Show All')}</a>
</div>
% if c.authors:
<ul class="sidebar-right-content">
% for email, user, commits in sorted(c.authors, key=lambda e: c.file_last_commit.author_email!=e[0]):

View file

@ -1,12 +0,0 @@
<%namespace name="base" file="/base/base.mako"/>
<div class="summary-detail-header">
<h4 class="item">
${_('Commit Author')}
</h4>
</div>
<div class="sidebar-right-content">
${base.gravatar_with_user(c.commit.author)}
<div class="user-inline-data">- ${h.age_component(c.commit.date)}</div>
</div>

View file

@ -205,6 +205,7 @@
timeout: pjaxTimeout
}).complete(function(){
$('#show_authors').hide();
$('#file_authors_title').html(_gettext('All Authors'))
})
});

View file

@ -1,7 +1,7 @@
<%def name="title(*args)">
${_('%s Files') % c.repo_name}
${_('{} Files').format(c.repo_name)}
%if hasattr(c,'file'):
&middot; ${h.safe_unicode(c.file.path) or '\\'}
&middot; ${(h.safe_unicode(c.file.path) or '\\')}
%endif
%if c.rhodecode_name:
@ -10,6 +10,11 @@
</%def>
<div id="pjax-content" data-title="${self.title()}">
<script>
// set the pageSource variable
var fileSourcePage = ${c.file_source_page};
</script>
<div class="summary-detail">
<div class="summary-detail-header">
<div class="breadcrumbs files_location">
@ -28,28 +33,17 @@
% if c.file.is_submodule():
<span class="submodule-dir">Submodule ${h.escape(c.file.name)}</span>
% elif c.file.is_dir():
<%include file='file_tree_detail.mako'/>
<%include file='files_tree_header.mako'/>
% else:
<%include file='files_detail.mako'/>
<%include file='files_source_header.mako'/>
% endif
</div> <!--end summary-detail-->
<script>
// set the pageSource variable
var fileSourcePage = ${c.file_source_page};
</script>
% if c.file.is_dir():
<div id="commit-stats" class="sidebar-right">
<%include file='file_tree_author_box.mako'/>
</div>
% if c.file.is_dir():
<%include file='files_browser.mako'/>
% else:
<div id="file_authors" class="sidebar-right">
<%include file='file_authors_box.mako'/>
</div>
<%include file='files_source.mako'/>
% endif
</div>
</div>

View file

@ -1,3 +1,4 @@
<%namespace name="base" file="/base/base.mako"/>
<%namespace name="file_base" file="/files/base.mako"/>
<div class="fieldset collapsable-content no-hide" data-toggle="summary-details">
@ -63,7 +64,22 @@
</div>
</div>
<div class="fieldset collapsable-content" data-toggle="summary-details">
<div class="left-label" id="file_authors_title">
% if c.file_author:
${_('Last Author')}
% else:
${h.literal(_ungettext(u'File Author (%s)',u'File Authors (%s)',len(c.authors)) % ('<b>%s</b>' % len(c.authors))) }
% endif
<a href="#" id="show_authors" class="action_link">${_('Show All')}</a>
</div>
<div class="right-content" id="file_authors">
## loads single author, or ALL
<%include file='file_authors_box.mako'/>
</div>
</div>
<script>
collapsableContent();
</script>
</script>

View file

@ -1,3 +1,4 @@
<%namespace name="base" file="/base/base.mako"/>
<%namespace name="file_base" file="/files/base.mako"/>
<div class="fieldset collapsable-content no-hide" data-toggle="summary-details">
@ -14,8 +15,6 @@
<div class="commit right-content">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div>
</div>
<div class="fieldset">
<div class="left-label">
${_('References')}:
@ -31,6 +30,15 @@
</div>
</div>
<div class="fieldset">
<div class="left-label">
${_('Commit Author')}:
</div>
<div class="right-content">
${base.gravatar_with_user(c.commit.author)}
<div class="user-inline-data">- ${h.age_component(c.commit.date)}</div>
</div>
</div>
<script>
collapsableContent();