Changeset - 61eda8bf70d0
[Not reviewed]
rhodecode/controllers/files.py
Show inline comments
 
@@ -162,9 +162,9 @@ class FilesController(BaseRepoController
 

	
 
        #files or dirs
 
        try:
 
            c.files_list = c.changeset.get_node(f_path)
 
            c.file = c.changeset.get_node(f_path)
 

	
 
            if c.files_list.is_file():
 
            if c.file.is_file():
 
                c.file_history = self._get_node_history(c.changeset, f_path)
 
            else:
 
                c.file_history = []
rhodecode/public/css/pygments.css
Show inline comments
 
@@ -7,15 +7,47 @@ div.codeblock {
 
    line-height: 100%;
 
    /* new */
 
    line-height: 125%;
 
    -webkit-border-radius: 4px;
 
    -moz-border-radius: 4px;
 
    border-radius: 4px;     
 
}
 
div.codeblock .code-header{
 
	border-bottom: 1px solid #CCCCCC;
 
	background: #EEEEEE;
 
	padding:10px 0 10px 0;
 
}
 
div.codeblock .code-header .revision{
 

	
 
div.codeblock .code-header .stats{
 
	clear: both;
 
	margin-top:-3px; 
 
	padding-left: 8px; 
 
	border-bottom: 1px solid rgb(204, 204, 204); 
 
	margin-bottom: 5px; height: 23px;
 
}
 

	
 
div.codeblock .code-header .stats .left{
 
	float:left;
 
}
 
div.codeblock .code-header .stats .left.item{
 
	float:left;
 
	padding: 0 9px 0 9px;
 
	border-right:1px solid #ccc;
 
}
 
div.codeblock .code-header .stats .left.item.last{
 
	border-right:none;
 
}
 
div.codeblock .code-header .stats .buttons{
 
	float:right;
 
	padding-right:4px;
 
}
 

	
 
div.codeblock .code-header .author{
 
	margin-left:25px;
 
	font-weight: bold;
 
	height: 25px;
 
}
 
div.codeblock .code-header .author .user{
 
	padding-top:3px;
 
}
 
div.codeblock .code-header .commit{
 
	margin-left:25px;
rhodecode/public/css/style.css
Show inline comments
 
@@ -642,20 +642,22 @@ div.options a {
 
}
 
 
.quick_repo_menu {
 
	background: #FFF url("../images/vertical-indicator.png") 8px 50%
 
		no-repeat !important;
 
	background: #FFF url("../images/vertical-indicator.png") 8px 50% no-repeat !important;
 
	cursor: pointer;
 
	width: 8px;
 
	border: 1px solid transparent;
 
}
 
 
.quick_repo_menu.active {
 
	background: #FFF url("../images/horizontal-indicator.png") 4px 50%
 
		no-repeat !important;
 
	cursor: pointer;
 
    background: url("../images/horizontal-indicator.png") no-repeat scroll 5px 50% #FFFFFF !important;
 
    border: 1px solid #003367;
 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
 
    cursor: pointer;
 
}
 
 
.quick_repo_menu .menu_items {
 
	margin-top: 6px;
 
	margin-top: 10px;
 
	margin-left:-6px;
 
	width: 150px;
 
	position: absolute;
 
	background-color: #FFF;
 
@@ -664,7 +666,8 @@ div.options a {
 
	border-right: 1px solid #666666;
 
	border-style: solid;
 
	border-width: 1px;
 
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
 
	box-shadow: 2px 8px 4px rgba(0, 0, 0, 0.2);
 
	border-top-style: none;
 
}
 
 
.quick_repo_menu .menu_items li {
 
@@ -807,7 +810,7 @@ div.options a {
 
}
 
 
#content div.box dl {
 
	margin: 10px 24px;
 
	margin: 10px 0px;
 
}
 
 
#content div.box dt {
 
@@ -1825,7 +1828,7 @@ h3.files_location {
 
 
#files_data dl dt {
 
	float: left;
 
	width: 115px;
 
	width: 60px;
 
	margin: 0 !important;
 
	padding: 5px;
 
}
rhodecode/templates/files/files.html
Show inline comments
 
@@ -10,7 +10,7 @@
 
    ${h.link_to(c.repo_name,h.url('files_home',repo_name=c.repo_name))}
 
    »
 
    ${_('files')}
 
    %if c.files_list:
 
    %if c.file:
 
        @ r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)}
 
    %endif        
 
</%def>
 
@@ -39,8 +39,8 @@
 
<script type="text/javascript">
 
var YPJAX_TITLE = "${c.repo_name} ${_('Files')} - ${c.rhodecode_name}";
 
var current_url = "${h.url.current()}";
 
var node_list_url = '${h.url("files_home",repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.files_list.path)}';
 
var url_base = '${h.url("files_nodelist_home",repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.files_list.path)}';
 
var node_list_url = '${h.url("files_home",repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.file.path)}';
 
var url_base = '${h.url("files_nodelist_home",repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.file.path)}';
 
var truncated_lbl = "${_('search truncated')}";
 
var nomatch_lbl = "${_('no matching files')}";
 
fileBrowserListeners(current_url, node_list_url, url_base, truncated_lbl, nomatch_lbl);
rhodecode/templates/files/files_annotate.html
Show inline comments
 
@@ -29,29 +29,8 @@
 
    <div class="table">
 
		<div id="files_data">
 
			<h3 class="files_location">${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cs.revision,c.file.path)}</h3>
 
			<dl class="overview">
 
				<dt>${_('Revision')}</dt>
 
				<dd>${h.link_to("r%s:%s" % (c.file.last_changeset.revision,h.short_id(c.file.last_changeset.raw_id)),
 
						h.url('changeset_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id))} </dd>
 
				<dt>${_('Size')}</dt>
 
				<dd>${h.format_byte_size(c.file.size,binary=True)}</dd>
 
    			<dt>${_('Mimetype')}</dt>
 
				<dd>${c.file.mimetype}</dd>				
 
				<dt>${_('Options')}</dt>
 
				<dd>${h.link_to(_('show source'),
 
						h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path))}  
 
					/ ${h.link_to(_('show as raw'),
 
						h.url('files_raw_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path))}
 
					/ ${h.link_to(_('download as raw'),
 
						h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path))}
 
                    % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
 
                     % if not c.file.is_binary:                   
 
                    / ${h.link_to(_('edit'),
 
                        h.url('files_edit_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path))}
 
                     % endif 
 
                    % endif						
 
				</dd>
 
			    <dt>${_('History')}</dt>
 
			<dl>
 
			    <dt style="padding-top:10px;font-size:16px">${_('History')}</dt>
 
			    <dd>
 
			        <div>
 
			        ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')}
 
@@ -64,10 +43,31 @@
 
			    </dd>					
 
			</dl>
 
			<div id="body" class="codeblock">
 
				<div class="code-header">
 
					<div class="revision">${c.file.name}@r${c.file.last_changeset.revision}:${h.short_id(c.file.last_changeset.raw_id)}</div>
 
					<div class="commit">"${c.file.message}"</div>
 
				</div>
 
                <div class="code-header">
 
                    <div class="stats">
 
                        <div class="left"><img src="${h.url('/images/icons/file.png')}"/></div>
 
                        <div class="left item">${h.link_to("r%s:%s" % (c.file.last_changeset.revision,h.short_id(c.file.last_changeset.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id))}</div>      
 
                        <div class="left item">${h.format_byte_size(c.file.size,binary=True)}</div>
 
                        <div class="left item last">${c.file.mimetype}</div>
 
                        <div class="buttons">
 
                          ${h.link_to(_('show source'),h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-button-small")}
 
                          ${h.link_to(_('show as raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-button-small")}           
 
                          ${h.link_to(_('download as raw'),h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-button-small")}
 
                          % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):            
 
                           % if not c.file.is_binary:
 
                            ${h.link_to(_('edit'),h.url('files_edit_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-button-small")}
 
                           % endif
 
                          % endif            
 
                        </div>
 
                    </div>
 
                    <div class="author">
 
                        <div class="gravatar">
 
                            <img alt="gravatar" src="${h.gravatar_url(h.email(c.cs.author),16)}"/>
 
                        </div>
 
                        <div title="${h.email_or_none(c.cs.author)}" class="user">${h.person(c.cs.author)}</div>
 
                    </div>
 
                    <div class="commit">${c.file.last_changeset.message}</div>
 
                </div>
 
				<div class="code-body">
 
			       %if c.file.is_binary:
 
			           ${_('Binary file (%s)') % c.file.mimetype}
rhodecode/templates/files/files_browser.html
Show inline comments
 
@@ -34,7 +34,7 @@
 
        <div>
 
            <div id="node_filter_box_loading" style="display:none">${_('Loading file list...')}</div>
 
            <div id="node_filter_box" style="display:none">
 
            ${h.files_breadcrumbs(c.repo_name,c.changeset.raw_id,c.files_list.path)}/<input type="text" value="type to search..." name="filter" size="25" id="node_filter" autocomplete="off">
 
            ${h.files_breadcrumbs(c.repo_name,c.changeset.raw_id,c.file.path)}/<input type="text" value="type to search..." name="filter" size="25" id="node_filter" autocomplete="off">
 
            </div>        
 
        </div>
 
        </div>      
 
@@ -54,10 +54,10 @@
 
		         </thead>
 
                
 
                <tbody id="tbody">
 
          		%if c.files_list.parent:
 
          		%if c.file.parent:
 
         		<tr class="parity0">
 
	          		<td>		          		
 
	          			${h.link_to('..',h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.files_list.parent.path),class_="browser-dir ypjax-link")}
 
	          			${h.link_to('..',h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.file.parent.path),class_="browser-dir ypjax-link")}
 
	          		</td>
 
	          		<td></td>
 
	          		<td></td>
 
@@ -67,7 +67,7 @@
 
				</tr>
 
          		%endif
 
		         	
 
		    %for cnt,node in enumerate(c.files_list):
 
		    %for cnt,node in enumerate(c.file):
 
				<tr class="parity${cnt%2}">
 
		             <td>
 
						${h.link_to(node.name,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=h.safe_unicode(node.path)),class_=file_class(node)+" ypjax-link")}
rhodecode/templates/files/files_edit.html
Show inline comments
 
@@ -39,6 +39,25 @@
 
			<h3 class="files_location">${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cs.revision,c.file.path)}</h3>
 
			${h.form(h.url.current(),method='post',id='eform')}
 
			<div id="body" class="codeblock">
 
            <div class="code-header">
 
                <div class="stats">
 
                    <div class="left"><img src="${h.url('/images/icons/file.png')}"/></div>
 
                    <div class="left item">${h.link_to("r%s:%s" % (c.file.last_changeset.revision,h.short_id(c.file.last_changeset.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id))}</div>      
 
                    <div class="left item">${h.format_byte_size(c.file.size,binary=True)}</div>
 
                    <div class="left item last">${c.file.mimetype}</div>
 
                    <div class="buttons">
 
                      ${h.link_to(_('show annotation'),h.url('files_annotate_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-button-small")}
 
                      ${h.link_to(_('show as raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-button-small")}           
 
                      ${h.link_to(_('download as raw'),h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-button-small")}
 
                      % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):            
 
                       % if not c.file.is_binary:
 
                        ${h.link_to(_('source'),h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="ui-button-small")}
 
                       % endif
 
                      % endif            
 
                    </div>
 
                </div>
 
                <div class="commit">${_('Editing file')}: ${c.file.path}</div>
 
            </div>      
 
			    <pre id="editor_pre"></pre>
 
				<textarea id="editor" name="content" style="display:none">${c.file.content|n}</textarea>
 
				<div style="padding: 10px;color:#666666">${_('commit message')}</div>
rhodecode/templates/files/files_source.html
Show inline comments
 
<dl>
 
	<dt>${_('Revision')}</dt>
 
	<dd>
 
		${h.link_to("r%s:%s" % (c.files_list.last_changeset.revision,h.short_id(c.files_list.last_changeset.raw_id)),
 
						h.url('changeset_home',repo_name=c.repo_name,revision=c.files_list.last_changeset.raw_id))} 
 
	</dd>
 
	<dt>${_('Size')}</dt>
 
	<dd>${h.format_byte_size(c.files_list.size,binary=True)}</dd>
 
	<dt>${_('Mimetype')}</dt>
 
	<dd>${c.files_list.mimetype}</dd>
 
	<dt>${_('Options')}</dt>
 
	<dd>${h.link_to(_('show annotation'),
 
			h.url('files_annotate_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))}
 
		 / ${h.link_to(_('show as raw'),
 
			h.url('files_raw_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))}			
 
		 / ${h.link_to(_('download as raw'),
 
			h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))}
 
        % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):			
 
         % if not c.files_list.is_binary:
 
         / ${h.link_to(_('edit'),
 
            h.url('files_edit_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))}
 
         % endif
 
        % endif			
 
	</dd>
 
	<dt>${_('History')}</dt>
 
	<dt style="padding-top:10px;font-size:16px">${_('History')}</dt>
 
	<dd>
 
		<div>
 
		${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')}
 
		${h.hidden('diff2',c.files_list.last_changeset.raw_id)}
 
		${h.select('diff1',c.files_list.last_changeset.raw_id,c.file_history)}
 
		${h.hidden('diff2',c.file.last_changeset.raw_id)}
 
		${h.select('diff1',c.file.last_changeset.raw_id,c.file_history)}
 
		${h.submit('diff','diff to revision',class_="ui-button-small")}
 
		${h.submit('show_rev','show at revision',class_="ui-button-small")}
 
		${h.end_form()}
 
		</div>
 
	</dd>
 
</dl>	
 
</dl>
 

	
 
	
 
<div id="body" class="codeblock">
 
	<div class="code-header">
 
		<div class="revision">${c.files_list.name}@r${c.files_list.last_changeset.revision}:${h.short_id(c.files_list.last_changeset.raw_id)}</div>
 
		<div class="commit">"${c.files_list.last_changeset.message}"</div>
 
        <div class="stats">
 
            <div class="left"><img src="${h.url('/images/icons/file.png')}"/></div>
 
            <div class="left item">${h.link_to("r%s:%s" % (c.file.last_changeset.revision,h.short_id(c.file.last_changeset.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id))}</div>      
 
            <div class="left item">${h.format_byte_size(c.file.size,binary=True)}</div>
 
            <div class="left item last">${c.file.mimetype}</div>
 
            <div class="buttons">
 
              ${h.link_to(_('show annotation'),h.url('files_annotate_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path),class_="ui-button-small")}
 
              ${h.link_to(_('show as raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path),class_="ui-button-small")}           
 
              ${h.link_to(_('download as raw'),h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path),class_="ui-button-small")}
 
              % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):            
 
               % if not c.file.is_binary:
 
                ${h.link_to(_('edit'),h.url('files_edit_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path),class_="ui-button-small")}
 
               % endif
 
              % endif            
 
            </div>
 
        </div>
 
        <div class="author">
 
            <div class="gravatar">
 
                <img alt="gravatar" src="${h.gravatar_url(h.email(c.changeset.author),16)}"/>
 
            </div>
 
            <div title="${h.email_or_none(c.changeset.author)}" class="user">${h.person(c.changeset.author)}</div>
 
        </div>
 
		<div class="commit">${c.file.last_changeset.message}</div>
 
	</div>
 
	<div class="code-body">
 
	   %if c.files_list.is_binary:
 
	       ${_('Binary file (%s)') % c.files_list.mimetype}
 
	   %if c.file.is_binary:
 
	       ${_('Binary file (%s)') % c.file.mimetype}
 
	   %else:
 
		% if c.files_list.size < c.cut_off_limit:
 
			${h.pygmentize(c.files_list,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")}
 
		% if c.file.size < c.cut_off_limit:
 
			${h.pygmentize(c.file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")}
 
		%else:
 
			${_('File is too big to display')} ${h.link_to(_('show as raw'),
 
			h.url('files_raw_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))}
rhodecode/templates/files/files_ypjax.html
Show inline comments
 
%if c.files_list:
 
%if c.file:
 
    <h3 class="files_location">
 
        ${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.changeset.raw_id,c.files_list.path)}
 
        ${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.changeset.raw_id,c.file.path)}
 
    </h3>
 
        %if c.files_list.is_dir():
 
        %if c.file.is_dir():
 
            <%include file='files_browser.html'/>
 
        %else:
 
            <%include file='files_source.html'/>            
rhodecode/templates/index_base.html
Show inline comments
 
@@ -66,6 +66,7 @@
 
                <tr class="parity${cnt%2}">
 
                    <td class="quick_repo_menu">
 
                    <ul class="menu_items hidden">
 
                      <li style="border-top:1px solid #003367;margin-left:18px;padding-left:-99px"></li>
 
                      <li>
 
                         <a title="${_('Summary')}" href="${h.url('summary_home',repo_name=repo['name'])}">
 
                         <span class="icon">
rhodecode/tests/functional/test_files.py
Show inline comments
 
@@ -129,11 +129,11 @@ class TestFilesController(TestController
 
</optgroup>""" in response.body
 

	
 

	
 
        assert """<div class="commit">"Partially implemented #16. filecontent/commit message/author/node name are safe_unicode now.
 
        assert """<div class="commit">Partially implemented #16. filecontent/commit message/author/node name are safe_unicode now.
 
In addition some other __str__ are unicode as well
 
Added test for unicode
 
Improved test to clone into uniq repository.
 
removed extra unicode conversion in diff."</div>""" in response.body
 
removed extra unicode conversion in diff.</div>""" in response.body
 

	
 
        assert """<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""" in response.body, 'missing or wrong branch info'
 

	
0 comments (0 inline, 0 general)