Changeset - 61eda8bf70d0
[Not reviewed]
rhodecode/controllers/files.py
Show inline comments
 
@@ -141,51 +141,51 @@ class FilesController(BaseRepoController
 
        cur_rev = c.changeset.revision
 

	
 
        #prev link
 
        try:
 
            prev_rev = c.rhodecode_repo.get_changeset(cur_rev).prev(c.branch)
 
            c.url_prev = url('files_home', repo_name=c.repo_name,
 
                         revision=prev_rev.raw_id, f_path=f_path)
 
            if c.branch:
 
                c.url_prev += '?branch=%s' % c.branch
 
        except (ChangesetDoesNotExistError, VCSError):
 
            c.url_prev = '#'
 

	
 
        #next link
 
        try:
 
            next_rev = c.rhodecode_repo.get_changeset(cur_rev).next(c.branch)
 
            c.url_next = url('files_home', repo_name=c.repo_name,
 
                     revision=next_rev.raw_id, f_path=f_path)
 
            if c.branch:
 
                c.url_next += '?branch=%s' % c.branch
 
        except (ChangesetDoesNotExistError, VCSError):
 
            c.url_next = '#'
 

	
 
        #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 = []
 
        except RepositoryError, e:
 
            h.flash(str(e), category='warning')
 
            redirect(h.url('files_home', repo_name=repo_name,
 
                           revision=revision))
 

	
 
        return render('files/files.html')
 

	
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
 
    def rawfile(self, repo_name, revision, f_path):
 
        cs = self.__get_cs_or_redirect(revision, repo_name)
 
        file_node = self.__get_filenode_or_redirect(repo_name, cs, f_path)
 

	
 
        response.content_disposition = 'attachment; filename=%s' % \
 
            safe_str(f_path.split(os.sep)[-1])
 

	
 
        response.content_type = file_node.mimetype
 
        return file_node.content
 

	
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
rhodecode/public/css/pygments.css
Show inline comments
 
div.codeblock {
 
    overflow: auto;
 
    padding: 0px;
 
    border: 1px solid #ccc;
 
    background: #f8f8f8;
 
    font-size: 100%;
 
    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;
 
	font-weight: normal;
 
	white-space:pre;
 
}
 

	
 
div.codeblock .code-body table{
 
    width: 0 !important;
 
    border: 0px !important;
 
}
 
div.codeblock .code-body table td {
 
	border: 0px !important;
 
}
 
div.code-body {
 
	background-color: #FFFFFF;
 
}
 
div.code-body pre .match{
 
	background-color: #FAFFA6;
 
}
 
div.code-body pre .break{
 
	background-color: #DDE7EF;
 
	width: 100%;
 
	color: #747474;
rhodecode/public/css/style.css
Show inline comments
 
@@ -621,71 +621,74 @@ div.options a {
 
	background: #FFF url("../images/icons/tag_blue.png") no-repeat 4px 9px;
 
	width: 167px;
 
	margin: 0;
 
	padding: 12px 9px 7px 24px;
 
}
 
 
#header #header-inner #quick li ul li a.admin,#header #header-inner #quick li ul li a.admin:hover
 
	{
 
	background: #FFF url("../images/icons/cog_edit.png") no-repeat 4px 9px;
 
	width: 167px;
 
	margin: 0;
 
	padding: 12px 9px 7px 24px;
 
}
 
 
.groups_breadcrumbs a {
 
	color: #fff;
 
}
 
 
.groups_breadcrumbs a:hover {
 
	color: #bfe3ff;
 
	text-decoration: none;
 
}
 
 
.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;
 
	background: none repeat scroll 0 0 #FFFFFF;
 
	border-color: #003367 #666666 #666666;
 
	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 {
 
	padding: 0 !important;
 
}
 
 
.quick_repo_menu .menu_items a {
 
	display: block;
 
	padding: 4px 12px 4px 8px;
 
}
 
 
.quick_repo_menu .menu_items a:hover {
 
	background-color: #EEE;
 
	text-decoration: none;
 
}
 
 
.quick_repo_menu .menu_items .icon img {
 
	margin-bottom: -2px;
 
}
 
 
.quick_repo_menu .menu_items.hidden {
 
	display: none;
 
}
 
 
@@ -786,49 +789,49 @@ div.options a {
 
 
#content div.box p {
 
	color: #5f5f5f;
 
	font-size: 12px;
 
	line-height: 150%;
 
	margin: 0 24px 10px;
 
	padding: 0;
 
}
 
 
#content div.box blockquote {
 
	border-left: 4px solid #DDD;
 
	color: #5f5f5f;
 
	font-size: 11px;
 
	line-height: 150%;
 
	margin: 0 34px;
 
	padding: 0 0 0 14px;
 
}
 
 
#content div.box blockquote p {
 
	margin: 10px 0;
 
	padding: 0;
 
}
 
 
#content div.box dl {
 
	margin: 10px 24px;
 
	margin: 10px 0px;
 
}
 
 
#content div.box dt {
 
	font-size: 12px;
 
	margin: 0;
 
}
 
 
#content div.box dd {
 
	font-size: 12px;
 
	margin: 0;
 
	padding: 8px 0 8px 15px;
 
}
 
 
#content div.box li {
 
	font-size: 12px;
 
	padding: 4px 0;
 
}
 
 
#content div.box ul.disc,#content div.box ul.circle {
 
	margin: 10px 24px 10px 38px;
 
}
 
 
#content div.box ul.square {
 
	margin: 10px 24px 10px 40px;
 
