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
 
"""Helper functions
 

	
 
Consists of functions to typically be used within templates, but also
 
available to Controllers. This module is available to both as 'h'.
 
"""
 
from pylons import url
 
from pylons.i18n.translation import _, ungettext
 
from webhelpers.html import (literal, HTML, escape)
 
from webhelpers.html.builder import make_tag
 
from webhelpers.html.tools import (auto_link, button_to, highlight, js_obfuscate
 
                                   , mail_to, strip_links, strip_tags, tag_re)
 
from webhelpers.html.tags import (auto_discovery_link, checkbox, css_classes,
 
                                  end_form, file, form, hidden, image,
 
                                  javascript_link, link_to, link_to_if,
 
                                  link_to_unless, ol, required_legend,
 
                                  select, stylesheet_link,
 
                                  submit, text, password, textarea, title,
 
                                  ul, xml_declaration)
 
from webhelpers.text import (chop_at, collapse, convert_accented_entities,
 
                             convert_misc_entities, lchop, plural, rchop,
 
                             remove_formatting, replace_whitespace, urlify)
 

	
 
from webhelpers.pylonslib import Flash as _Flash
 
from webhelpers.pylonslib.secure_form import secure_form
 

	
 
from pygments import highlight
 
from pygments.formatters import HtmlFormatter
 
from pygments.lexers import guess_lexer
 
from pygments.lexers import get_lexer_by_name
 

	
 
#Custom helper here :)
 
class _Link(object):
 
    '''
 
    Make a url based on label and url with help of url_for
 
    @param label:name of link    if not defined url is used
 
    @param url: the url for link
 
    '''
 

	
 
    def __call__(self, label='', *url_, **urlargs):
 
        if label is None or '':
 
            label = url
 
        link_fn = link_to(label, url(*url_, **urlargs))
 
        return link_fn
 

	
 

	
 
class _GetError(object):
 

	
 
    def __call__(self, field_name, form_errors):
 
        tmpl = """<span class="error_msg">%s</span>"""
 
        if form_errors and form_errors.has_key(field_name):
 
            return literal(tmpl % form_errors.get(field_name))
 

	
 
class _FileSizeFormat(object):
 
    """
 
    Formats the value like a 'human-readable' file size (i.e. 13 KB, 4.1 MB,
 
    102 bytes, etc).
 
    """
 
    def __call__(self, bytes):
 
        try:
 
            bytes = float(bytes)
 
        except TypeError:
 
            return u"0 bytes"
 
    
 
        if bytes < 1024:
 
            return ungettext("%(size)d byte", "%(size)d bytes", bytes) % {'size': bytes}
 
        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
 
/*** Initial Settings ***/
 
* {
 
  margin: 0;
 
  padding: 0;
 
  font-weight: normal;
 
  font-style: normal;
 
}
 

	
 
html {
 
  font-size: 100%;
 
  font-family: sans-serif;
 
}
 

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

	
 
a {
 
  color:#0000cc;
 
  text-decoration: none;
 
}
 
/*** end of Initial Settings ***/
 

	
 

	
 
/** common settings **/
 
div#container {
 
  background: #FFFFFF;
 
  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;
 
    font-family: osaka,'MS P Gothic', Georgia, serif;
 
    letter-spacing: 1px;
 
    color: #DDD;
 
  }
 
  div.page-header h1 a {
 
    font-weight: bold;
 
    color: #FFF;
 
  }
 
  div.page-header a {
 
    text-decoration: none;
 
  }
 

	
 
  div.page-header form {
 
    position: absolute;
 
    margin-bottom: 2px;
 
    bottom: 0;
 
    right: 20px;
 
  }
 
  div.page-header form label {
 
    color: #DDD;
 
  }
 
  div.page-header form input {
 
    padding: 2px;
 
    border: solid 1px #DDD;
 
  }
 
  div.page-header form dl {
 
    overflow: hidden;
 
  }
 
  div.page-header form dl dt {
 
    font-size: 1.2em;
 
  }
 
  div.page-header form dl dt,
 
  div.page-header form dl dd {
 
    margin: 0 0 0 5px;
 
    float: left;
 
    height: 24px;
 
    line-height: 20px;
 
  }
 

	
 
  ul.page-nav {
 
    margin: 10px 0 0 0;
 
    list-style-type: none;
 
    overflow: hidden;
 
    width: 800px;
 
  }
 
    ul.page-nav li {
 
      margin: 0 2px 0 0;
 
      float: left;
 
      width: 80px;
 
      height: 24px;
 
      font-size: 1.1em;
 
      line-height: 24px;
 
      text-align: center;
 
    }
 
    ul.page-nav li.current {
 
      background: #FFF;
 
    }
 
    ul.page-nav li a {
 
      height: 24px;
 
      color: #666;
 
      background: #DDD;
 
      display: block;
 
      text-decoration: none;
 
    }
 
    ul.page-nav li a:hover {
 
      color:#333;
 
      background: #FFF;
 
    }
 

	
 
