Changeset - 3a567e329fb6
[Not reviewed]
default
0 5 0
Marcin Kuzminski - 15 years ago 2010-09-30 18:35:03
marcin@python-works.com
updated whoosh deps,
fixed templates, changelog and changeset stylings
changed 8 letter password into 6 letter passwords required
5 files changed with 31 insertions and 16 deletions:
0 comments (0 inline, 0 general)
pylons_app/model/forms.py
Show inline comments
 
@@ -235,69 +235,69 @@ class ValidSystemEmail(formencode.valida
 
                raise formencode.Invalid(_("That e-mail address doesn't exist.") ,
 
                                         value, state)
 
        finally:
 
            meta.Session.remove()
 
            
 
        return value     
 

	
 
#===============================================================================
 
# FORMS        
 
#===============================================================================
 
class LoginForm(formencode.Schema):
 
    allow_extra_fields = True
 
    filter_extra_fields = True
 
    username = UnicodeString(
 
                             strip=True,
 
                             min=1,
 
                             not_empty=True,
 
                             messages={
 
                                       'empty':_('Please enter a login'),
 
                                       'tooShort':_('Enter a value %(min)i characters long or more')}
 
                            )
 

	
 
    password = UnicodeString(
 
                            strip=True,
 
                            min=8,
 
                            min=6,
 
                            not_empty=True,
 
                            messages={
 
                                      'empty':_('Please enter a password'),
 
                                      'tooShort':_('Enter a value %(min)i characters long or more')}
 
                                )
 

	
 

	
 
    #chained validators have access to all data
 
    chained_validators = [ValidAuth]
 
    
 
def UserForm(edit=False, old_data={}):
 
    class _UserForm(formencode.Schema):
 
        allow_extra_fields = True
 
        filter_extra_fields = True
 
        username = All(UnicodeString(strip=True, min=1, not_empty=True), ValidUsername(edit, old_data))
 
        if edit:
 
            new_password = All(UnicodeString(strip=True, min=8, not_empty=False), ValidPassword)
 
            new_password = All(UnicodeString(strip=True, min=6, not_empty=False), ValidPassword)
 
            admin = StringBoolean(if_missing=False)
 
        else:
 
            password = All(UnicodeString(strip=True, min=8, not_empty=True), ValidPassword)
 
            password = All(UnicodeString(strip=True, min=6, not_empty=True), ValidPassword)
 
        active = StringBoolean(if_missing=False)
 
        name = UnicodeString(strip=True, min=1, not_empty=True)
 
        lastname = UnicodeString(strip=True, min=1, not_empty=True)
 
        email = All(Email(not_empty=True), UniqSystemEmail(old_data))
 
        
 
    return _UserForm
 

	
 
RegisterForm = UserForm
 

	
 
def PasswordResetForm():
 
    class _PasswordResetForm(formencode.Schema):
 
        allow_extra_fields = True
 
        filter_extra_fields = True
 
        email = All(ValidSystemEmail(), Email(not_empty=True))             
 
    return _PasswordResetForm
 

	
 
def RepoForm(edit=False, old_data={}):
 
    class _RepoForm(formencode.Schema):
 
        allow_extra_fields = True
 
        filter_extra_fields = False
 
        repo_name = All(UnicodeString(strip=True, min=1, not_empty=True), ValidRepoName(edit, old_data))
 
        description = UnicodeString(strip=True, min=1, not_empty=True)
 
        private = StringBoolean(if_missing=False)
 
        
pylons_app/public/css/style.css
Show inline comments
 
@@ -1140,49 +1140,49 @@ div.options a:hover
 
}
 
 
#content div.box img.right
 
{
 
    margin: 10px 0 10px 10px;
 
	border: none;
 
	float: right;
 
}
 
 
/* -----------------------------------------------------------
 
	content -> right -> box / messages
 
----------------------------------------------------------- */ 
 
 
#content div.box div.messages
 
{
 
	margin: 0 20px 0 20px;
 
    padding: 0;
 
	clear: both;
 
	overflow: hidden;
 
}
 
 
#content div.box div.message
 
{
 
	margin: 0 0 0px 0;
 
    padding: 0 0 10px 0;
 
    padding: 10px 0 10px 0;
 
	clear: both;
 
	overflow: hidden;
 
}
 
 
#content div.box div.message div.image
 
{
 
	margin: 9px 0 0 5px;
 
	padding: 6px;
 
	float: left;
 
}
 
 
#content div.box div.message div.image img
 
