Changeset - 710e7a75bb6b
[Not reviewed]
Marcin Kuzminski - 15 years ago 2010-05-26 00:20:03
marcin@python-works.com
templating update, improved look & feel, version bump
6 files changed with 46 insertions and 42 deletions:
0 comments (0 inline, 0 general)
pylons_app/__init__.py
Show inline comments
 
"""
 
Hg app, a web based mercurial repository managment based on pylons
 
"""
 

	
 
VERSION = (0, 7, 4, 'beta')
 
VERSION = (0, 7, 5, 'beta')
 

	
 
__version__ = '.'.join((str(each) for each in VERSION[:4]))
 

	
 
def get_version():
 
    """
 
    Returns shorter version (digit parts only) as string.
 
    """
 
    return '.'.join((str(each) for each in VERSION[:3]))
pylons_app/public/css/monoblue_custom.css
Show inline comments
 
@@ -128,125 +128,128 @@ 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;
 
	padding: 0;
 
}
 

	
 
ul.page-nav li {
 
	margin: 0 2px 0 0;
 
	margin: 0 4px 0 0;
 
	float: left;
 
	height: 24px;
 
	font-size: 1.1em;
 
	line-height: 24px;
 
	text-align: center;
 
	background: #DDD;
 
	background: #556CB5;
 
}
 

	
 
ul.page-nav li.current {
 
	background: #FFF;
 
	padding-right: 5px;
 
	padding-left: 5px;
 
}
 

	
 
ul.page-nav li.current a {
 
	color: #556CB5;
 
}
 
ul.page-nav li a {
 
	height: 24px;
 
	color: #666;
 
	color: #FFF;
 
	padding-right: 5px;
 
	padding-left: 5px;
 
	display: block;
 
	text-decoration: none;
 
	font-weight: bold;
 
}
 
ul.page-nav li.logout a {
 
	color: red;
 
	color: #FDAC9D;
 
}
 
ul.page-nav li a:hover {
 
	color: #333;
 
	background: #FFF;
 
	color: #556CB5;
 
}
 

	
 
ul.submenu {
 
	margin: 5px 0px -20px 0px;
 
	list-style-type: none;
 
}
 

	
 
ul.submenu li {
 
	margin: 0 10px 0 0;
 
	font-size: 0.9em;
 
	font-weight:bold;
 
	display: inline;
 
}
 
ul.submenu .repos {
 
    background: url("/images/icons/folder_edit.png") no-repeat scroll 3px;
 
    height: 16px;
 
    padding-left: 20px;
 
    padding-top: 0px;
 
    text-align: left;
 
   
 
}
 
ul.submenu .users {
 
    background: url("/images/icons/user_edit.png") no-repeat scroll 3px;
 
    height: 16px;
 
    padding-left: 20px;
 
    padding-top: 0px;
 
    text-align: left;
 
}
 
ul.submenu .permissions {
 
    background: url("/images/icons/folder_key.png") no-repeat scroll 3px;
 
    height: 16px;
 
    padding-left: 20px;
 
    padding-top: 0px;
 
    text-align: left;
 
}
 

	
 
ul.submenu .current_submenu {
 
    border-bottom: 2px solid #556CB5;
 
}
 

	
 
h2 {
 
	margin: 20px 0 10px;
 
	height: 30px;
 
	line-height: 30px;
 
	text-indent: 20px;
 
	background: #FFF;
 
	font-size: 1.2em;
 
	border-top: dotted 1px #D5E1E6;
 
@@ -478,111 +481,102 @@ 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 **/
 
#changeset_content{
 
	width:60%;
 
	float:left;
 
}
 

	
 
#changeset_content .container .wrapper{
 
	width: 600px;
 
}
 
#changeset_content .container{
 
	border:1px solid #CCCCCC;
 
	height:120px;
 
}
 

	
 
#changeset_content .container .left{
 
	float:left;
 
	width: 70%;
 
	padding-left: 5px;
 
}
 

	
 
#changeset_content .container .right{
 
	float:right;
 
	width: 25%;
 
	text-align: right;
 
}
 

	
 
#changeset_content .container .left .date{
 
	font-weight:bold;
 
}
 