ul.submenu {
 
  margin: 10px 0 -10px 20px;
 
  list-style-type: none;
 
}
 
ul.submenu li {
 
  margin: 0 10px 0 0;
 
  font-size: 1.2em;
 
  display: inline;
 
}
 

	
 
h2 {
 
  margin: 20px 0 10px;
 
  height: 30px;
 
  line-height: 30px;
 
  text-indent: 20px;
 
  background: #FFF;
 
  font-size: 1.2em;
 
  border-top: dotted 1px #D5E1E6;
 
  font-weight: bold;
 
}
 
h2.no-link {
 
  color:#006699;
 
}
 
h2.no-border {
 
  color: #FFF;
 
  background: #006699;
 
  border: 0;
 
}
 
h2 a {
 
  font-weight:bold;
 
  color:#006699;
 
}
 

	
 
div.page-path {
 
  text-align: right;
 
  padding: 20px 30px 10px 0;
 
  border:solid #d9d8d1;
 
  border-width:0px 0px 1px;
 
  font-size: 1.2em;
 
}
 

	
 
div.page-footer {
 
  margin: 50px 0 0;
 
  position: relative;
 
}
 
  div.page-footer p {
 
    position: relative;
 
    left: 20px;
 
    bottom: 5px;
 
    font-size: 1.2em;
 
  }
 

	
 
  ul.rss-logo {
 
    position: absolute;
 
    top: -10px;
 
    right: 20px;
 
    height: 20px;
 
    list-style-type: none;
 
  }
 
  ul.rss-logo li {
 
    display: inline;
 
  }
 
  ul.rss-logo li a {
 
    padding: 3px 6px;
 
    line-height: 10px;
 
    border:1px solid;
 
    border-color:#fcc7a5 #7d3302 #3e1a01 #ff954e;
 
    color:#ffffff;
 
    background-color:#ff6600;
 
    font-weight:bold;
 
    font-family:sans-serif;
 
    font-size:10px;
 
    text-align:center;
 
    text-decoration:none;
 
  }
 
  div.rss-logo li a:hover {
 
    background-color:#ee5500;
 
  }
 

	
 
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;
 
  border: 1px solid;
 
  background-color: #ffaaff;
 
  border-color: #ffccff #ff00ee #ff00ee #ffccff;
 
}
 
span.logtags span.tagtag {
 
  background-color: #ffffaa;
 
  border-color: #ffffcc #ffee00 #ffee00 #ffffcc;
 
}
 
span.logtags span.branchtag {
 
  background-color: #aaffaa;
 
  border-color: #ccffcc #00cc33 #00cc33 #ccffcc;
 
}
 
span.logtags span.inbranchtag {
 
  background-color: #d5dde6;
 
  border-color: #e3ecf4 #9398f4 #9398f4 #e3ecf4;
 
}
 

	
 
div.diff pre {
 
  margin: 10px 0 0 0;
 
}
 
div.diff pre span {
 
  font-family: monospace;
 
  white-space: pre;
 
  font-size: 1.2em;
 
  padding: 3px 0;
 
}
 
td.source {
 
  white-space: pre;
 
  font-family: monospace;
 
  margin: 10px 30px 0;
 
  font-size: 1.2em;
 
  font-family: monospace;
 
}
 
  div.source div.parity0,
 
  div.source div.parity1 {
 
    padding: 1px;
 
    font-size: 1.2em;
 
  }
 
  div.source div.parity0 {
 
    background: #F1F6F7;
 
  }
 
  div.source div.parity1 {
 
    background: #FFFFFF;
 
  }
 
div.parity0:hover,
 
div.parity1:hover {
 
  background: #D5E1E6;
 
}
 
.linenr {
 
  color: #999;
 
  text-align: right;
 
}
 