{
 
    margin: 0;
 
    vertical-align: middle;
 
}
 
 
#content div.box div.message div.text
 
{
 
    margin: 0;
 
    padding: 9px 6px 9px 6px;
 
    float: left;
 
}
 
 
@@ -3037,49 +3037,51 @@ h3.files_location{
 
    float:left;
 
    margin:0 !important;
 
    padding:5px;
 
    width:115px;
 
}
 
#files_data dl dd{
 
    margin:0 !important;
 
    padding: 5px !important;
 
}
 
 
 
/* -----------------------------------------------------------
 
	CHANGESETS
 
----------------------------------------------------------- */
 
#changeset_content {
 
	border:1px solid #CCCCCC;
 
	padding:5px;
 
}
 
 
#changeset_content .container .wrapper {
 
	width: 600px;
 
}
 
 
#changeset_content .container {
 
	height: 120px;
 
	min-height: 120px;
 
	font-size: 1.2em;
 
	
 
}
 
 
#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;
 
@@ -3169,49 +3171,48 @@ h3.files_location{
 
	text-align: right;
 
}
 
 
#graph_content .container .left .date {
 
	font-weight: bold;
 
}
 
 
#graph_content .container .left .author {
 
	
 
}
 
 
#graph_content .container .left .message {
 
	font-size: 100%;
 
	padding-top: 3px;
 
}
 
 
.right div {
 
	clear: both;
 
}
 
 
.right .changes .added,.changed,.removed {
 
	border: 1px solid #DDDDDD;
 
	display: block;
 
	float: right;
 
	font-size: 0.75em;
 
	text-align: center;
 
	min-width: 15px;
 
}
 
 
.right .changes .added {
 
	background: #BBFFBB;
 
}
 
 
.right .changes .changed {
 
	background: #FFDD88;
 
}
 
 
.right .changes .removed {
 
	background: #FF8888;
 
}
 
 
.right .merge {
 
	vertical-align: top;
 
	font-size: 60%;
 
	font-weight: bold;
 
}
 
 
.right .merge img {
 
	vertical-align: bottom;
pylons_app/templates/changelog/changelog.html
Show inline comments
 
## -*- coding: utf-8 -*-
 

	
 
<%inherit file="/base/base.html"/>
 

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

	
 
<%def name="breadcrumbs_links()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    &raquo;
 
    ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
 
    &raquo;
 
    ${_('Changelog')} - ${_('showing ')} ${c.size if c.size <= c.total_cs else c.total_cs} ${_('out of')} ${c.total_cs} ${_('revisions')}  
 
</%def>
 

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

	
 
<%def name="main()">
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
    </div>
 
    <div class="table">
 
		% if c.pagination:
 
			<div id="graph">
 
				<div id="graph_nodes">
pylons_app/templates/changeset/changeset.html
Show inline comments
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('Changeset')}
 
    ${_('Changeset')} - r${c.changeset.revision}:${c.changeset.short_id} - ${c.repo_name}
 
</%def>
 

	
 
<%def name="breadcrumbs_links()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    &raquo;
 
    ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
 
    &raquo;
 
    ${_('Changeset')} - r${c.changeset.revision}:${c.changeset.short_id}
 
</%def>
 

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

	
 
