Show More
@@ -0,0 +1,46 b'' | |||||
|
1 | <%inherit file="/base/base.html"/> | |||
|
2 | <%! from pylons_app.lib import filters %> | |||
|
3 | <%def name="title()"> | |||
|
4 | ${_('Branches')} | |||
|
5 | </%def> | |||
|
6 | <%def name="breadcrumbs()"> | |||
|
7 | ${h.link_to(u'Home',h.url('/'))} | |||
|
8 | / | |||
|
9 | ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))} | |||
|
10 | / | |||
|
11 | ${_('branches')} | |||
|
12 | </%def> | |||
|
13 | <%def name="page_nav()"> | |||
|
14 | <form action="log"> | |||
|
15 | <dl class="search"> | |||
|
16 | <dt><label>Search: </label></dt> | |||
|
17 | <dd><input type="text" name="rev" /></dd> | |||
|
18 | </dl> | |||
|
19 | </form> | |||
|
20 | ||||
|
21 | ${self.menu('branches')} | |||
|
22 | </%def> | |||
|
23 | <%def name="main()"> | |||
|
24 | ||||
|
25 | <h2 class="no-link no-border">${_('Branches')}</h2> | |||
|
26 | ||||
|
27 | <table> | |||
|
28 | %for cnt,branch in enumerate(c.repo_branches): | |||
|
29 | <tr class="parity${cnt%2}"> | |||
|
30 | <td>${branch._ctx.date()|n,filters.age}</td> | |||
|
31 | <td></td> | |||
|
32 | <td> | |||
|
33 | <span class="logtags"> | |||
|
34 | <span class="branchtag">${h.link_to(branch.branch,h.url('changeset_home',repo_name=c.repo_name,revision=branch._short))}</span> | |||
|
35 | </span> | |||
|
36 | </td> | |||
|
37 | <td class="nowrap"> | |||
|
38 | ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch._short))} | |||
|
39 | | | |||
|
40 | ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch._short))} | |||
|
41 | </td> | |||
|
42 | </tr> | |||
|
43 | %endfor | |||
|
44 | </table> | |||
|
45 | ||||
|
46 | </%def> No newline at end of file |
@@ -0,0 +1,48 b'' | |||||
|
1 | <%inherit file="/base/base.html"/> | |||
|
2 | <%! | |||
|
3 | from pylons_app.lib import filters | |||
|
4 | %> | |||
|
5 | <%def name="title()"> | |||
|
6 | ${_('Tags')} | |||
|
7 | </%def> | |||
|
8 | <%def name="breadcrumbs()"> | |||
|
9 | ${h.link_to(u'Home',h.url('/'))} | |||
|
10 | / | |||
|
11 | ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))} | |||
|
12 | / | |||
|
13 | ${_('tags')} | |||
|
14 | </%def> | |||
|
15 | <%def name="page_nav()"> | |||
|
16 | <form action="log"> | |||
|
17 | <dl class="search"> | |||
|
18 | <dt><label>Search: </label></dt> | |||
|
19 | <dd><input type="text" name="rev" /></dd> | |||
|
20 | </dl> | |||
|
21 | </form> | |||
|
22 | ||||
|
23 | ${self.menu('tags')} | |||
|
24 | </%def> | |||
|
25 | <%def name="main()"> | |||
|
26 | ||||
|
27 | <h2 class="no-link no-border">${_('Tags')}</h2> | |||
|
28 | ||||
|
29 | <table> | |||
|
30 | %for cnt,tag in enumerate(c.repo_tags): | |||
|
31 | <tr class="parity${cnt%2}"> | |||
|
32 | <td>${tag._ctx.date()|n,filters.age}</td> | |||
|
33 | <td></td> | |||
|
34 | <td> | |||
|
35 | <span class="logtags"> | |||
|
36 | <span class="tagtag">${h.link_to(tag.tags[-1],h.url('changeset_home',repo_name=c.repo_name,revision=tag._short))}</span> | |||
|
37 | </span> | |||
|
38 | </td> | |||
|
39 | <td class="nowrap"> | |||
|
40 | ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag._short))} | |||
|
41 | | | |||
|
42 | ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag._short))} | |||
|
43 | </td> | |||
|
44 | </tr> | |||
|
45 | %endfor | |||
|
46 | </table> | |||
|
47 | ||||
|
48 | </%def> No newline at end of file |
@@ -43,7 +43,7 b' class AdminController(BaseController):' | |||||
43 | except formencode.Invalid, error: |
|
43 | except formencode.Invalid, error: | |
44 | c.form_result = error.value |
|
44 | c.form_result = error.value | |
45 | c.form_errors = error.error_dict or {} |
|
45 | c.form_errors = error.error_dict or {} | |
46 | html = render('/admin.html') |
|
46 | html = render('admin/admin.html') | |
47 |
|
47 | |||
48 | return htmlfill.render( |
|
48 | return htmlfill.render( | |
49 | html, |
|
49 | html, | |
@@ -57,10 +57,10 b' class AdminController(BaseController):' | |||||
57 | .order_by(UserLogs.action_date.desc()) |
|
57 | .order_by(UserLogs.action_date.desc()) | |
58 | p = int(request.params.get('page', 1)) |
|
58 | p = int(request.params.get('page', 1)) | |
59 | c.users_log = Page(users_log, page=p, items_per_page=10) |
|
59 | c.users_log = Page(users_log, page=p, items_per_page=10) | |
60 | c.log_data = render('admin_log.html') |
|
60 | c.log_data = render('admin/admin_log.html') | |
61 | if request.params.get('partial'): |
|
61 | if request.params.get('partial'): | |
62 | return c.log_data |
|
62 | return c.log_data | |
63 | return render('/admin.html') |
|
63 | return render('admin/admin.html') | |
64 |
|
64 | |||
65 | def hgrc(self, dirname): |
|
65 | def hgrc(self, dirname): | |
66 | filename = os.path.join(dirname, '.hg', 'hgrc') |
|
66 | filename = os.path.join(dirname, '.hg', 'hgrc') |
@@ -1,16 +1,22 b'' | |||||
1 | import logging |
|
1 | import logging | |
2 |
|
2 | |||
3 | from pylons import request, response, session, tmpl_context as c, url |
|
3 | from pylons import tmpl_context as c, app_globals as g, session, request, config, url | |
4 | from pylons.controllers.util import abort, redirect |
|
4 | from pylons.controllers.util import abort, redirect | |
5 |
|
5 | |||
6 | from pylons_app.lib.base import BaseController, render |
|
6 | from pylons_app.lib.base import BaseController, render | |
|
7 | from pylons_app.lib.utils import get_repo_slug | |||
|
8 | from pylons_app.model.hg_model import HgModel | |||
|
9 | log = logging.getLogger(__name__) | |||
7 |
|
10 | |||
8 | log = logging.getLogger(__name__) |
|
|||
9 |
|
11 | |||
10 | class BranchesController(BaseController): |
|
12 | class BranchesController(BaseController): | |
|
13 | def __before__(self): | |||
|
14 | c.repos_prefix = config['repos_name'] | |||
|
15 | c.repo_name = get_repo_slug(request) | |||
11 |
|
16 | |||
12 | def index(self): |
|
17 | def index(self): | |
13 | # Return a rendered template |
|
18 | hg_model = HgModel() | |
14 | #return render('/branches.mako') |
|
19 | c.repo_info = hg_model.get_repo(c.repo_name) | |
15 | # or, return a string |
|
20 | c.repo_branches = c.repo_info.branches | |
16 | return 'Hello World' |
|
21 | ||
|
22 | return render('branches/branches.html') |
@@ -13,17 +13,15 b' log = logging.getLogger(__name__)' | |||||
13 | class ChangelogController(BaseController): |
|
13 | class ChangelogController(BaseController): | |
14 | def __before__(self): |
|
14 | def __before__(self): | |
15 | c.repos_prefix = config['repos_name'] |
|
15 | c.repos_prefix = config['repos_name'] | |
16 |
|
||||
17 | c.repo_name = get_repo_slug(request) |
|
16 | c.repo_name = get_repo_slug(request) | |
18 |
|
17 | |||
19 |
|
||||
20 | def index(self): |
|
18 | def index(self): | |
21 | hg_model = HgModel() |
|
19 | hg_model = HgModel() | |
22 | p = int(request.params.get('page', 1)) |
|
20 | p = int(request.params.get('page', 1)) | |
23 | repo = hg_model.get_repo(c.repo_name) |
|
21 | repo = hg_model.get_repo(c.repo_name) | |
24 | c.repo_changesets = Page(repo, page=p, items_per_page=20) |
|
22 | c.repo_changesets = Page(repo, page=p, items_per_page=20) | |
25 | c.shortlog_data = render('shortlog_data.html') |
|
23 | c.shortlog_data = render('shortlog/shortlog_data.html') | |
26 | if request.params.get('partial'): |
|
24 | if request.params.get('partial'): | |
27 | return c.shortlog_data |
|
25 | return c.shortlog_data | |
28 | r = render('/shortlog.html') |
|
26 | r = render('shortlog/shortlog.html') | |
29 | return r |
|
27 | return r |
@@ -31,7 +31,7 b' class ReposController(BaseController):' | |||||
31 | hg_model = HgModel() |
|
31 | hg_model = HgModel() | |
32 | c.repos_list = list(hg_model.get_repos()) |
|
32 | c.repos_list = list(hg_model.get_repos()) | |
33 | c.repos_list.sort(key=itemgetter('name')) |
|
33 | c.repos_list.sort(key=itemgetter('name')) | |
34 | return render('/repos.html') |
|
34 | return render('admin/repos/repos.html') | |
35 |
|
35 | |||
36 | def create(self): |
|
36 | def create(self): | |
37 | """POST /repos: Create a new item""" |
|
37 | """POST /repos: Create a new item""" |
@@ -13,17 +13,15 b' log = logging.getLogger(__name__)' | |||||
13 | class ShortlogController(BaseController): |
|
13 | class ShortlogController(BaseController): | |
14 | def __before__(self): |
|
14 | def __before__(self): | |
15 | c.repos_prefix = config['repos_name'] |
|
15 | c.repos_prefix = config['repos_name'] | |
16 |
|
||||
17 | c.repo_name = get_repo_slug(request) |
|
16 | c.repo_name = get_repo_slug(request) | |
18 |
|
17 | |||
19 |
|
||||
20 | def index(self): |
|
18 | def index(self): | |
21 | hg_model = HgModel() |
|
19 | hg_model = HgModel() | |
22 | p = int(request.params.get('page', 1)) |
|
20 | p = int(request.params.get('page', 1)) | |
23 | repo = hg_model.get_repo(c.repo_name) |
|
21 | repo = hg_model.get_repo(c.repo_name) | |
24 | c.repo_changesets = Page(repo, page=p, items_per_page=20) |
|
22 | c.repo_changesets = Page(repo, page=p, items_per_page=20) | |
25 | c.shortlog_data = render('shortlog_data.html') |
|
23 | c.shortlog_data = render('shortlog/shortlog_data.html') | |
26 | if request.params.get('partial'): |
|
24 | if request.params.get('partial'): | |
27 | return c.shortlog_data |
|
25 | return c.shortlog_data | |
28 | r = render('/shortlog.html') |
|
26 | r = render('shortlog/shortlog.html') | |
29 | return r |
|
27 | return r |
@@ -11,7 +11,6 b' log = logging.getLogger(__name__)' | |||||
11 | class SummaryController(BaseController): |
|
11 | class SummaryController(BaseController): | |
12 | def __before__(self): |
|
12 | def __before__(self): | |
13 | c.repos_prefix = config['repos_name'] |
|
13 | c.repos_prefix = config['repos_name'] | |
14 |
|
||||
15 | c.repo_name = get_repo_slug(request) |
|
14 | c.repo_name = get_repo_slug(request) | |
16 |
|
15 | |||
17 | def index(self): |
|
16 | def index(self): |
@@ -1,16 +1,22 b'' | |||||
1 | import logging |
|
1 | import logging | |
2 |
|
2 | |||
3 | from pylons import request, response, session, tmpl_context as c, url |
|
3 | from pylons import tmpl_context as c, app_globals as g, session, request, config, url | |
4 | from pylons.controllers.util import abort, redirect |
|
4 | from pylons.controllers.util import abort, redirect | |
5 |
|
5 | |||
6 | from pylons_app.lib.base import BaseController, render |
|
6 | from pylons_app.lib.base import BaseController, render | |
|
7 | from pylons_app.lib.utils import get_repo_slug | |||
|
8 | from pylons_app.model.hg_model import HgModel | |||
|
9 | log = logging.getLogger(__name__) | |||
7 |
|
10 | |||
8 | log = logging.getLogger(__name__) |
|
|||
9 |
|
11 | |||
10 | class TagsController(BaseController): |
|
12 | class TagsController(BaseController): | |
|
13 | def __before__(self): | |||
|
14 | c.repos_prefix = config['repos_name'] | |||
|
15 | c.repo_name = get_repo_slug(request) | |||
11 |
|
16 | |||
12 | def index(self): |
|
17 | def index(self): | |
13 | # Return a rendered template |
|
18 | hg_model = HgModel() | |
14 | #return render('/tags.mako') |
|
19 | c.repo_info = hg_model.get_repo(c.repo_name) | |
15 | # or, return a string |
|
20 | c.repo_tags = c.repo_info.tags | |
16 | return 'Hello World' |
|
21 | ||
|
22 | return render('tags/tags.html') |
@@ -30,7 +30,7 b' class UsersController(BaseController):' | |||||
30 | # url('users') |
|
30 | # url('users') | |
31 |
|
31 | |||
32 | c.users_list = self.sa.query(Users).all() |
|
32 | c.users_list = self.sa.query(Users).all() | |
33 | return render('/users.html') |
|
33 | return render('admin/users/users.html') | |
34 |
|
34 | |||
35 | def create(self): |
|
35 | def create(self): | |
36 | """POST /users: Create a new item""" |
|
36 | """POST /users: Create a new item""" | |
@@ -54,7 +54,7 b' class UsersController(BaseController):' | |||||
54 | def new(self, format='html'): |
|
54 | def new(self, format='html'): | |
55 | """GET /users/new: Form to create a new item""" |
|
55 | """GET /users/new: Form to create a new item""" | |
56 | # url('new_user') |
|
56 | # url('new_user') | |
57 | return render('/user_add.html') |
|
57 | return render('admin/users/user_add.html') | |
58 |
|
58 | |||
59 | def update(self, id): |
|
59 | def update(self, id): | |
60 | """PUT /users/id: Update an existing item""" |
|
60 | """PUT /users/id: Update an existing item""" | |
@@ -107,7 +107,7 b' class UsersController(BaseController):' | |||||
107 | c.user = self.sa.query(Users).get(id) |
|
107 | c.user = self.sa.query(Users).get(id) | |
108 | defaults = c.user.__dict__ |
|
108 | defaults = c.user.__dict__ | |
109 | return htmlfill.render( |
|
109 | return htmlfill.render( | |
110 | render('/user_edit.html'), |
|
110 | render('admin/users/user_edit.html'), | |
111 | defaults=defaults, |
|
111 | defaults=defaults, | |
112 | encoding="UTF-8", |
|
112 | encoding="UTF-8", | |
113 | force_defaults=False |
|
113 | force_defaults=False |
1 | NO CONTENT: file renamed from pylons_app/templates/add.html to pylons_app/templates/admin/add.html |
|
NO CONTENT: file renamed from pylons_app/templates/add.html to pylons_app/templates/admin/add.html |
@@ -1,5 +1,5 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 | <%def name="get_form_error(element)"> |
|
3 | <%def name="get_form_error(element)"> | |
4 | %if hasattr(c,'form_errors'): |
|
4 | %if hasattr(c,'form_errors'): | |
5 | %if type(c.form_errors) == dict: |
|
5 | %if type(c.form_errors) == dict: |
1 | NO CONTENT: file renamed from pylons_app/templates/admin_log.html to pylons_app/templates/admin/admin_log.html |
|
NO CONTENT: file renamed from pylons_app/templates/admin_log.html to pylons_app/templates/admin/admin_log.html |
1 | NO CONTENT: file renamed from pylons_app/templates/repo_edit.html to pylons_app/templates/admin/repos/repo_edit.html |
|
NO CONTENT: file renamed from pylons_app/templates/repo_edit.html to pylons_app/templates/admin/repos/repo_edit.html |
@@ -1,4 +1,4 b'' | |||||
1 | <%inherit file="base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 | <%def name="title()"> |
|
2 | <%def name="title()"> | |
3 | ${_('Repository managment')} |
|
3 | ${_('Repository managment')} | |
4 | </%def> |
|
4 | </%def> | |
@@ -27,7 +27,7 b'' | |||||
27 | <table> |
|
27 | <table> | |
28 | %for cnt,repo in enumerate(c.repos_list): |
|
28 | %for cnt,repo in enumerate(c.repos_list): | |
29 | <tr class="parity${cnt%2}"> |
|
29 | <tr class="parity${cnt%2}"> | |
30 | <td><a href="/${repo['name']}">${repo['name']}</a></td> |
|
30 | <td>${h.link_to(repo['name'],h.url('summary_home',repo_name=repo['name']))}</td> | |
31 | <td>r${repo['rev']}:${repo['tip']}</td> |
|
31 | <td>r${repo['rev']}:${repo['tip']}</td> | |
32 | <td> |
|
32 | <td> | |
33 | ${h.form(url('repo', id=repo['name']),method='delete')} |
|
33 | ${h.form(url('repo', id=repo['name']),method='delete')} |
@@ -1,4 +1,4 b'' | |||||
1 | <%inherit file="base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 | <%def name="title()"> |
|
2 | <%def name="title()"> | |
3 | ${_('User')} - ${_('add new')} |
|
3 | ${_('User')} - ${_('add new')} | |
4 | </%def> |
|
4 | </%def> |
@@ -1,4 +1,4 b'' | |||||
1 | <%inherit file="base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 | <%def name="title()"> |
|
2 | <%def name="title()"> | |
3 | ${_('User')} - ${c.user.username} |
|
3 | ${_('User')} - ${c.user.username} | |
4 | </%def> |
|
4 | </%def> |
@@ -1,4 +1,4 b'' | |||||
1 | <%inherit file="base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 | <%def name="title()"> |
|
2 | <%def name="title()"> | |
3 | ${_('Repository managment')} |
|
3 | ${_('Repository managment')} | |
4 | </%def> |
|
4 | </%def> |
@@ -1,4 +1,4 b'' | |||||
1 | <%inherit file="base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 |
|
2 | |||
3 | <%def name="title()"> |
|
3 | <%def name="title()"> | |
4 | ${_('Repository managment')} |
|
4 | ${_('Repository managment')} |
@@ -1,4 +1,4 b'' | |||||
1 | <%inherit file="base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 |
|
2 | |||
3 | <%def name="title()"> |
|
3 | <%def name="title()"> | |
4 | ${_('Repository managment')} |
|
4 | ${_('Repository managment')} |
1 | NO CONTENT: file renamed from pylons_app/templates/shortlog_data.html to pylons_app/templates/shortlog/shortlog_data.html |
|
NO CONTENT: file renamed from pylons_app/templates/shortlog_data.html to pylons_app/templates/shortlog/shortlog_data.html |
@@ -1,4 +1,4 b'' | |||||
1 | <%inherit file="base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 | <%! |
|
2 | <%! | |
3 | from pylons_app.lib import filters |
|
3 | from pylons_app.lib import filters | |
4 | %> |
|
4 | %> |
@@ -13,9 +13,9 b' setup(' | |||||
13 |
author_email |
|
13 | author_email='marcin@python-blog.com', | |
14 |
url |
|
14 | url='', | |
15 |
install_requires |
|
15 | install_requires=[ | |
16 |
"Pylons>= |
|
16 | "Pylons>=1.0.0", | |
17 |
"SQLAlchemy>=0. |
|
17 | "SQLAlchemy>=0.6", | |
18 |
"Mako>=0. |
|
18 | "Mako>=0.3.2", | |
19 | ], |
|
19 | ], | |
20 |
setup_requires |
|
20 | setup_requires=["PasteScript>=1.6.3"], | |
21 |
packages |
|
21 | packages=find_packages(exclude=['ez_setup']), |
General Comments 0
You need to be logged in to leave comments.
Login now