.lineno {
 
  text-align: right;
 
}
 
.lineno a {
 
  color: #999;
 
}
 
td.linenr {
 
  width: 60px;
 
}
 

	
 
div#powered-by {
 
  position: absolute;
 
  width: 75px;
 
  top: 15px;
 
  right: 20px;
 
  font-size: 1.2em;
 
}
 
div#powered-by a {
 
  color: #EEE;
 
  text-decoration: none;
 
}
 
div#powered-by a:hover {
 
  text-decoration: underline;
 
}
 
/*
 
div#monoblue-corner-top-left {
 
  position: absolute;
 
  top: 0;
 
  left: 0;
 
  width: 10px;
 
  height: 10px;
 
  background: url(./monoblue-corner.png) top left no-repeat !important;
 
  background: none;
 
}
 
div#monoblue-corner-top-right {
 
  position: absolute;
 
  top: 0;
 
  right: 0;
 
@@ -378,114 +377,153 @@ ul.changelog-entry li span.revdate {
 
}
 
ul.changelog-entry li.age {
 
  position: absolute;
 
  top: -25px;
 
  right: 10px;
 
  font-size: 1.4em;
 
  color: #CCC;
 
  font-weight: bold;
 
  font-style: italic;
 
}
 
ul.changelog-entry li span.name {
 
  font-size: 1.2em;
 
  font-weight: bold;
 
}
 
ul.changelog-entry li.description {
 
  margin: 10px 0 0;
 
  font-size: 1.1em;
 
}
 
/** end of changelog **/
 

	
 
/** file **/
 
p.files {
 
  margin: 0 0 0 20px;
 
  font-size: 2.0em;
 
  font-weight: bold;
 
}
 
/** end of file **/
 

	
 
/** changeset **/
 
h3.changeset {
 
  margin: 20px 0 5px 20px;
 
  padding: 0 0 2px;
 
  font-size: 1.6em;
 
  border-bottom: dotted 1px #D5E1E6;
 
}
 
p.changeset-age {
 
  position: relative;
 
}
 
p.changeset-age span {
 
  position: absolute;
 
  top: -25px;
 
  right: 10px;
 
  font-size: 1.4em;
 
  color: #CCC;
 
  font-weight: bold;
 
  font-style: italic;
 
}
 
p.description {
 
  margin: 10px 30px 0 30px;
 
  padding: 10px;
 
  border: solid 1px #CCC;
 
  font-size: 1.2em;
 
}
 
/** end of changeset **/
 

	
 
/** canvas **/
 
div#wrapper {
 
	position: relative;
 
    font-size: 1.2em;
 
}
 

	
 
canvas {
 
	position: absolute;
 
	z-index: 5;
 
	top: -0.7em;
 
}
 

	
 
ul#nodebgs li.parity0 {
 
    background: #F1F6F7;
 
}
 

	
 
ul#nodebgs li.parity1 {
 
    background: #FFFFFF;
 
}
 

	
 
ul#graphnodes {
 
	position: absolute;
 
	z-index: 10;
 
	top: 7px;
 
	list-style: none inside none;
 
}
 

	
 
ul#nodebgs {
 
	list-style: none inside none;
 
}
 

	
 
ul#graphnodes li, ul#nodebgs li {
 
	height: 39px;
 
}
 

	
 
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;
 
	padding-top:5px;
 
	text-align:left;
 
}
 
.browser-dir {
 
	background-image:url("/images/folder.png");
 
	background-repeat:no-repeat;
 
	display:block;
 
	height:16px;
 
	padding-left:20px;
 
	padding-top:5px;
 
	text-align:left;
 
}
 
\ No newline at end of file
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
 
## -*- coding: utf-8 -*-
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
 
<head>
 
    <link rel="icon" href="/images/hgicon.png" type="image/png" />
 
    <meta name="robots" content="index, nofollow"/>
 
    <title>${next.title()}</title>
 
    ${self.css()}
 
    ${self.js()}
 
</head>
 

	
 
<body>
 
