Changeset - 2dc0c8e4f384
[Not reviewed]
default
2 4 3
Marcin Kuzminski - 16 years ago 2010-04-25 18:42:58
marcin@python-works.com
Updated tempaltes, added file browser breadcrumbs, and feed icons
8 files changed with 99 insertions and 579 deletions:
0 comments (0 inline, 0 general)
pylons_app/lib/helpers.py
Show inline comments
 
@@ -66,20 +66,30 @@ class _FileSizeFormat(object):
 
        if bytes < 1024 * 1024:
 
            return _("%.1f KB") % (bytes / 1024)
 
        if bytes < 1024 * 1024 * 1024:
 
            return _("%.1f MB") % (bytes / (1024 * 1024))
 
        return _("%.1f GB") % (bytes / (1024 * 1024 * 1024))
 

	
 
class _FilesBreadCrumbs(object):
 
    
 
    def __call__(self, repo_name, rev, paths):
 
        url_l = [link_to(repo_name, url('files_home', repo_name=repo_name, f_path=''))]
 
        paths_l = paths.split('/')
 
        
 
        for cnt, p in enumerate(paths_l, 1):
 
            if p != '':
 
                url_l.append(link_to(p, url('files_home', repo_name=repo_name, f_path='/'.join(paths_l[:cnt]))))
 

	
 
        return literal(' / '.join(url_l))
 

	
 
def pygmentize(code, **kwargs):
 
    '''
 
    Filter for chunks of html to replace code tags with pygmented code
 
    '''
 
    return literal(highlight(code, guess_lexer(code), HtmlFormatter(**kwargs)))
 

	
 

	
 

	
 
files_breadcrumbs = _FilesBreadCrumbs()
 
filesizeformat = _FileSizeFormat()
 
link = _Link()
 
flash = _Flash()
 
get_error = _GetError()
pylons_app/public/css/monoblue_custom.css
Show inline comments
 
file renamed from pylons_app/public/css/style-monoblue_custom.css to pylons_app/public/css/monoblue_custom.css
 
@@ -11,13 +11,13 @@ html {
 
  font-family: sans-serif;
 
}
 

	
 
body {
 
  font-size: 77%;
 
  margin: 15px 50px;
 
  background: #4B4B4C;
 
  background: #DBD4C6;
 
}
 

	
 
a {
 
  color:#0000cc;
 
  text-decoration: none;
 
}
 
@@ -30,13 +30,13 @@ div#container {
 
  position: relative;
 
  color: #666;
 
}
 

	
 