#changeset_content .container .left .author{
 
	
 
}
 
#changeset_content .container .left .message{
 

	
 
	font-style: italic;
 
	color: #556CB5;
 
}
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 
.cs_files{
 
	border: 1px solid #CCCCCC;
 
	width: 60%;
 
	
 
}
 

	
 
.cs_files .cs_added{
 
	background: url("/images/icons/page_white_add.png") no-repeat scroll 3px;
 
	/*background-color:#BBFFBB;*/
 
	height: 16px;
 
	padding-left: 20px;
 
	margin-top: 7px;
 
	text-align: left;	
 
}
 
.cs_files .cs_changed{
 
	background: url("/images/icons/page_white_edit.png") no-repeat scroll 3px;
 
	/*background-color: #FFDD88;*/
 
	height: 16px;
 
	padding-left: 20px;
 
	margin-top: 7px;
 
	text-align: left;	
 
}
 
.cs_files .cs_removed{
 
	background: url("/images/icons/page_white_delete.png") no-repeat scroll 3px;
 
	/*background-color: #FF8888;*/
 
	height: 16px;
 
	padding-left: 20px;
 
	margin-top: 7px;
 
	text-align: left;	
 
}
 

	
 
/** end of changeset **/ 
 

	
 
/** canvas **/
 
canvas {
 
	position: absolute;
 
	z-index: 5;
 
	top: -0.7em;
 
}
 
#graph{
 
	overflow: hidden;
 

	
 
}
 
#graph_nodes{
 
	width:160px;
 
	float:left;
 
}
 

	
 
#graph_content{
 
	width:800px;
 
	float:left;
 
}
pylons_app/templates/base/base.html
Show inline comments
 
@@ -20,107 +20,108 @@
 
    	${next.main()}
 
    </div>
 
    <div class="page-footer">
 
        Hg App ${c.hg_app_version} &copy; 2010 by Marcin Kuzminski
 
    </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>
 

	
 
### MAKO DEFS ### 
 

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

	
 
<%def name="menu(current)">
 
<% 
 
def is_current(selected):
 
	if selected == current:
 
		return "class='current'"
 
%>
 
		%if current not in ['home','admin']:
 
		##regular menu
 
	       <script type="text/javascript">
 
	       	YAHOO.util.Event.onDOMReady(function(){
 
				YAHOO.util.Event.addListener('repo_switcher','click',function(){
 
					if(YAHOO.util.Dom.hasClass('repo_switcher','selected')){
 
						YAHOO.util.Dom.setStyle('switch_repos','display','none');
 
						YAHOO.util.Dom.setStyle('repo_switcher','background','');
 
						YAHOO.util.Dom.removeClass('repo_switcher','selected');
 
					}
 
					else{
 
						YAHOO.util.Dom.setStyle('switch_repos','display','');
 
						YAHOO.util.Dom.setStyle('repo_switcher','background','#FFFFFF');
 
						YAHOO.util.Dom.setStyle('repo_switcher','color','#556CB5');
 
						YAHOO.util.Dom.addClass('repo_switcher','selected');
 
					}
 
					});
 
				YAHOO.util.Event.addListener('repos_list','change',function(e){
 
		            var wa = YAHOO.util.Dom.get('repos_list').value;
 
		        	
 
		            var url = "${h.url('summary_home',repo_name='__REPLACE__')}".replace('__REPLACE__',wa);
 
			        window.location = url;
 
				})
 
	           });
 
	       	</script>
 
	       	</script>       	
 
	        <ul class="page-nav">
 
				<li>
 
					<a id="repo_switcher" title="${_('Switch repository')}" href="#">&darr;</a>
 
					<div id="switch_repos" style="display:none;position: absolute;width: 150px;height: 25px">
 
						<select id="repos_list" size="=10">
 
						%for repo in c.cached_repo_list:
 
							<option value="${repo['name']}">${repo['name']}</option>
 
						%endfor
 
						</select>
 
					</div>			
 
				</li>
 
	            <li ${is_current('summary')}>${h.link_to(_('summary'),h.url('summary_home',repo_name=c.repo_name))}</li>
 
	            <li ${is_current('shortlog')}>${h.link_to(_('shortlog'),h.url('shortlog_home',repo_name=c.repo_name))}</li>
 
				<li ${is_current('changelog')}>${h.link_to(_('changelog'),h.url('changelog_home',repo_name=c.repo_name))}</li>            
 
	            <li ${is_current('branches')}>${h.link_to(_('branches'),h.url('branches_home',repo_name=c.repo_name))}</li>
 
	            <li ${is_current('tags')}>${h.link_to(_('tags'),h.url('tags_home',repo_name=c.repo_name))}</li>
 
	            <li ${is_current('files')}>${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name))}</li>
 
	        </ul>
 
		%else:
 
		##Root menu
 
			<ul class="page-nav">
 
				<li ${is_current('home')}>${h.link_to(_('Home'),h.url('/'))}</li>
 
				<li ${is_current('admin')}>${h.link_to(_('Admin'),h.url('admin_home'))}</li>
 
				<li class="logout">${h.link_to(u'Logout',h.url('logout_home'))}</li>
 
			</ul>
 
		%endif    
 
		</div>
 