<div id="container">
 
    <div class="page-header">
 
        <h1>
 
            ${next.breadcrumbs()}
 
        </h1>
 
        <ul class="page-nav">
 
            ${self.page_nav()}
 
        </ul>
 
    </div>
 
    ${next.main()}
 
    <div class="page-footer">
 
        Mercurial App &copy; 2010
 
    </div>   
 

	
 
    <div id="powered-by">
 
        <p>
 
        <a href="http://mercurial.selenic.com/" title="Mercurial">
 
            <img src="/images/hglogo.png" width="75" height="90" alt="mercurial"/></a>
 
        </p>
 
    </div>
 

	
 
    <div id="corner-top-left"></div>
 
    <div id="corner-top-right"></div>
 
    <div id="corner-bottom-left"></div>
 
    <div id="corner-bottom-right"></div>
 

	
 
</div>
 
</body>
 
</html>
 

	
 
<%def name="page_nav()">
 

	
 
	${self.menu()}
 

	
 
</%def>
 

	
 

	
 
<%def name="menu(current)">
 
        <ul class="page-nav">
 

	
 
            <li 
 
            %if current=='summary':
 
            	class='current' 
 
            %endif
 
            >${h.link_to_unless(current=='summary',_('summary'),h.url('summary_home',repo_name=c.repo_name))}</li>
 
            <li 
 
            %if current=='changelog':
 
            	class='current' 
 
            %endif
 
            >${h.link_to_unless(current=='changelog',_('changelog'),h.url('changelog_home',repo_name=c.repo_name))}</li>
 
            <li 
 
            %if current=='branches':
 
            	class='current' 
 
            %endif
 
            >${h.link_to_unless(current=='branches',_('branches'),h.url('branches_home',repo_name=c.repo_name))}</li>
 
            <li 
 
            %if current=='tags':
 
            	class='current' 
 
            %endif
 
            >${h.link_to_unless(current=='tags',_('tags'),h.url('tags_home',repo_name=c.repo_name))}</li>
 
            <li 
 
            %if current=='graph':
 
            	class='current' 
 
            %endif
 
            >${h.link_to_unless(current=='graph',_('graph'),h.url('graph_home',repo_name=c.repo_name))}</li>
 
            <li 
 
            %if current=='files':
 
            	class='current' 
 
            %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
 
<%inherit file="base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('Repository managment')}
 
</%def>
 
<%def name="breadcrumbs()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    / 
 
    ${h.link_to(c.repo_name,h.url('files_home',repo_name=c.repo_name))}
 
    /
 
    ${_('files')}
 
</%def>
 
<%def name="page_nav()">
 
        <form action="log">
 
            <dl class="search">
 
                <dt><label>Search: </label></dt>
 
                <dd><input type="text" name="rev" /></dd>
 
            </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>
 
                    <th class="width-10 righted">${_('Revision')}</th>
 
                    <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>
 
	                    <td>
 
	                    	%if node.is_file():
 
	                    		${node.last_changeset.revision}
 
	                    	%endif
 
	                    </td>
 
	                    <td>
 
	                    	%if node.is_file():
 
	                    		${node.last_changeset.date}
 
	                    	%endif
 
	                    </td>
 
	                    <td>
 
	                    	%if node.is_file():
 
	                    		${node.last_changeset.author}
 
	                    	%endif                    
 
	                    	
 
	                    </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
 
## -*- coding: utf-8 -*-
 
<%!
 
from pylons_app.lib import filters
 
%>
 
<%inherit file="base/base.html"/>
 
<%def name="title()">
 
    ${c.repos_prefix} Mercurial Repositories
 
</%def>
 
<%def name="breadcrumbs()">
 
	${c.repos_prefix} Mercurial Repositories
 
</%def>
 
<%def name="page_nav()">
 
	<li class="current">${_('Home')}</li>
 
	<li>${h.link_to(u'Admin',h.url('admin_home'))}</li>
 
</%def>
 
<%def name="main()">
 
	<%def name="get_sort(name)">
 
		<%name_slug = name.lower().replace(' ','_') %>
 
		%if name_slug == c.cs_slug:
 
			<span style="font-weight: bold;color:#006699">${name}</span>
 
		%else:
 
			<span style="font-weight: bold">${name}</span>
 
		%endif
 
		
 
		<a href="?sort=${name_slug}">&darr;</a>
 
		<a href="?sort=-${name_slug}">&uarr;</a>
 
		
 
	</%def>
 
	<table>
 
	  <tr>
 
	    <td>${get_sort(_('Name'))}</td>
 
	    <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>
 
	        <td>r${repo['rev']}:<a href="/${repo['name']}/rev/${repo['tip']}/">${repo['tip']}</a></td>
 
	        <td>${repo['contact']}</td>
 
	        <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)