<%def name="main()">
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
    </div>
 
    <div class="table">
 
		<div id="body" class="diffblock">
 
			<div class="code-header">
 
				<div>
 
				${_('Changeset')} - r${c.changeset.revision}:${c.changeset.short_id}
 
				 &raquo; <span>${h.link_to(_('raw diff'),
 
				h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.short_id,diff='show'))}</span>
 
				 &raquo; <span>${h.link_to(_('download diff'),
 
				h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.short_id,diff='download'))}</span>
 
				</div>
 
			</div>
 
		</div>
 
		    
 
    <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">${h.wrap_paragraphs(c.changeset.message)}</div>
 
	                 <div class="date">${_('commit')} ${c.changeset.revision}: ${c.changeset.short_id}@${c.changeset.date}</div>
 
	                 <div class="author">
 
	                     <div class="gravatar">
 
	                         <img alt="gravatar" src="${h.gravatar_url(h.email(c.changeset.author),20)}"/>
 
	                     </div>
 
	                     <span>${h.person(c.changeset.author)}</span><br/>
 
	                     <span><a href="mailto:${h.email_or_none(c.changeset.author)}">${h.email_or_none(c.changeset.author)}</a></span><br/>
 
	                 </div>
 
	                 <div class="message">
 
	                     ${h.link_to(h.wrap_paragraphs(c.changeset.message),
 
	                     h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.short_id))}
 
	                 </div>
 
			</div>	
 
			<div class="right">
 
		             <div class="changes">
 
		                 <span class="removed" title="${_('removed')}">${len(c.changeset.removed)}</span>
 
		                 <span class="changed" title="${_('changed')}">${len(c.changeset.changed)}</span>
 
		                 <span class="added" title="${_('added')}">${len(c.changeset.added)}</span>
 
		             </div>                  
 
				%if len(c.changeset.parents)>1:
 
				<div class="merge">		
 
				${_('merge')}
 
				<img alt="merge" src="/images/icons/arrow_join.png">
 
		                     ${_('merge')}<img alt="merge" src="/images/icons/arrow_join.png"/>
 
				</div>
 
				%endif						
 
				%for p_cs in reversed(c.changeset.parents):
 
					<div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs.short_id,
 
						h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.short_id),title=p_cs.message)}
 
					</div>
 
				%endfor
 
                <span class="logtags">
 
                    <span class="branchtag" title="${'%s %s' % (_('branch'),c.changeset.branch)}">
 
                    ${h.link_to(c.changeset.branch,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.short_id))}</span>
 
                    %for tag in c.changeset.tags:
 
                        <span class="tagtag"  title="${'%s %s' % (_('tag'),tag)}">
 
                        ${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.short_id))}</span>
 
                    %endfor
 
                </span>                 									
 
			</div>		
 
		</div>
 
		<span style="font-size:1.1em;font-weight: bold">${_('Files affected')}</span>
 
	    <div class="cs_files">
 
				%for change,filenode,diff,cs1,cs2 in c.changes:
 
					<div class="cs_${change}">${h.link_to(filenode.path,h.url.current(anchor='CHANGE-%s'%filenode.path))}</div>
 
				%endfor
 
		</div>		    
 
    </div>
 
    	
 
    </div>
 
    	
 
	%for change,filenode,diff,cs1,cs2 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.short_id,f_path=filenode.path))}
 
					</span>
 
					%if 1:
 
					&raquo; <span>${h.link_to(_('diff'),
 
					h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='diff'))}</span>
 
					&raquo; <span>${h.link_to(_('raw diff'),
 
					h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='raw'))}</span>
 
					&raquo; <span>${h.link_to(_('download diff'),
 
					h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='download'))}</span>
 
					%endif
 
				</div>
 
			</div>
 
			<div class="code-body">        
 
					%if diff:
 
						${diff|n}
 
					%else:
setup.py
Show inline comments
 
from pylons_app import get_version
 
try:
 
    from setuptools import setup, find_packages
 
except ImportError:
 
    from ez_setup import use_setuptools
 
    use_setuptools()
 
    from setuptools import setup, find_packages
 

	
 
setup(
 
    name='HgApp-%s' % get_version(),
 
    version=get_version(),
 
    description='Mercurial repository serving and browsing app',
 
    keywords='mercurial web hgwebdir replacement serving hgweb',
 
    license='BSD',
 
    author='marcin kuzminski',
 
    author_email='marcin@python-works.com',
 
    url='http://hg.python-works.com',
 
    install_requires=[
 
        "Pylons>=1.0.0",
 
        "SQLAlchemy>=0.6",
 
        "babel",
 
        "Mako>=0.3.2",
 
        "vcs>=0.1.6",
 
        "vcs>=0.1.7",
 
        "pygments>=1.3.0",
 
        "mercurial>=1.6",
 
        "pysqlite",
 
        "whoosh==1.0.0b17",
 
        "whoosh==1.0.0b19",
 
        "py-bcrypt",
 
        "celery",
 
    ],
 
    setup_requires=["PasteScript>=1.6.3"],
 
    packages=find_packages(exclude=['ez_setup']),
 
    include_package_data=True,
 
    test_suite='nose.collector',
 
    package_data={'pylons_app': ['i18n/*/LC_MESSAGES/*.mo']},
 
    message_extractors={'pylons_app': [
 
            ('**.py', 'python', None),
 
            ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}),
 
            ('public/**', 'ignore', None)]},
 
    zip_safe=False,
 
    paster_plugins=['PasteScript', 'Pylons'],
 
    entry_points="""
 
    [paste.app_factory]
 
    main = pylons_app.config.middleware:make_app
 

	
 
    [paste.app_install]
 
    main = pylons.util:PylonsInstaller
 
    """,
 
)
0 comments (0 inline, 0 general)