@@ -1804,49 +1807,49 @@ div.form div.fields div.field div.button
 
}
 
 
.trending_language {
 
	background-color: #003367;
 
	color: #FFF;
 
	display: block;
 
	min-width: 20px;
 
	text-decoration: none;
 
	height: 12px;
 
	margin-bottom: 0px;
 
	margin-left: 5px;
 
	white-space: pre;
 
	padding: 3px;
 
}
 
 
h3.files_location {
 
	font-size: 1.8em;
 
	font-weight: 700;
 
	border-bottom: none !important;
 
	margin: 10px 0 !important;
 
}
 
 
#files_data dl dt {
 
	float: left;
 
	width: 115px;
 
	width: 60px;
 
	margin: 0 !important;
 
	padding: 5px;
 
}
 
 
#files_data dl dd {
 
	margin: 0 !important;
 
	padding: 5px !important;
 
}
 
 
#changeset_content {
 
	border: 1px solid #CCC;
 
	padding: 5px;
 
}
 
 
#changeset_compare_view_content {
 
	border: 1px solid #CCC;
 
	padding: 5px;
 
}
 
 
#changeset_content .container {
 
	min-height: 120px;
 
	font-size: 1.2em;
 
	overflow: hidden;
 
}
rhodecode/templates/files/files.html
Show inline comments
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${c.repo_name} ${_('Files')} - ${c.rhodecode_name}
 
</%def>
 

	
 
<%def name="breadcrumbs_links()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    &raquo;
 
    ${h.link_to(c.repo_name,h.url('files_home',repo_name=c.repo_name))}
 
    &raquo;
 
    ${_('files')}
 
    %if c.files_list:
 
    %if c.file:
 
        @ r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)}
 
    %endif        
 
</%def>
 

	
 
<%def name="page_nav()">
 
    ${self.menu('files')}     
 
</%def>
 

	
 
<%def name="main()">
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
	    <ul class="links">
 
		    <li>
 
		      <span style="text-transform: uppercase;"><a href="#">${_('branch')}: ${c.changeset.branch}</a></span>
 
	        </li>          
 
	    </ul>             
 
    </div>
 
    <div class="table">
 
		<div id="files_data">
 
			<%include file='files_ypjax.html'/>
 
		</div>    
 
    </div>
 
</div>    
 
<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);
 
</script>
 
</%def>
 
\ No newline at end of file
rhodecode/templates/files/files_annotate.html
Show inline comments
 
@@ -8,87 +8,87 @@
 
    ${h.link_to(u'Home',h.url('/'))}
 
    &raquo;
 
    ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
 
    &raquo;
 
    ${_('annotate')} @ R${c.cs.revision}:${h.short_id(c.cs.raw_id)}
 
