view rhodecode/templates/files/files_browser.html @ 1176:014c9a58a0d9 beta

fixes for issues #137 and #116 safe_unicode is now default for handling file names
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 24 Mar 2011 16:35:53 +0100
parents f3d8ff6f96cc
children 5a96551ee9c0
line wrap: on
line source

<%def name="file_class(node)">
	%if node.is_file():
		<%return "browser-file" %>
	%else:
		<%return "browser-dir"%>
	%endif
</%def>
<div id="body" class="browserblock">
    <div class="browser-header">
		<div class="browser-nav">
			${h.form(h.url.current())}
			<div class="info_box">
	          <span >${_('view')}@rev</span> 
	          <a href="${c.url_prev}" title="${_('previous revision')}">&laquo;</a>
	          ${h.text('at_rev',value=c.changeset.revision,size=3)}
	          <a href="${c.url_next}" title="${_('next revision')}">&raquo;</a>
	          ${h.submit('view','view')}
		    </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>
	       <script type="text/javascript">
	        YUE.on('stay_at_branch','click',function(e){
	        	if(e.target.checked){
	        		var uri = "${h.url.current(branch='__BRANCH__')}"
	        		uri = uri.replace('__BRANCH__',e.target.value);
	        		window.location = uri;
	        	}
	        	else{
	        		window.location = "${h.url.current()}";
	        	}
	        	
	        })
	       </script>
	    </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>

          		%if c.files_list.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")}
	          		</td>
	          		<td></td>
	          		<td></td>
	          		<td></td>
	          		<td></td>
	          		<td></td>
				</tr>
          		%endif
		         	
		    %for cnt,node in enumerate(c.files_list):
				<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))}
		             </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.raw_id}">
		             		${'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>
		             	%endif
		             </td>
		             <td>
		             	%if node.is_file():
		             		${node.last_changeset.author}
		             	%endif                    
		             </td>
				</tr>
			%endfor
		</table>
	</div>
</div>