</%def>
 
<%def name="submenu(current=None)">
 
	<% 
 
	def is_current(selected):
 
		if selected == current:
 
			return "class='current_submenu'"
 
	%>
 
	%if current != None:
 
	<div>
 
    <ul class="submenu">
 
        <li ${is_current('repos')}>${h.link_to(u'repos',h.url('repos'),class_='repos')}</li>
 
        <li ${is_current('users')}>${h.link_to(u'users',h.url('users'),class_='users')}</li>
 
        <li ${is_current('permissions')}>${h.link_to(u'permissions',h.url('permissions'),class_='permissions')}</li>
 
    </ul>
 
    </div>
 
    %endif
 
</%def>
 

	
 

	
 
<%def name="css()">
 
<link rel="stylesheet" href="/css/monoblue_custom.css" type="text/css" />
pylons_app/templates/changeset/changeset.html
Show inline comments
 
@@ -9,82 +9,86 @@ from pylons_app.lib import filters
 
<%def name="breadcrumbs()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    / 
 
    ${h.link_to(c.repo_name,h.url('changeset_home',repo_name=c.repo_name))}
 
    /
 
    ${_('changeset')}
 
</%def>
 
<%def name="page_nav()">
 
    ${self.menu('changelog')}     
 
</%def>
 
<%def name="css()">
 
<link rel="stylesheet" href="/css/monoblue_custom.css" type="text/css" />
 
<link rel="stylesheet" href="/css/diff.css" type="text/css" />
 
</%def>
 
