Mercurial > kallithea
changeset 127:20dc7a5eb748
Html changes and cleanups, made folders for html templates, implemented tags and branches pages
line wrap: on
line diff
--- a/pylons_app/controllers/admin.py Mon May 03 18:31:00 2010 +0200 +++ b/pylons_app/controllers/admin.py Mon May 03 19:07:54 2010 +0200 @@ -43,7 +43,7 @@ except formencode.Invalid, error: c.form_result = error.value c.form_errors = error.error_dict or {} - html = render('/admin.html') + html = render('admin/admin.html') return htmlfill.render( html, @@ -57,10 +57,10 @@ .order_by(UserLogs.action_date.desc()) p = int(request.params.get('page', 1)) c.users_log = Page(users_log, page=p, items_per_page=10) - c.log_data = render('admin_log.html') + c.log_data = render('admin/admin_log.html') if request.params.get('partial'): return c.log_data - return render('/admin.html') + return render('admin/admin.html') def hgrc(self, dirname): filename = os.path.join(dirname, '.hg', 'hgrc')
--- a/pylons_app/controllers/branches.py Mon May 03 18:31:00 2010 +0200 +++ b/pylons_app/controllers/branches.py Mon May 03 19:07:54 2010 +0200 @@ -1,16 +1,22 @@ import logging -from pylons import request, response, session, tmpl_context as c, url +from pylons import tmpl_context as c, app_globals as g, session, request, config, url from pylons.controllers.util import abort, redirect from pylons_app.lib.base import BaseController, render +from pylons_app.lib.utils import get_repo_slug +from pylons_app.model.hg_model import HgModel +log = logging.getLogger(__name__) -log = logging.getLogger(__name__) class BranchesController(BaseController): + def __before__(self): + c.repos_prefix = config['repos_name'] + c.repo_name = get_repo_slug(request) def index(self): - # Return a rendered template - #return render('/branches.mako') - # or, return a string - return 'Hello World' + hg_model = HgModel() + c.repo_info = hg_model.get_repo(c.repo_name) + c.repo_branches = c.repo_info.branches + + return render('branches/branches.html')
--- a/pylons_app/controllers/changelog.py Mon May 03 18:31:00 2010 +0200 +++ b/pylons_app/controllers/changelog.py Mon May 03 19:07:54 2010 +0200 @@ -13,17 +13,15 @@ class ChangelogController(BaseController): def __before__(self): c.repos_prefix = config['repos_name'] - c.repo_name = get_repo_slug(request) - def index(self): hg_model = HgModel() p = int(request.params.get('page', 1)) repo = hg_model.get_repo(c.repo_name) c.repo_changesets = Page(repo, page=p, items_per_page=20) - c.shortlog_data = render('shortlog_data.html') + c.shortlog_data = render('shortlog/shortlog_data.html') if request.params.get('partial'): return c.shortlog_data - r = render('/shortlog.html') + r = render('shortlog/shortlog.html') return r
--- a/pylons_app/controllers/repos.py Mon May 03 18:31:00 2010 +0200 +++ b/pylons_app/controllers/repos.py Mon May 03 19:07:54 2010 +0200 @@ -31,7 +31,7 @@ hg_model = HgModel() c.repos_list = list(hg_model.get_repos()) c.repos_list.sort(key=itemgetter('name')) - return render('/repos.html') + return render('admin/repos/repos.html') def create(self): """POST /repos: Create a new item"""
--- a/pylons_app/controllers/shortlog.py Mon May 03 18:31:00 2010 +0200 +++ b/pylons_app/controllers/shortlog.py Mon May 03 19:07:54 2010 +0200 @@ -13,17 +13,15 @@ class ShortlogController(BaseController): def __before__(self): c.repos_prefix = config['repos_name'] - c.repo_name = get_repo_slug(request) - def index(self): hg_model = HgModel() p = int(request.params.get('page', 1)) repo = hg_model.get_repo(c.repo_name) c.repo_changesets = Page(repo, page=p, items_per_page=20) - c.shortlog_data = render('shortlog_data.html') + c.shortlog_data = render('shortlog/shortlog_data.html') if request.params.get('partial'): return c.shortlog_data - r = render('/shortlog.html') + r = render('shortlog/shortlog.html') return r
--- a/pylons_app/controllers/summary.py Mon May 03 18:31:00 2010 +0200 +++ b/pylons_app/controllers/summary.py Mon May 03 19:07:54 2010 +0200 @@ -11,7 +11,6 @@ class SummaryController(BaseController): def __before__(self): c.repos_prefix = config['repos_name'] - c.repo_name = get_repo_slug(request) def index(self):
--- a/pylons_app/controllers/tags.py Mon May 03 18:31:00 2010 +0200 +++ b/pylons_app/controllers/tags.py Mon May 03 19:07:54 2010 +0200 @@ -1,16 +1,22 @@ import logging -from pylons import request, response, session, tmpl_context as c, url +from pylons import tmpl_context as c, app_globals as g, session, request, config, url from pylons.controllers.util import abort, redirect from pylons_app.lib.base import BaseController, render +from pylons_app.lib.utils import get_repo_slug +from pylons_app.model.hg_model import HgModel +log = logging.getLogger(__name__) -log = logging.getLogger(__name__) class TagsController(BaseController): - + def __before__(self): + c.repos_prefix = config['repos_name'] + c.repo_name = get_repo_slug(request) + def index(self): - # Return a rendered template - #return render('/tags.mako') - # or, return a string - return 'Hello World' + hg_model = HgModel() + c.repo_info = hg_model.get_repo(c.repo_name) + c.repo_tags = c.repo_info.tags + + return render('tags/tags.html')
--- a/pylons_app/controllers/users.py Mon May 03 18:31:00 2010 +0200 +++ b/pylons_app/controllers/users.py Mon May 03 19:07:54 2010 +0200 @@ -30,7 +30,7 @@ # url('users') c.users_list = self.sa.query(Users).all() - return render('/users.html') + return render('admin/users/users.html') def create(self): """POST /users: Create a new item""" @@ -54,7 +54,7 @@ def new(self, format='html'): """GET /users/new: Form to create a new item""" # url('new_user') - return render('/user_add.html') + return render('admin/users/user_add.html') def update(self, id): """PUT /users/id: Update an existing item""" @@ -107,7 +107,7 @@ c.user = self.sa.query(Users).get(id) defaults = c.user.__dict__ return htmlfill.render( - render('/user_edit.html'), + render('admin/users/user_edit.html'), defaults=defaults, encoding="UTF-8", force_defaults=False
--- a/pylons_app/templates/add.html Mon May 03 18:31:00 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -## -*- 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"/> - <link rel="stylesheet" href="/images/style-monoblue.css" type="text/css" /> - <title> Mercurial repositories add</title> -</head> - -<body> -<div id="container"> - <div class="page-header"> - <h1><a href="/">Home</a> / Admin</h1> - <ul class="page-nav"> - </ul> - </div> - <table cellspacing="0"> - <tr> - <td><h1>${c.msg}</h1></td> - </tr> - <tr> - <td><h2>${c.new_repo}</h2></td> - </tr> - </table> - <div class="page-footer"> - Mercurial Repository: admin - </div> - - <div id="powered-by"> - <p> - <a href="http://mercurial.selenic.com/" title="Mercurial"> - <img src="/images/hglogo.png" width="75" height="90" border=0 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> - \ No newline at end of file
--- a/pylons_app/templates/admin.html Mon May 03 18:31:00 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -## -*- coding: utf-8 -*- -<%inherit file="base/base.html"/> - <%def name="get_form_error(element)"> - %if hasattr(c,'form_errors'): - %if type(c.form_errors) == dict: - %if c.form_errors.get(element,False): - <span class="error-message"> - ${c.form_errors.get(element,'')} - </span> - %endif - %endif - %endif - </%def> -<%def name="title()"> - ${_('Repository managment')} -</%def> -<%def name="breadcrumbs()"> - ${h.link_to(u'Home',h.url('/'))} - / - ${h.link_to(u'Admin',h.url('admin_home'))} -</%def> -<%def name="page_nav()"> -<li>${h.link_to(u'Home',h.url('/'))}</li> -<li class="current">${_('Admin')}</li> -</%def> -<%def name="main()"> - %if c.admin_user: - <ul class="submenu"> - <li> - ${h.link_to(u'Repos',h.url('repos'))} - </li> - <li> - ${h.link_to(u'Users',h.url('users'))} - </li> - </ul> - <br/> - <div> - <h2>Welcome ${c.admin_username}</h2> - <div id="user_log"> - ${c.log_data} - </div> - </div> - %else: - <div> - <br /> - <h2>${_('Login')}</h2> - ${h.form(h.url.current())} - <table> - <tr> - <td>${_('Username')}</td> - <td>${h.text('username')}</td> - <td>${get_form_error('username')} </td> - </tr> - <tr> - <td>${_('Password')}</td> - <td>${h.password('password')}</td> - <td>${get_form_error('password')}</td> - </tr> - <tr> - <td></td> - <td>${h.submit('login','login')}</td> - </tr> - </table> - ${h.end_form()} - </div> - %endif - -</%def> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pylons_app/templates/admin/add.html Mon May 03 19:07:54 2010 +0200 @@ -0,0 +1,45 @@ +## -*- 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"/> + <link rel="stylesheet" href="/images/style-monoblue.css" type="text/css" /> + <title> Mercurial repositories add</title> +</head> + +<body> +<div id="container"> + <div class="page-header"> + <h1><a href="/">Home</a> / Admin</h1> + <ul class="page-nav"> + </ul> + </div> + <table cellspacing="0"> + <tr> + <td><h1>${c.msg}</h1></td> + </tr> + <tr> + <td><h2>${c.new_repo}</h2></td> + </tr> + </table> + <div class="page-footer"> + Mercurial Repository: admin + </div> + + <div id="powered-by"> + <p> + <a href="http://mercurial.selenic.com/" title="Mercurial"> + <img src="/images/hglogo.png" width="75" height="90" border=0 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> + \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pylons_app/templates/admin/admin.html Mon May 03 19:07:54 2010 +0200 @@ -0,0 +1,68 @@ +## -*- coding: utf-8 -*- +<%inherit file="/base/base.html"/> + <%def name="get_form_error(element)"> + %if hasattr(c,'form_errors'): + %if type(c.form_errors) == dict: + %if c.form_errors.get(element,False): + <span class="error-message"> + ${c.form_errors.get(element,'')} + </span> + %endif + %endif + %endif + </%def> +<%def name="title()"> + ${_('Repository managment')} +</%def> +<%def name="breadcrumbs()"> + ${h.link_to(u'Home',h.url('/'))} + / + ${h.link_to(u'Admin',h.url('admin_home'))} +</%def> +<%def name="page_nav()"> +<li>${h.link_to(u'Home',h.url('/'))}</li> +<li class="current">${_('Admin')}</li> +</%def> +<%def name="main()"> + %if c.admin_user: + <ul class="submenu"> + <li> + ${h.link_to(u'Repos',h.url('repos'))} + </li> + <li> + ${h.link_to(u'Users',h.url('users'))} + </li> + </ul> + <br/> + <div> + <h2>Welcome ${c.admin_username}</h2> + <div id="user_log"> + ${c.log_data} + </div> + </div> + %else: + <div> + <br /> + <h2>${_('Login')}</h2> + ${h.form(h.url.current())} + <table> + <tr> + <td>${_('Username')}</td> + <td>${h.text('username')}</td> + <td>${get_form_error('username')} </td> + </tr> + <tr> + <td>${_('Password')}</td> + <td>${h.password('password')}</td> + <td>${get_form_error('password')}</td> + </tr> + <tr> + <td></td> + <td>${h.submit('login','login')}</td> + </tr> + </table> + ${h.end_form()} + </div> + %endif + +</%def> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pylons_app/templates/admin/admin_log.html Mon May 03 19:07:54 2010 +0200 @@ -0,0 +1,38 @@ +## -*- coding: utf-8 -*- +%if c.users_log: +<table> + <tr> + <td>${_('Username')}</td> + <td>${_('Repository')}</td> + <td>${_('Action')}</td> + <td>${_('Date')}</td> + </tr> + + %for cnt,l in enumerate(c.users_log): + <tr class="parity${cnt%2}"> + <td>${l.user.username}</td> + <td>${l.repository}</td> + <td>${l.action}</td> + <td>${l.action_date}</td> + </tr> + %endfor + +</table> +<div> + <script type="text/javascript"> + var data_div = 'user_log'; + YAHOO.util.Event.onDOMReady(function(){ + YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName('pager_link'),"click",function(){ + YAHOO.util.Dom.setStyle('shortlog_data','opacity','0.3');});}); + </script> + <h2>${c.users_log.pager('$link_previous ~2~ $link_next', + onclick="""YAHOO.util.Connect.asyncRequest('GET','$partial_url',{ + success:function(o){YAHOO.util.Dom.get(data_div).innerHTML=o.responseText; + YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName('pager_link'),"click",function(){ + YAHOO.util.Dom.setStyle(data_div,'opacity','0.3');}); + YAHOO.util.Dom.setStyle(data_div,'opacity','1');}},null); return false;""")} + </h2> +</div> +%else: + ${_('No actions yet')} +%endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pylons_app/templates/admin/repos/repo_edit.html Mon May 03 19:07:54 2010 +0200 @@ -0,0 +1,28 @@ +<%inherit file="base/base.html"/> +<%def name="title()"> + ${_('Repository managment')} +</%def> +<%def name="breadcrumbs()"> + ${h.link_to(u'Home',h.url('/'))} + / + ${h.link_to(u'Admin',h.url('admin_home'))} + / + ${h.link_to(u'Repos managment',h.url('repos'))} +</%def> +<%def name="page_nav()"> + <li>${h.link_to(u'Home',h.url('/'))}</li> + <li class="current">${_('Admin')}</li> +</%def> +<%def name="main()"> + <ul class="submenu"> + <li class="current_submenu"> + ${h.link_to(u'Repos',h.url('repos'))} + </li> + <li> + ${h.link_to(u'Users',h.url('users'))} + </li> + </ul> + <div> + <h2>${_('Mercurial repos')}</h2> + </div> +</%def> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pylons_app/templates/admin/repos/repos.html Mon May 03 19:07:54 2010 +0200 @@ -0,0 +1,41 @@ +<%inherit file="/base/base.html"/> +<%def name="title()"> + ${_('Repository managment')} +</%def> +<%def name="breadcrumbs()"> + ${h.link_to(u'Home',h.url('/'))} + / + ${h.link_to(u'Admin',h.url('admin_home'))} + / + ${h.link_to(u'Repos managment',h.url('repos'))} +</%def> +<%def name="page_nav()"> + <li>${h.link_to(u'Home',h.url('/'))}</li> + <li class="current">${_('Admin')}</li> +</%def> +<%def name="main()"> + <ul class="submenu"> + <li> + ${h.link_to(u'Repos',h.url('repos'), class_="current_submenu")} + </li> + <li> + ${h.link_to(u'Users',h.url('users'))} + </li> + </ul> + <div> + <h2>${_('Mercurial repos')}</h2> + <table> + %for cnt,repo in enumerate(c.repos_list): + <tr class="parity${cnt%2}"> + <td>${h.link_to(repo['name'],h.url('summary_home',repo_name=repo['name']))}</td> + <td>r${repo['rev']}:${repo['tip']}</td> + <td> + ${h.form(url('repo', id=repo['name']),method='delete')} + ${h.submit('remove','remove',class_="submit",onclick="return confirm('Confirm to delete this repository');")} + ${h.end_form()} + </td> + </tr> + %endfor + </table> + </div> +</%def> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pylons_app/templates/admin/users/user_add.html Mon May 03 19:07:54 2010 +0200 @@ -0,0 +1,50 @@ +<%inherit file="/base/base.html"/> +<%def name="title()"> + ${_('User')} - ${_('add new')} +</%def> +<%def name="breadcrumbs()"> + ${h.link_to(u'Home',h.url('/'))} + / + ${h.link_to(u'Admin',h.url('admin_home'))} + / + ${h.link_to(u'Users',h.url('users'))} +</%def> +<%def name="page_nav()"> + <li>${h.link_to(u'Home',h.url('/'))}</li> + <li class="current">${_('Admin')}</li> +</%def> +<%def name="main()"> + <ul class="submenu"> + <li> + ${h.link_to(u'Repos',h.url('repos'))} + </li> + <li class="current_submenu"> + ${h.link_to(u'Users',h.url('users'))} + </li> + </ul> + <div> + <h2>${_('User')} - ${_('add new')}</h2> + ${h.form(url('users'))} + <table> + <tr> + <td>${_('Username')}</td> + <td>${h.text('username')}</td> + </tr> + <tr> + <td>${_('password')}</td> + <td>${h.text('password')}</td> + </tr> + <tr> + <td>${_('Active')}</td> + <td>${h.checkbox('active')}</td> + </tr> + <tr> + <td></td> + <td>${h.submit('add','add')}</td> + </tr> + + </table> + + ${h.end_form()} + </div> +</%def> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pylons_app/templates/admin/users/user_edit.html Mon May 03 19:07:54 2010 +0200 @@ -0,0 +1,50 @@ +<%inherit file="/base/base.html"/> +<%def name="title()"> + ${_('User')} - ${c.user.username} +</%def> +<%def name="breadcrumbs()"> + ${h.link_to(u'Home',h.url('/'))} + / + ${h.link_to(u'Admin',h.url('admin_home'))} + / + ${h.link_to(u'Users',h.url('users'))} +</%def> +<%def name="page_nav()"> + <li>${h.link_to(u'Home',h.url('/'))}</li> + <li class="current">${_('Admin')}</li> +</%def> +<%def name="main()"> + <ul class="submenu"> + <li> + ${h.link_to(u'Repos',h.url('repos'))} + </li> + <li class="current_submenu"> + ${h.link_to(u'Users',h.url('users'))} + </li> + </ul> + <div> + <h2>${_('User')} - ${c.user.username}</h2> + ${h.form(url('user', id=c.user.user_id),method='put')} + <table> + <tr> + <td>${_('Username')}</td> + <td>${h.text('username')}</td> + </tr> + <tr> + <td>${_('New password')}</td> + <td>${h.text('new_password')}</td> + </tr> + <tr> + <td>${_('Active')}</td> + <td>${h.checkbox('active',value=True)}</td> + </tr> + <tr> + <td></td> + <td>${h.submit('save','save')}</td> + </tr> + + </table> + + ${h.end_form()} + </div> +</%def> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pylons_app/templates/admin/users/users.html Mon May 03 19:07:54 2010 +0200 @@ -0,0 +1,52 @@ +<%inherit file="/base/base.html"/> +<%def name="title()"> + ${_('Repository managment')} +</%def> +<%def name="breadcrumbs()"> + ${h.link_to(u'Home',h.url('/'))} + / + ${h.link_to(u'Admin',h.url('admin_home'))} + / + ${h.link_to(u'Users managment',h.url('users'))} +</%def> +<%def name="page_nav()"> + <li>${h.link_to(u'Home',h.url('/'))}</li> + <li class="current">${_('Admin')}</li> +</%def> +<%def name="main()"> + <ul class="submenu"> + <li> + ${h.link_to(u'Repos',h.url('repos'))} + </li> + <li> + ${h.link_to(u'Users',h.url('users'), class_="current_submenu")} + </li> + </ul> + <div> + <h2>${_('Mercurial users')}</h2> + <table> + <tr> + <th>Id</th> + <th>Username</th> + <th>Active</th> + <th>Admin</th> + <th>Action</th> + </tr> + %for user in c.users_list: + <tr> + <td>${user.user_id}</td> + <td>${h.link_to(user.username,h.url('edit_user', id=user.user_id))}</td> + <td>${user.active}</td> + <td>${user.admin}</td> + <td> + ${h.form(url('user', id=user.user_id),method='delete')} + ${h.submit('remove','remove',class_="submit")} + ${h.end_form()} + </td> + </tr> + %endfor + </table> + <h3>${h.link_to(u'Add user',h.url('new_user'))}</h3> + </div> + +</%def> \ No newline at end of file
--- a/pylons_app/templates/admin_log.html Mon May 03 18:31:00 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -## -*- coding: utf-8 -*- -%if c.users_log: -<table> - <tr> - <td>${_('Username')}</td> - <td>${_('Repository')}</td> - <td>${_('Action')}</td> - <td>${_('Date')}</td> - </tr> - - %for cnt,l in enumerate(c.users_log): - <tr class="parity${cnt%2}"> - <td>${l.user.username}</td> - <td>${l.repository}</td> - <td>${l.action}</td> - <td>${l.action_date}</td> - </tr> - %endfor - -</table> -<div> - <script type="text/javascript"> - var data_div = 'user_log'; - YAHOO.util.Event.onDOMReady(function(){ - YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName('pager_link'),"click",function(){ - YAHOO.util.Dom.setStyle('shortlog_data','opacity','0.3');});}); - </script> - <h2>${c.users_log.pager('$link_previous ~2~ $link_next', - onclick="""YAHOO.util.Connect.asyncRequest('GET','$partial_url',{ - success:function(o){YAHOO.util.Dom.get(data_div).innerHTML=o.responseText; - YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName('pager_link'),"click",function(){ - YAHOO.util.Dom.setStyle(data_div,'opacity','0.3');}); - YAHOO.util.Dom.setStyle(data_div,'opacity','1');}},null); return false;""")} - </h2> -</div> -%else: - ${_('No actions yet')} -%endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pylons_app/templates/branches/branches.html Mon May 03 19:07:54 2010 +0200 @@ -0,0 +1,46 @@ +<%inherit file="/base/base.html"/> +<%! from pylons_app.lib import filters %> +<%def name="title()"> + ${_('Branches')} +</%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))} + / + ${_('branches')} +</%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('branches')} +</%def> +<%def name="main()"> + + <h2 class="no-link no-border">${_('Branches')}</h2> + + <table> + %for cnt,branch in enumerate(c.repo_branches): + <tr class="parity${cnt%2}"> + <td>${branch._ctx.date()|n,filters.age}</td> + <td></td> + <td> + <span class="logtags"> + <span class="branchtag">${h.link_to(branch.branch,h.url('changeset_home',repo_name=c.repo_name,revision=branch._short))}</span> + </span> + </td> + <td class="nowrap"> + ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch._short))} + | + ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch._short))} + </td> + </tr> + %endfor + </table> + +</%def> \ No newline at end of file
--- a/pylons_app/templates/graph.html Mon May 03 18:31:00 2010 +0200 +++ b/pylons_app/templates/graph.html Mon May 03 19:07:54 2010 +0200 @@ -1,4 +1,4 @@ -<%inherit file="base/base.html"/> +<%inherit file="/base/base.html"/> <%def name="title()"> ${_('Repository managment')}
--- a/pylons_app/templates/repo_edit.html Mon May 03 18:31:00 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -<%inherit file="base/base.html"/> -<%def name="title()"> - ${_('Repository managment')} -</%def> -<%def name="breadcrumbs()"> - ${h.link_to(u'Home',h.url('/'))} - / - ${h.link_to(u'Admin',h.url('admin_home'))} - / - ${h.link_to(u'Repos managment',h.url('repos'))} -</%def> -<%def name="page_nav()"> - <li>${h.link_to(u'Home',h.url('/'))}</li> - <li class="current">${_('Admin')}</li> -</%def> -<%def name="main()"> - <ul class="submenu"> - <li class="current_submenu"> - ${h.link_to(u'Repos',h.url('repos'))} - </li> - <li> - ${h.link_to(u'Users',h.url('users'))} - </li> - </ul> - <div> - <h2>${_('Mercurial repos')}</h2> - </div> -</%def> \ No newline at end of file
--- a/pylons_app/templates/repos.html Mon May 03 18:31:00 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -<%inherit file="base/base.html"/> -<%def name="title()"> - ${_('Repository managment')} -</%def> -<%def name="breadcrumbs()"> - ${h.link_to(u'Home',h.url('/'))} - / - ${h.link_to(u'Admin',h.url('admin_home'))} - / - ${h.link_to(u'Repos managment',h.url('repos'))} -</%def> -<%def name="page_nav()"> - <li>${h.link_to(u'Home',h.url('/'))}</li> - <li class="current">${_('Admin')}</li> -</%def> -<%def name="main()"> - <ul class="submenu"> - <li> - ${h.link_to(u'Repos',h.url('repos'), class_="current_submenu")} - </li> - <li> - ${h.link_to(u'Users',h.url('users'))} - </li> - </ul> - <div> - <h2>${_('Mercurial repos')}</h2> - <table> - %for cnt,repo in enumerate(c.repos_list): - <tr class="parity${cnt%2}"> - <td><a href="/${repo['name']}">${repo['name']}</a></td> - <td>r${repo['rev']}:${repo['tip']}</td> - <td> - ${h.form(url('repo', id=repo['name']),method='delete')} - ${h.submit('remove','remove',class_="submit",onclick="return confirm('Confirm to delete this repository');")} - ${h.end_form()} - </td> - </tr> - %endfor - </table> - </div> -</%def> \ No newline at end of file
--- a/pylons_app/templates/shortlog.html Mon May 03 18:31:00 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -<%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('shortlog_home',repo_name=c.repo_name))} - / - ${_('shortlog')} -</%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('changelog')} -</%def> -<%def name="main()"> - - <h2 class="no-link no-border">${_('Shortlog')}</h2> - - <div id="shortlog_data"> - ${c.shortlog_data} - </div> -</%def> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pylons_app/templates/shortlog/shortlog.html Mon May 03 19:07:54 2010 +0200 @@ -0,0 +1,30 @@ +<%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('shortlog_home',repo_name=c.repo_name))} + / + ${_('shortlog')} +</%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('changelog')} +</%def> +<%def name="main()"> + + <h2 class="no-link no-border">${_('Shortlog')}</h2> + + <div id="shortlog_data"> + ${c.shortlog_data} + </div> +</%def> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pylons_app/templates/shortlog/shortlog_data.html Mon May 03 19:07:54 2010 +0200 @@ -0,0 +1,42 @@ +## -*- coding: utf-8 -*- +<%! +from pylons_app.lib import filters +%> +<table> +%for cnt,cs in enumerate(c.repo_changesets): + <tr class="parity${cnt%2}"> + <td>${cs._ctx.date()|n,filters.age}</td> + <td title="${cs.author}">${cs.author|n,filters.person}</td> + <td>${h.link_to(cs.message,h.url('changeset_home',repo_name=c.repo_name,revision=cs._short))} + <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> + <div> + <script type="text/javascript"> + var data_div = 'shortlog_data'; + YAHOO.util.Event.onDOMReady(function(){ + YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName('pager_link'),"click",function(){ + YAHOO.util.Dom.setStyle('shortlog_data','opacity','0.3');});}); + </script> + <h2> + ${c.repo_changesets.pager('$link_previous ~2~ $link_next', + onclick="""YAHOO.util.Connect.asyncRequest('GET','$partial_url',{ + success:function(o){YAHOO.util.Dom.get(data_div).innerHTML=o.responseText; + YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName('pager_link'),"click",function(){ + YAHOO.util.Dom.setStyle(data_div,'opacity','0.3');}); + YAHOO.util.Dom.setStyle(data_div,'opacity','1');}},null); return false;""")} + </h2> + </div> \ No newline at end of file
--- a/pylons_app/templates/shortlog_data.html Mon May 03 18:31:00 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -## -*- coding: utf-8 -*- -<%! -from pylons_app.lib import filters -%> -<table> -%for cnt,cs in enumerate(c.repo_changesets): - <tr class="parity${cnt%2}"> - <td>${cs._ctx.date()|n,filters.age}</td> - <td title="${cs.author}">${cs.author|n,filters.person}</td> - <td>${h.link_to(cs.message,h.url('changeset_home',repo_name=c.repo_name,revision=cs._short))} - <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> - <div> - <script type="text/javascript"> - var data_div = 'shortlog_data'; - YAHOO.util.Event.onDOMReady(function(){ - YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName('pager_link'),"click",function(){ - YAHOO.util.Dom.setStyle('shortlog_data','opacity','0.3');});}); - </script> - <h2> - ${c.repo_changesets.pager('$link_previous ~2~ $link_next', - onclick="""YAHOO.util.Connect.asyncRequest('GET','$partial_url',{ - success:function(o){YAHOO.util.Dom.get(data_div).innerHTML=o.responseText; - YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName('pager_link'),"click",function(){ - YAHOO.util.Dom.setStyle(data_div,'opacity','0.3');}); - YAHOO.util.Dom.setStyle(data_div,'opacity','1');}},null); return false;""")} - </h2> - </div> \ No newline at end of file
--- a/pylons_app/templates/summary.html Mon May 03 18:31:00 2010 +0200 +++ b/pylons_app/templates/summary.html Mon May 03 19:07:54 2010 +0200 @@ -1,4 +1,4 @@ -<%inherit file="base/base.html"/> +<%inherit file="/base/base.html"/> <%! from pylons_app.lib import filters %>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pylons_app/templates/tags/tags.html Mon May 03 19:07:54 2010 +0200 @@ -0,0 +1,48 @@ +<%inherit file="/base/base.html"/> +<%! +from pylons_app.lib import filters +%> +<%def name="title()"> + ${_('Tags')} +</%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))} + / + ${_('tags')} +</%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('tags')} +</%def> +<%def name="main()"> + + <h2 class="no-link no-border">${_('Tags')}</h2> + + <table> + %for cnt,tag in enumerate(c.repo_tags): + <tr class="parity${cnt%2}"> + <td>${tag._ctx.date()|n,filters.age}</td> + <td></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> + </span> + </td> + <td class="nowrap"> + ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag._short))} + | + ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag._short))} + </td> + </tr> + %endfor + </table> + +</%def> \ No newline at end of file
--- a/pylons_app/templates/user_add.html Mon May 03 18:31:00 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -<%inherit file="base/base.html"/> -<%def name="title()"> - ${_('User')} - ${_('add new')} -</%def> -<%def name="breadcrumbs()"> - ${h.link_to(u'Home',h.url('/'))} - / - ${h.link_to(u'Admin',h.url('admin_home'))} - / - ${h.link_to(u'Users',h.url('users'))} -</%def> -<%def name="page_nav()"> - <li>${h.link_to(u'Home',h.url('/'))}</li> - <li class="current">${_('Admin')}</li> -</%def> -<%def name="main()"> - <ul class="submenu"> - <li> - ${h.link_to(u'Repos',h.url('repos'))} - </li> - <li class="current_submenu"> - ${h.link_to(u'Users',h.url('users'))} - </li> - </ul> - <div> - <h2>${_('User')} - ${_('add new')}</h2> - ${h.form(url('users'))} - <table> - <tr> - <td>${_('Username')}</td> - <td>${h.text('username')}</td> - </tr> - <tr> - <td>${_('password')}</td> - <td>${h.text('password')}</td> - </tr> - <tr> - <td>${_('Active')}</td> - <td>${h.checkbox('active')}</td> - </tr> - <tr> - <td></td> - <td>${h.submit('add','add')}</td> - </tr> - - </table> - - ${h.end_form()} - </div> -</%def> \ No newline at end of file
--- a/pylons_app/templates/user_edit.html Mon May 03 18:31:00 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -<%inherit file="base/base.html"/> -<%def name="title()"> - ${_('User')} - ${c.user.username} -</%def> -<%def name="breadcrumbs()"> - ${h.link_to(u'Home',h.url('/'))} - / - ${h.link_to(u'Admin',h.url('admin_home'))} - / - ${h.link_to(u'Users',h.url('users'))} -</%def> -<%def name="page_nav()"> - <li>${h.link_to(u'Home',h.url('/'))}</li> - <li class="current">${_('Admin')}</li> -</%def> -<%def name="main()"> - <ul class="submenu"> - <li> - ${h.link_to(u'Repos',h.url('repos'))} - </li> - <li class="current_submenu"> - ${h.link_to(u'Users',h.url('users'))} - </li> - </ul> - <div> - <h2>${_('User')} - ${c.user.username}</h2> - ${h.form(url('user', id=c.user.user_id),method='put')} - <table> - <tr> - <td>${_('Username')}</td> - <td>${h.text('username')}</td> - </tr> - <tr> - <td>${_('New password')}</td> - <td>${h.text('new_password')}</td> - </tr> - <tr> - <td>${_('Active')}</td> - <td>${h.checkbox('active',value=True)}</td> - </tr> - <tr> - <td></td> - <td>${h.submit('save','save')}</td> - </tr> - - </table> - - ${h.end_form()} - </div> -</%def> \ No newline at end of file
--- a/pylons_app/templates/users.html Mon May 03 18:31:00 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -<%inherit file="base/base.html"/> -<%def name="title()"> - ${_('Repository managment')} -</%def> -<%def name="breadcrumbs()"> - ${h.link_to(u'Home',h.url('/'))} - / - ${h.link_to(u'Admin',h.url('admin_home'))} - / - ${h.link_to(u'Users managment',h.url('users'))} -</%def> -<%def name="page_nav()"> - <li>${h.link_to(u'Home',h.url('/'))}</li> - <li class="current">${_('Admin')}</li> -</%def> -<%def name="main()"> - <ul class="submenu"> - <li> - ${h.link_to(u'Repos',h.url('repos'))} - </li> - <li> - ${h.link_to(u'Users',h.url('users'), class_="current_submenu")} - </li> - </ul> - <div> - <h2>${_('Mercurial users')}</h2> - <table> - <tr> - <th>Id</th> - <th>Username</th> - <th>Active</th> - <th>Admin</th> - <th>Action</th> - </tr> - %for user in c.users_list: - <tr> - <td>${user.user_id}</td> - <td>${h.link_to(user.username,h.url('edit_user', id=user.user_id))}</td> - <td>${user.active}</td> - <td>${user.admin}</td> - <td> - ${h.form(url('user', id=user.user_id),method='delete')} - ${h.submit('remove','remove',class_="submit")} - ${h.end_form()} - </td> - </tr> - %endfor - </table> - <h3>${h.link_to(u'Add user',h.url('new_user'))}</h3> - </div> - -</%def> \ No newline at end of file
--- a/setup.py Mon May 03 18:31:00 2010 +0200 +++ b/setup.py Mon May 03 19:07:54 2010 +0200 @@ -6,29 +6,29 @@ from setuptools import setup, find_packages setup( - name = 'pylons_app', - version = '1.0', - description = '', - author = 'marcin kuzminski', - author_email = 'marcin@python-blog.com', - url = '', - install_requires = [ - "Pylons>=0.9.7,<=0.9.7.99", - "SQLAlchemy>=0.5,<=0.5.99", - "Mako>=0.2.2,<=0.2.99", + name='pylons_app', + version='1.0', + description='', + author='marcin kuzminski', + author_email='marcin@python-blog.com', + url='', + install_requires=[ + "Pylons>=1.0.0", + "SQLAlchemy>=0.6", + "Mako>=0.3.2", ], - 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': [ + 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 = """ + zip_safe=False, + paster_plugins=['PasteScript', 'Pylons'], + entry_points=""" [paste.app_factory] main = pylons_app.config.middleware:make_app