</%def>
 

	
 
<%def name="page_nav()">
 
		${self.menu('files')}     
 
</%def>
 
<%def name="main()">
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
        <ul class="links">
 
            <li>
 
              <span style="text-transform: uppercase;"><a href="#">${_('branch')}: ${c.cs.branch}</a></span>
 
            </li>          
 
        </ul>          
 
    </div>
 
    <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')}
 
			        ${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>
 
			<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}
 
			       %else:				
 
					% if c.file.size < c.cut_off_limit:
 
						${h.pygmentize_annotation(c.repo_name,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.cs.revision,f_path=c.f_path))}
 
					%endif
 
			       <script type="text/javascript">
 
			           function highlight_lines(lines){
 
			               for(pos in lines){
 
			                 YUD.setStyle('L'+lines[pos],'background-color','#FFFFBE');                       
 
			               }
 
			           }       
 
			           page_highlights = location.href.substring(location.href.indexOf('#')+1).split('L');
 
			           if (page_highlights.length == 2){
 
			              highlight_ranges  = page_highlights[1].split(",");
 
			
 
			              var h_lines = [];
 
			              for (pos in highlight_ranges){
 
			                   var _range = highlight_ranges[pos].split('-');
 
			                   if(_range.length == 2){
rhodecode/templates/files/files_browser.html
Show inline comments
 
@@ -13,82 +13,82 @@
 
	          <span class="rev">${_('view')}@rev</span> 
 
	          <a class="ui-button-small" href="${c.url_prev}" title="${_('previous revision')}">&laquo;</a>
 
	          ${h.text('at_rev',value=c.changeset.revision,size=5)}
 
	          <a class="ui-button-small" href="${c.url_next}" title="${_('next revision')}">&raquo;</a>
 
	          ## ${h.submit('view',_('view'),class_="ui-button-small")}
 
		    </div>           
 
			${h.end_form()}
 
		</div>
 
	    <div class="browser-branch">
 
	       ${h.checkbox('stay_at_branch',c.changeset.branch,c.changeset.branch==c.branch)}
 
	       <label>${_('follow current branch')}</label>
 
	    </div>
 
        <div class="browser-search">
 
              <div id="search_activate_id" class="search_activate">
 
                  <a class="ui-button-small" id="filter_activate" href="#">${_('search file list')}</a>
 
              </div>
 
              % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):            
 
                    <div id="add_node_id" class="add_node">
 
                        <a class="ui-button-small" href="${h.url('files_add_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path)}">${_('add new file')}</a>
 
                    </div>
 
              % endif               
 
        <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>      
 
    </div>
 
    
 
	<div class="browser-body">
 
		<table class="code-browser">
 
		         <thead>
 
		             <tr>
 
		                 <th>${_('Name')}</th>
 
		                 <th>${_('Size')}</th>
 
		                 <th>${_('Mimetype')}</th>
 
		                 <th>${_('Revision')}</th>
 
		                 <th>${_('Last modified')}</th>
 
		                 <th>${_('Last commiter')}</th>
 
		             </tr>
 
		         </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>
 
	          		<td></td>
 
	          		<td></td>
 
	          		<td></td>
 
				</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")}
 
		             </td>
 
		             <td>
 
		             %if node.is_file():
 
		             	${h.format_byte_size(node.size,binary=True)}
 
		             %endif	
 
		             </td>
 
		             <td>
 
		              %if node.is_file():
 
		                  ${node.mimetype}
 
		              %endif
 
		             </td>
 
		             <td>
 
		             	%if node.is_file():
 
		             		<span class="tooltip" title="${node.last_changeset.message}">
 
		             		${'r%s:%s' % (node.last_changeset.revision,node.last_changeset.short_id)}</span>
 
		             	%endif
 
		             </td>
 
		             <td>
 
		             	%if node.is_file():
 
		             		<span class="tooltip" title="${node.last_changeset.date}">
 
                            ${h.age(node.last_changeset.date)}</span>
rhodecode/templates/files/files_edit.html
Show inline comments
 
@@ -18,42 +18,61 @@
 
    &raquo;
 
    ${_('edit file')} @ R${c.cs.revision}:${h.short_id(c.cs.raw_id)}
 
</%def>
 

	
 
<%def name="page_nav()">
 
		${self.menu('files')}     
 
</%def>
 
<%def name="main()">
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
        <ul class="links">
 
            <li>
 
              <span style="text-transform: uppercase;">
 
              <a href="#">${_('branch')}: ${c.cs.branch}</a></span>
 
            </li>          
 
        </ul>          
 
    </div>
 
    <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>
 
			${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>
 
				<textarea id="commit" name="message" style="height: 60px;width: 99%;margin-left:4px"></textarea>
 
			</div>
 
			<div style="text-align: left;padding-top: 5px">
 
            ${h.submit('commit',_('Commit changes'),class_="ui-button-small")}
 
            ${h.reset('reset',_('Reset'),class_="ui-button-small")}
 
			</div>
 
			${h.end_form()}
 
			<script type="text/javascript">
 
			var reset_url = "${h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.file.path)}";
 
			initCodeMirror('editor',reset_url);
 
			</script>
 
		</div>    
 
    </div>
 
</div>    
 
</%def>   
 
\ No newline at end of file
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))}
 
		%endif
 
       <script type="text/javascript">
 
           function highlight_lines(lines){
 
               for(pos in lines){
 
                 YUD.setStyle('L'+lines[pos],'background-color','#FFFFBE');                       
 
               }
 
           }       
 
           page_highlights = location.href.substring(location.href.indexOf('#')+1).split('L');
 
           if (page_highlights.length == 2){
 
              highlight_ranges  = page_highlights[1].split(",");
 

	
 
              var h_lines = [];
 
              for (pos in highlight_ranges){
 
                   var _range = highlight_ranges[pos].split('-');
 
                   if(_range.length == 2){
 
                       var start = parseInt(_range[0]);
 
                       var end = parseInt(_range[1]);
 
                       if (start < end){
 
                           for(var i=start;i<=end;i++){
 
                               h_lines.push(i);
 
                           }
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'/>            
 
        %endif  
 
%else:
 
    <h2>
 
        <a href="#" onClick="javascript:parent.history.back();" target="main">${_('Go back')}</a> 
 
        ${_('No files at given path')}: "${c.f_path or "/"}" 
 
    </h2>
 
%endif
rhodecode/templates/index_base.html
Show inline comments
 
@@ -45,48 +45,49 @@
 
            </table>
 
            <div style="height: 20px"></div>
 
            % endif
 
            <div id="welcome" style="display:none;text-align:center">
 
                <h1><a href="${h.url('home')}">${c.rhodecode_name} ${c.rhodecode_version}</a></h1>
 
            </div>
 
            <table id="repos_list">
 
            <thead>
 
                <tr>
 
                    <th class="left"></th>
 
                    <th class="left">${_('Name')}</th>
 
                    <th class="left">${_('Description')}</th>
 
                    <th class="left">${_('Last change')}</th>
 
                    <th class="left">${_('Tip')}</th>
 
                    <th class="left">${_('Owner')}</th>
 
                    <th class="left">${_('RSS')}</th>
 
                    <th class="left">${_('Atom')}</th>
 
                </tr>
 
            </thead>
 
            <tbody>
 
            %for cnt,repo in enumerate(c.repos_list):
 
                <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">
 
                             <img src="${h.url('/images/icons/clipboard_16.png')}" alt="${_('Summary')}" />
 
                         </span>
 
                         <span>${_('Summary')}</span>                 
 
                         </a>             
 
                      </li>
 
                      <li>
 
                         <a title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=repo['name'])}">
 
                         <span class="icon">
 
                             <img src="${h.url('/images/icons/time.png')}" alt="${_('Changelog')}" />
 
                         </span>
 
                         <span>${_('Changelog')}</span>                 
 
                         </a>             
 
                      </li>
 
                      <li>
 
                         <a title="${_('Files')}" href="${h.url('files_home',repo_name=repo['name'])}">
 
                         <span class="icon">
 
                             <img src="${h.url('/images/icons/file.png')}" alt="${_('Files')}" />
 
                         </span>
 
                         <span>${_('Files')}</span>                 
 
                         </a>             
 
                      </li>                                    
rhodecode/tests/functional/test_files.py
Show inline comments
 
@@ -108,53 +108,53 @@ class TestFilesController(TestController
 
<option value="22f71ad265265a53238359c883aa976e725aa07d">r56:22f71ad26526</option>
 
<option value="97501f02b7b4330924b647755663a2d90a5e638d">r49:97501f02b7b4</option>
 
<option value="86ede6754f2b27309452bb11f997386ae01d0e5a">r47:86ede6754f2b</option>
 
<option value="014c40c0203c423dc19ecf94644f7cac9d4cdce0">r45:014c40c0203c</option>
 
<option value="ee87846a61c12153b51543bf860e1026c6d3dcba">r30:ee87846a61c1</option>
 
<option value="9bb326a04ae5d98d437dece54be04f830cf1edd9">r26:9bb326a04ae5</option>
 
<option value="536c1a19428381cfea92ac44985304f6a8049569">r24:536c1a194283</option>
 
<option value="dc5d2c0661b61928834a785d3e64a3f80d3aad9c">r8:dc5d2c0661b6</option>
 
<option value="3803844fdbd3b711175fc3da9bdacfcd6d29a6fb">r7:3803844fdbd3</option>
 
</optgroup>
 
<optgroup label="Branches">
 
<option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">default</option>
 
<option value="97e8b885c04894463c51898e14387d80c30ed1ee">git</option>
 
<option value="2e6a2bf9356ca56df08807f4ad86d480da72a8f4">web</option>
 
</optgroup>
 
<optgroup label="Tags">
 
<option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">tip</option>
 
<option value="fd4bdb5e9b2a29b4393a4ac6caef48c17ee1a200">0.1.4</option>
 
<option value="17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">0.1.3</option>
 
<option value="a7e60bff65d57ac3a1a1ce3b12a70f8a9e8a7720">0.1.2</option>
 
<option value="eb3a60fc964309c1a318b8dfe26aa2d1586c85ae">0.1.1</option>
 
</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'
 

	
 
    def test_file_annotation(self):
 
        self.log_user()
 
        response = self.app.get(url(controller='files', action='annotate',
 
                                    repo_name=HG_REPO,
 
                                    revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc',
 
                                    f_path='vcs/nodes.py'))
 

	
 
        print response.body
 
        assert """<optgroup label="Changesets">
 
<option selected="selected" value="8911406ad776fdd3d0b9932a2e89677e57405a48">r167:8911406ad776</option>
 
<option value="aa957ed78c35a1541f508d2ec90e501b0a9e3167">r165:aa957ed78c35</option>
 
<option value="48e11b73e94c0db33e736eaeea692f990cb0b5f1">r140:48e11b73e94c</option>
 
<option value="adf3cbf483298563b968a6c673cd5bde5f7d5eea">r126:adf3cbf48329</option>
 
<option value="6249fd0fb2cfb1411e764129f598e2cf0de79a6f">r113:6249fd0fb2cf</option>
 
<option value="75feb4c33e81186c87eac740cee2447330288412">r109:75feb4c33e81</option>
 
<option value="9a4dc232ecdc763ef2e98ae2238cfcbba4f6ad8d">r108:9a4dc232ecdc</option>
 
<option value="595cce4efa21fda2f2e4eeb4fe5f2a6befe6fa2d">r107:595cce4efa21</option>
 
<option value="4a8bd421fbc2dfbfb70d85a3fe064075ab2c49da">r104:4a8bd421fbc2</option>
 
<option value="57be63fc8f85e65a0106a53187f7316f8c487ffa">r102:57be63fc8f85</option>
 
<option value="5530bd87f7e2e124a64d07cb2654c997682128be">r101:5530bd87f7e2</option>
 
<option value="e516008b1c93f142263dc4b7961787cbad654ce1">r99:e516008b1c93</option>
0 comments (0 inline, 0 general)