div.page-header {
 
  padding: 50px 20px 0;
 
  background: #006699 top left repeat-x;
 
  background: #556cb5 top left repeat-x;
 
  position: relative;
 
}
 
  div.page-header h1 {
 
    margin: 10px 0 30px;
 
    font-size: 1.8em;
 
    font-weight: bold;
 
@@ -191,39 +191,38 @@ div.page-footer {
 
p.normal {
 
  margin: 20px 0 20px 30px;
 
  font-size: 1.2em;
 
}
 

	
 
table {
 
  margin: 10px 0 0 20px;
 
  width: 95%;
 
  margin: 0 0 0 0;  
 
  border-collapse: collapse;
 
}
 
/*
 
table tr td {
 
  font-size: 1.1em;
 
}
 
table tr td.nowrap {
 
  white-space: nowrap;
 
}
 
/*
 
table tr.parity0:hover,
 
table tr.parity1:hover {
 
*/
 
table tr.parity0:hover,table tr.parity1:hover {
 
  background: #D5E1E6;
 
}
 
*/
 

	
 
table tr.parity0 {
 
  background: #F1F6F7;
 
  background: #EAEAE9;
 
}
 
table tr.parity1 {
 
  background: #FFFFFF;
 
}
 
table tr td {
 
  padding: 5px 5px;
 
  padding: 3px 3px;
 
}
 
table.annotated tr td {
 
  padding: 0px 5px;
 
  padding: 0px 3px;
 
}
 

	
 
span.logtags span {
 
  padding: 2px 6px;
 
  font-weight: normal;
 
  font-size: 11px;
 
@@ -468,12 +467,51 @@ ul#graphnodes li, ul#nodebgs li {
 
ul#graphnodes li .info {
 
	display: block;
 
	position: relative;
 
}
 
/** end of canvas **/
 

	
 
table.code-browser{
 
	
 
}
 
table.code-browser thead th {
 
	background-color:#EEEEEE;
 
	border:1px solid #999999;
 
	height:20px;
 
	font-size: 1.1em;
 
	font-weight: bold;
 
}
 
table.code-browser tbody td {
 
	border:1px solid #999999;
 
	height:20px;
 
}
 
.info-table {
 
	background:none repeat scroll 0 0 #FAFAFA;
 
	border-bottom:1px solid #DDDDDD;
 
	width:100%;
 
}
 
.rss_logo{
 
	background-image:url("/images/feed.png");
 
	background-repeat:no-repeat;
 
	display:block;
 
	height:16px;
 
	padding-left:20px;
 
	padding-top:0px;
 
	text-align:left;
 
	
 
}
 
.atom_logo{
 
	background-image:url("/images/atom.png");
 
	background-repeat:no-repeat;
 
	display:block;
 
	height:16px;
 
	padding-left:20px;
 
	padding-top:0px;
 
	text-align:left;
 
	
 
}
 
.browser-file {
 
	background-image:url("/images/file.png");
 
	background-repeat:no-repeat;
 
	display:block;
 
	height:16px;
 
	padding-left:20px;
pylons_app/public/css/style.css
Show inline comments
 
deleted file
pylons_app/public/images/atom.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
pylons_app/public/images/feed.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
pylons_app/templates/base/base.html
Show inline comments
 
@@ -81,12 +81,12 @@
 
            %endif
 
            >${h.link_to_unless(current=='files',_('files'),h.url('files_home',repo_name=c.repo_name))}</li>
 
        </ul>
 
</%def>
 

	
 
<%def name="css()">
 
<link rel="stylesheet" href="/css/style-monoblue_custom.css" type="text/css" />
 
<link rel="stylesheet" href="/css/monoblue_custom.css" type="text/css" />
 
</%def>
 

	
 
<%def name="js()">
 
<script type="text/javascript" src="/js/yui/utilities/utilities.js"></script>
 
</%def>
 
\ No newline at end of file
pylons_app/templates/files.html
Show inline comments
 
@@ -18,20 +18,20 @@
 
            </dl>
 
        </form>
 

	
 
		${self.menu('files')}     
 
</%def>
 
<%def name="css()">
 
<link rel="stylesheet" href="/css/style-monoblue_custom.css" type="text/css" />
 
<link rel="stylesheet" href="/css/monoblue_custom.css" type="text/css" />
 
<link rel="stylesheet" href="/css/pygments.css" type="text/css" />
 
</%def>
 
<%def name="main()">
 

	
 
    <h2 class="no-link no-border">${_('Files')}</h2>
 
	<div id="files_data">
 
		<h2>${_('File')}: ${c.repo_name}/${c.f_path}</h2>
 
		<h2>${_('File')}: ${h.files_breadcrumbs(c.repo_name,c.cur_rev,c.files_list.path)}</h2>
 
		%if c.files_list.is_dir():
 
        <table class="code-browser">
 
            <thead>
 
                <tr>
 
                    <th class="width-50 lefted">${_('Name')}</th>
 
                    <th class="width-10 righted">${_('Size')}</th>
 
@@ -39,31 +39,35 @@
 
                    <th class="width-15 righted">${_('Last modified')}</th>
 
                    <th class="width-15 righted">${_('Last commiter')}</th>
 
                </tr>
 
            </thead>
 
            	<tr>
 
            		% if c.files_list.parent:
 
            		<td colspan="5" class="browser-dir">
 
            		${h.link_to('..',h.url('files_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.files_list.parent))}
 
            		<td>
 
            		${h.link_to('..',h.url('files_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.files_list.parent),class_="browser-dir")}
 
            		</td>
 
            		<td></td>
 
            		<td></td>
 
            		<td></td>
 
            		<td></td>
 
            		%endif
 
            	</tr>
 
					<%def name="file_class(node)">
 
						%if node.is_file():
 
							browser-file
 
							<%return "browser-file" %>
 
						%else:
 
							browser-dir
 
							<%return "browser-dir"%>
 
						%endif
 
					</%def>
 
			
 

	
 
	            %for cnt,node in enumerate(c.files_list):
 
					<tr class="parity${cnt%2}">
 
	
 
	                    <td class="${file_class(node)}">
 
							${h.link_to(node.name,h.url('files_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=node.path),class_='file or dir')}
 
	                    <td>
 
							${h.link_to(node.name,h.url('files_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=node.path),class_=file_class(node))}
 
	                    </td>
 
	                    <td>
 
	                        %if node.is_file():
 
	                    		${h.filesizeformat(node.size)}
 
	                    	%endif
 
	                    </td>
 
@@ -84,12 +88,33 @@
 
	                    	
 
	                    </td>
 
					</tr>
 
				%endfor
 
			</table>
 
			%else:
 
			<table class="info-table">
 
				<tr>
 
					<td>r70:17ecc1c97401</td>
 
					<td>374 loc</td>
 
					<td>12.5 KB</td>
 
					<td>
 
						<a href="/marcinkuzminski/vcs/history/vcs/backends/hg.py">history</a> / 
 
						<a href="/marcinkuzminski/vcs/annotate/17ecc1c97401/vcs/backends/hg.py">annotate</a> / 
 
						<a href="/marcinkuzminski/vcs/raw/17ecc1c97401/vcs/backends/hg.py">raw</a> / 
 
						<form class="source-view-form" method="get" action="/marcinkuzminski/vcs/diff/vcs/backends/hg.py">
 
							
 
							<input type="hidden" value="17ecc1c97401" name="diff2">
 
								<select class="smaller" name="diff1">
 
									<option>history</option>							
 
								</select>
 
								<input type="submit" class="smaller" value="diff">
 
							
 
						</form>
 
					</td>
 
				</tr>
 
			</table>			
 
				<div id="body" class="codeblock">
 
				${h.pygmentize(c.files_list.content,linenos=True,anchorlinenos=True,cssclass="code-highlight")}
 
				</div>				
 
			%endif
 
	</div>
 
</%def>    
 
\ No newline at end of file
pylons_app/templates/index.html
Show inline comments
 
@@ -32,12 +32,13 @@ from pylons_app.lib import filters
 
	    <td>${get_sort(_('Description'))}</td>
 
	    <td>${get_sort(_('Last change'))}</td>
 
	    <td>${get_sort(_('Tip'))}</td>
 
	    <td>${get_sort(_('Contact'))}</td>
 
	    <td></td>
 
	    <td></td>
 
	    <td></td>
 
	  </tr>	
 
	%for cnt,repo in enumerate(c.repos_list):
 
 		<tr class="parity${cnt%2}">
 
		    <td>${h.link(repo['name'],h.url('summary_home',repo_name=repo['name']))}</td>
 
		    <td>${repo['description']}</td>
 
	        <td>${repo['last_change']|n,filters.age}</td>
 
@@ -46,15 +47,15 @@ from pylons_app.lib import filters
 
	        <td class="indexlinks">
 
	        	%for archive in repo['repo_archives']:
 
					<a href="/${repo['name']}/archive/${archive['node']}${archive['extension']}">${archive['type']}</a>
 
				%endfor
 
	        </td>
 
			<td>
 
				<div class="rss_logo">
 
				<a href="/${repo['name']}/rss-log">RSS</a>
 
				<a href="/${repo['name']}/atom-log">Atom</a>
 
				</div>
 
				<a  class="rss_logo" href="/${repo['name']}/rss-log">RSS</a>
 
			</td>        
 
			<td>
 
				<a  class="atom_logo" href="/${repo['name']}/atom-log">Atom</a>
 
			</td>
 
		</tr>
 
	%endfor
 
	</table>
 
</%def>    
0 comments (0 inline, 0 general)