<%def name="main()">
 
    <h2 class="no-link no-border">${_('Changeset')} - r${c.changeset.revision}:${c.changeset.raw_id}</h2>
 
    
 
    <div id="changeset_content">
 
		<div class="container">
 
			<div class="left">
 
				<div class="date">${_('Date')}: ${c.changeset.date}</div>
 
				<div class="author">${_('Author')}: ${c.changeset.author}</div>
 
				<div class="message">
 
					${c.changeset.message}
 
				</div>
 
			</div>	
 
			<div class="right">
 
				<span class="logtags">
 
					<span class="branchtag">${c.changeset.branch}</span>
 
					%for tag in c.changeset.tags:
 
						<span class="tagtag">${tag}</span>
 
					%endfor
 
				</span>					
 
				%if len(c.changeset.parents)>1:
 
				<div class="merge">		
 
				${_('merge')}
 
				<img alt="merge" src="/images/icons/arrow_join.png">
 
				</div>
 
				%endif						
 
				%for p_cs in reversed(c.changeset.parents):
 
					<div class="parent">${_('Parrent')} ${p_cs.revision}: ${h.link_to(p_cs.raw_id,
 
						h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}
 
					</div>
 
				%endfor								
 
			</div>		
 
		</div>    
 
    </div>
 
    
 
    <div style="clear: both"></div>
 
    <div style="clear:both;height:10px"></div>
 
    <div class="cs_files">
 
			%for change,filenode,diff in c.changes:
 
				<div class="cs_${change}">${h.link_to(filenode.path,h.url.current(anchor='CHANGE-%s'%filenode.path))}</div>
 
			%endfor
 
	</div>
 
	
 
	%for change,filenode,diff in c.changes:
 
		%if change !='removed':
 
		<div style="clear:both;height:10px"></div>
 
		<div id="body" class="diffblock">
 
			<div id="${'CHANGE-%s'%filenode.path}" class="code-header">
 
				<div>
 
				<span>
 
					${h.link_to_if(change!='removed',filenode.path,h.url('files_home',repo_name=c.repo_name,
 
					revision=filenode.changeset.raw_id,f_path=filenode.path))}
 
				</span>
 
				
 
				##&raquo; <span style="font-size:77%">${h.link_to(_('diff'),
 
				##h.url.current(diff2=c.diff2,diff1=c.diff1,diff='diff'))}</span>
 
				##&raquo; <span style="font-size:77%">${h.link_to(_('raw diff'),
 
				##h.url.current(diff2=c.diff2,diff1=c.diff1.split(':')[-1],diff='raw'))}</span>
 
				##&raquo; <span style="font-size:77%">${h.link_to(_('download diff'),
 
				##h.url.current(diff2=c.diff2,diff1=c.diff1,diff='download'))}</span>
 
					<span>
 
						${h.link_to_if(change!='removed',filenode.path,h.url('files_home',repo_name=c.repo_name,
 
						revision=filenode.changeset.raw_id,f_path=filenode.path))}
 
					</span>
 
					
 
					##&raquo; <span style="font-size:77%">${h.link_to(_('diff'),
 
					##h.url.current(diff2=c.diff2,diff1=c.diff1,diff='diff'))}</span>
 
					##&raquo; <span style="font-size:77%">${h.link_to(_('raw diff'),
 
					##h.url.current(diff2=c.diff2,diff1=c.diff1.split(':')[-1],diff='raw'))}</span>
 
					##&raquo; <span style="font-size:77%">${h.link_to(_('download diff'),
 
					##h.url.current(diff2=c.diff2,diff1=c.diff1,diff='download'))}</span>
 
				</div>
 
			</div>
 
			<div class="code-body">        
 
					${diff|n}
 
					%if diff:
 
						${diff|n}
 
					%else:
 
						${_('No changes in this file')}
 
					%endif
 
			</div>
 
		</div>
 
		%endif
 
	%endfor
 
			
 
</%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()">
 
	${self.menu('home')}
 
</%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>${h.link_to('r%s:%s' % (repo['rev'],repo['tip']),h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']))}</td>
 
	        <td title="${repo['contact']}">${repo['contact']|n,filters.person}</td>
 
	        
 
	        	%for archive in repo['repo_archives']:
 
	        	<td class="indexlinks">
 
	        		${h.link_to(archive['type'],
 
       				h.url('files_archive_home',repo_name=repo['name'],
 
       				revision='tip',fileformat=archive['extension']),class_="archive_logo" )}
 
				</td>
 
				%endfor
 
	        	##%for archive in repo['repo_archives']:
 
	        	##<td class="indexlinks">
 
	        	##	${h.link_to(archive['type'],
 
       			##	h.url('files_archive_home',repo_name=repo['name'],
 
       			##	revision='tip',fileformat=archive['extension']),class_="archive_logo" )}
 
				##</td>
 
				##%endfor
 
	        
 
			<td>
 
				${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=repo['name']),class_='rss_logo')}
 
			</td>        
 
			<td>
 
				${h.link_to(_('Atom'),h.url('atom_feed_home',repo_name=repo['name']),class_='atom_logo')}
 
			</td>
 
		</tr>
 
	%endfor
 
	</table>
 
</%def>    
pylons_app/templates/summary/summary.html
Show inline comments
 
<%inherit file="/base/base.html"/>
 
<%!
 
from pylons_app.lib import filters
 
%>
 
<%def name="title()">
 
    ${_('Repository managment')}
 
</%def>
 
<%def name="breadcrumbs()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    / 
 
    ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
 
    /
 
    ${_('summary')}
 
</%def>
 
<%def name="page_nav()">
 
	${self.menu('summary')}    
 
</%def>
 

	
 
<%def name="js()">
 
<script type="text/javascript" src="/js/yui/utilities/utilities.js"></script>
 
<script type="text/javascript">
 
var E = YAHOO.util.Event;
 
var D = YAHOO.util.Dom;
 

	
 
E.onDOMReady(function(e){
 
    id = 'clone_url';
 
	E.addListener(id,'click',function(e){
 
	    D.get('clone_url').select();
 
	})
 
})
 
</script>
 
</%def>
 

	
 
<%def name="main()">
 
    <h2 class="no-link no-border">${_('Mercurial Repository Overview')}</h2>
 
    <dl class="overview">
 
        <dt>${_('name')}</dt>
 
        <dd>${c.repo_info.name}</dd>
 
        <dt>${_('description')}</dt>
 
        <dd>${c.repo_info.description}</dd>
 
        <dt>${_('contact')}</dt>
 
        <dd>${c.repo_info.contact}</dd>
 
        <dt>${_('last change')}</dt>
 
        <dd>${c.repo_info.last_change|n,filters.rfc822date} - ${c.repo_info.last_change|n,filters.age}</dd>
 
        <dd>${c.repo_info.last_change|n,filters.age} - ${c.repo_info.last_change|n,filters.rfc822date}</dd>
 
        <dt>${_('clone url')}</dt>
 
        <dd><input type="text" id="clone_url"  readonly="readonly" value="hg clone ${c.clone_repo_url}" size="40"/></dd>
 
        <dt>${_('download')}</dt>
 
        <dd>
 
       	%for cnt,archive in enumerate(c.repo_info._get_archives()):
 
       		 %if cnt >=1:
 
       		 |
 
       		 %endif
 
       		 ${h.link_to(c.repo_info.name+'.'+archive['type'],
 
       			h.url('files_archive_home',repo_name=c.repo_info.name,
 
       			revision='tip',fileformat=archive['extension']),class_="archive_logo")}
 
		%endfor
 
        </dd>
 
        <dt>${_('feeds')}</dt>
 
        <dd>
 
        	${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.repo_info.name),class_='rss_logo')}
 
			${h.link_to(_('Atom'),h.url('atom_feed_home',repo_name=c.repo_info.name),class_='atom_logo')}
 
        </dd>
 
    </dl>
 

	
 
    <h2>${h.link_to(_('Changes'),h.url('changelog_home',repo_name=c.repo_name))}</h2>
 
    <table>
 
	<%def name="message_slug(msg)">
 
		<%
 
		limit = 60
 
		if len(msg) > limit:
 
			return msg[:limit]+'...'
 
		else:
 
			return msg
 
		%>
 
	</%def>    
 
	%for cnt,cs in enumerate(c.repo_changesets):
 
		<tr class="parity${cnt%2}">
 
			<td>${cs._ctx.date()|n,filters.age}</td>
 
			<td>${cs.author|n,filters.person}</td>
 
			<td>r${cs.revision}</td>
 
			<td>
 
				${h.link_to(message_slug(cs.message),
 
				h.url('changeset_home',repo_name=c.repo_name,revision=cs._short),
 
				title=cs.message)}
 
			</td>
 
			<td>
 
				<span class="logtags">
 
					<span class="branchtag">${cs.branch}</span>
 
					%for tag in cs.tags:
 
						<span class="tagtag">${tag}</span>
 
					%endfor
 
				</span>
 
			</td>
 
			<td class="nowrap">
 
			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=cs._short))}
 
			|
 
			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=cs._short))}
 
			</td>
 
		</tr>
 
	%endfor
 
    </table>
 

	
 
    <h2>${h.link_to(_('Tags'),h.url('tags_home',repo_name=c.repo_name))}</h2>
 
    <table>
 
		%for cnt,tag in enumerate(c.repo_tags):
 
		<tr class="parity${cnt%2}">
 
			<td>${tag._ctx.date()|n,filters.age}</td>
 
			<td>
 
				<span class="logtags">
 
					<span class="tagtag">${h.link_to(tag.tags[-1],h.url('changeset_home',repo_name=c.repo_name,revision=tag._short))}</span>
0 comments (0 inline, 0 general)