Show More
@@ -0,0 +1,30 b'' | |||
|
1 | % if c.repo_branches: | |
|
2 | <table class="table_disp"> | |
|
3 | <tr class="header"> | |
|
4 | <td>${_('date')}</td> | |
|
5 | <td>${_('revision')}</td> | |
|
6 | <td>${_('name')}</td> | |
|
7 | <td>${_('links')}</td> | |
|
8 | </tr> | |
|
9 | %for cnt,branch in enumerate(c.repo_branches.items()): | |
|
10 | <tr class="parity${cnt%2}"> | |
|
11 | <td>${h.age(branch[1]._ctx.date())}</td> | |
|
12 | <td>r${branch[1].revision}:${branch[1].raw_id}</td> | |
|
13 | <td> | |
|
14 | <span class="logtags"> | |
|
15 | <span class="branchtag">${h.link_to(branch[0], | |
|
16 | h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}</span> | |
|
17 | </span> | |
|
18 | </td> | |
|
19 | <td class="nowrap"> | |
|
20 | ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))} | |
|
21 | | | |
|
22 | ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id))} | |
|
23 | </td> | |
|
24 | </tr> | |
|
25 | %endfor | |
|
26 | </table> | |
|
27 | %else: | |
|
28 | ${_('There are no branches yet')} | |
|
29 | %endif | |
|
30 |
@@ -0,0 +1,29 b'' | |||
|
1 | %if c.repo_tags: | |
|
2 | <table class="table_disp"> | |
|
3 | <tr class="header"> | |
|
4 | <td>${_('date')}</td> | |
|
5 | <td>${_('revision')}</td> | |
|
6 | <td>${_('name')}</td> | |
|
7 | <td>${_('links')}</td> | |
|
8 | </tr> | |
|
9 | %for cnt,tag in enumerate(c.repo_tags.items()): | |
|
10 | <tr class="parity${cnt%2}"> | |
|
11 | <td>${h.age(tag[1]._ctx.date())}</td> | |
|
12 | <td>r${tag[1].revision}:${tag[1].raw_id}</td> | |
|
13 | <td> | |
|
14 | <span class="logtags"> | |
|
15 | <span class="tagtag">${h.link_to(tag[0], | |
|
16 | h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}</span> | |
|
17 | </span> | |
|
18 | </td> | |
|
19 | <td class="nowrap"> | |
|
20 | ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))} | |
|
21 | | | |
|
22 | ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag[1].raw_id))} | |
|
23 | </td> | |
|
24 | </tr> | |
|
25 | %endfor | |
|
26 | </table> | |
|
27 | %else: | |
|
28 | ${_('There are no tags yet')} | |
|
29 | %endif No newline at end of file |
@@ -1,95 +1,96 b'' | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 | 2 | # encoding: utf-8 |
|
3 | 3 | # changelog controller for pylons |
|
4 | 4 | # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> |
|
5 | 5 | |
|
6 | 6 | # This program is free software; you can redistribute it and/or |
|
7 | 7 | # modify it under the terms of the GNU General Public License |
|
8 | 8 | # as published by the Free Software Foundation; version 2 |
|
9 | 9 | # of the License or (at your opinion) any later version of the license. |
|
10 | 10 | # |
|
11 | 11 | # This program is distributed in the hope that it will be useful, |
|
12 | 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 | 14 | # GNU General Public License for more details. |
|
15 | 15 | # |
|
16 | 16 | # You should have received a copy of the GNU General Public License |
|
17 | 17 | # along with this program; if not, write to the Free Software |
|
18 | 18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 | 19 | # MA 02110-1301, USA. |
|
20 | 20 | """ |
|
21 | 21 | Created on April 21, 2010 |
|
22 | 22 | changelog controller for pylons |
|
23 | 23 | @author: marcink |
|
24 | 24 | """ |
|
25 | 25 | from pylons import request, session, tmpl_context as c |
|
26 | 26 | from pylons_app.lib.auth import LoginRequired |
|
27 | 27 | from pylons_app.lib.base import BaseController, render |
|
28 | 28 | from pylons_app.model.hg_model import HgModel |
|
29 | 29 | from webhelpers.paginate import Page |
|
30 | 30 | import logging |
|
31 | 31 | log = logging.getLogger(__name__) |
|
32 | 32 | |
|
33 | 33 | class ChangelogController(BaseController): |
|
34 | 34 | |
|
35 | 35 | @LoginRequired() |
|
36 | 36 | def __before__(self): |
|
37 | 37 | super(ChangelogController, self).__before__() |
|
38 | 38 | |
|
39 | 39 | def index(self): |
|
40 | 40 | limit = 100 |
|
41 | 41 | default = 20 |
|
42 | 42 | if request.params.get('size'): |
|
43 | 43 | try: |
|
44 | 44 | int_size = int(request.params.get('size')) |
|
45 | 45 | except ValueError: |
|
46 | 46 | int_size = default |
|
47 | 47 | int_size = int_size if int_size <= limit else limit |
|
48 | 48 | c.size = int_size |
|
49 | 49 | session['changelog_size'] = c.size |
|
50 | 50 | session.save() |
|
51 | 51 | else: |
|
52 | c.size = session.get('changelog_size', default) | |
|
52 | c.size = int(session.get('changelog_size', default)) | |
|
53 | 53 | |
|
54 | 54 | changesets = HgModel().get_repo(c.repo_name) |
|
55 | 55 | |
|
56 | 56 | p = int(request.params.get('page', 1)) |
|
57 | c.pagination = Page(changesets, page=p, item_count=len(changesets), | |
|
57 | c.total_cs = len(changesets) | |
|
58 | c.pagination = Page(changesets, page=p, item_count=c.total_cs, | |
|
58 | 59 | items_per_page=c.size) |
|
59 | 60 | |
|
60 | 61 | #self._graph(c.repo, c.size,p) |
|
61 | 62 | |
|
62 | 63 | return render('changelog/changelog.html') |
|
63 | 64 | |
|
64 | 65 | |
|
65 | 66 | def _graph(self, repo, size, p): |
|
66 | 67 | pass |
|
67 | 68 | # revcount = size |
|
68 | 69 | # if not repo.revisions:return dumps([]), 0 |
|
69 | 70 | # |
|
70 | 71 | # max_rev = repo.revisions[-1] |
|
71 | 72 | # offset = 1 if p == 1 else ((p - 1) * revcount) |
|
72 | 73 | # rev_start = repo.revisions[(-1 * offset)] |
|
73 | 74 | # c.bg_height = 120 |
|
74 | 75 | # |
|
75 | 76 | # revcount = min(max_rev, revcount) |
|
76 | 77 | # rev_end = max(0, rev_start - revcount) |
|
77 | 78 | # dag = graph_rev(repo.repo, rev_start, rev_end) |
|
78 | 79 | # |
|
79 | 80 | # c.dag = tree = list(colored(dag)) |
|
80 | 81 | # canvasheight = (len(tree) + 1) * c.bg_height - 27 |
|
81 | 82 | # data = [] |
|
82 | 83 | # for (id, type, ctx, vtx, edges) in tree: |
|
83 | 84 | # if type != CHANGESET: |
|
84 | 85 | # continue |
|
85 | 86 | # node = short(ctx.node()) |
|
86 | 87 | # age = _age(ctx.date()) |
|
87 | 88 | # desc = ctx.description() |
|
88 | 89 | # user = person(ctx.user()) |
|
89 | 90 | # branch = ctx.branch() |
|
90 | 91 | # branch = branch, repo.repo.branchtags().get(branch) == ctx.node() |
|
91 | 92 | # data.append((node, vtx, edges, desc, user, age, branch, ctx.tags())) |
|
92 | 93 | # |
|
93 | 94 | # c.jsdata = dumps(data) |
|
94 | 95 | # c.canvasheight = canvasheight |
|
95 | 96 |
@@ -1,84 +1,84 b'' | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 | 2 | # encoding: utf-8 |
|
3 | 3 | # graph controller for pylons |
|
4 | 4 | # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> |
|
5 | 5 | |
|
6 | 6 | # This program is free software; you can redistribute it and/or |
|
7 | 7 | # modify it under the terms of the GNU General Public License |
|
8 | 8 | # as published by the Free Software Foundation; version 2 |
|
9 | 9 | # of the License or (at your opinion) any later version of the license. |
|
10 | 10 | # |
|
11 | 11 | # This program is distributed in the hope that it will be useful, |
|
12 | 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 | 14 | # GNU General Public License for more details. |
|
15 | 15 | # |
|
16 | 16 | # You should have received a copy of the GNU General Public License |
|
17 | 17 | # along with this program; if not, write to the Free Software |
|
18 | 18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 | 19 | # MA 02110-1301, USA. |
|
20 | 20 | """ |
|
21 | 21 | Created on April 21, 2010 |
|
22 | 22 | graph controller for pylons |
|
23 | 23 | @author: marcink |
|
24 | 24 | """ |
|
25 | 25 | from mercurial.graphmod import revisions as graph_rev, colored, CHANGESET |
|
26 | 26 | from mercurial.node import short |
|
27 | 27 | from pylons import request, tmpl_context as c |
|
28 | import pylons_app.lib.helpers as h | |
|
28 | 29 | from pylons_app.lib.auth import LoginRequired |
|
29 | 30 | from pylons_app.lib.base import BaseController, render |
|
30 | from pylons_app.lib.filters import age as _age, person | |
|
31 | 31 | from pylons_app.model.hg_model import HgModel |
|
32 | 32 | from simplejson import dumps |
|
33 | 33 | from webhelpers.paginate import Page |
|
34 | 34 | import logging |
|
35 | 35 | |
|
36 | 36 | log = logging.getLogger(__name__) |
|
37 | 37 | |
|
38 | 38 | class GraphController(BaseController): |
|
39 | 39 | |
|
40 | 40 | @LoginRequired() |
|
41 | 41 | def __before__(self): |
|
42 | 42 | super(GraphController, self).__before__() |
|
43 | 43 | |
|
44 | 44 | def index(self): |
|
45 | 45 | # Return a rendered template |
|
46 | 46 | hg_model = HgModel() |
|
47 | 47 | if request.POST.get('size'): |
|
48 | 48 | c.size = int(request.params.get('size', 20)) |
|
49 | 49 | else: |
|
50 | 50 | c.size = int(request.params.get('size', 20)) |
|
51 | 51 | c.jsdata, c.canvasheight = self.graph(hg_model.get_repo(c.repo_name), c.size) |
|
52 | 52 | |
|
53 | 53 | return render('/graph.html') |
|
54 | 54 | |
|
55 | 55 | |
|
56 | 56 | def graph(self, repo, size): |
|
57 | 57 | revcount = size |
|
58 | 58 | p = int(request.params.get('page', 1)) |
|
59 | 59 | c.pagination = Page(repo.revisions, page=p, item_count=len(repo.revisions), items_per_page=revcount) |
|
60 | 60 | if not repo.revisions:return dumps([]), 0 |
|
61 | 61 | |
|
62 | 62 | max_rev = repo.revisions[-1] |
|
63 | 63 | offset = 1 if p == 1 else ((p - 1) * revcount) |
|
64 | 64 | rev_start = repo.revisions[(-1 * offset)] |
|
65 | 65 | bg_height = 39 |
|
66 | 66 | |
|
67 | 67 | revcount = min(max_rev, revcount) |
|
68 | 68 | rev_end = max(0, rev_start - revcount) |
|
69 | 69 | dag = graph_rev(repo.repo, rev_start, rev_end) |
|
70 | 70 | tree = list(colored(dag)) |
|
71 | 71 | canvasheight = (len(tree) + 1) * bg_height - 27 |
|
72 | 72 | data = [] |
|
73 | 73 | for (id, type, ctx, vtx, edges) in tree: |
|
74 | 74 | if type != CHANGESET: |
|
75 | 75 | continue |
|
76 | 76 | node = short(ctx.node()) |
|
77 |
age = |
|
|
77 | age = h.age(ctx.date()) | |
|
78 | 78 | desc = ctx.description() |
|
79 | user = person(ctx.user()) | |
|
79 | user = h.person(ctx.user()) | |
|
80 | 80 | branch = ctx.branch() |
|
81 | 81 | branch = branch, repo.repo.branchtags().get(branch) == ctx.node() |
|
82 | 82 | data.append((node, vtx, edges, desc, user, age, branch, ctx.tags())) |
|
83 | 83 | |
|
84 | 84 | return dumps(data), canvasheight |
@@ -1,58 +1,59 b'' | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 | 2 | # encoding: utf-8 |
|
3 | 3 | # summary controller for pylons |
|
4 | 4 | # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> |
|
5 | 5 | |
|
6 | 6 | # This program is free software; you can redistribute it and/or |
|
7 | 7 | # modify it under the terms of the GNU General Public License |
|
8 | 8 | # as published by the Free Software Foundation; version 2 |
|
9 | 9 | # of the License or (at your opinion) any later version of the license. |
|
10 | 10 | # |
|
11 | 11 | # This program is distributed in the hope that it will be useful, |
|
12 | 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 | 14 | # GNU General Public License for more details. |
|
15 | 15 | # |
|
16 | 16 | # You should have received a copy of the GNU General Public License |
|
17 | 17 | # along with this program; if not, write to the Free Software |
|
18 | 18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 | 19 | # MA 02110-1301, USA. |
|
20 | 20 | """ |
|
21 | 21 | Created on April 18, 2010 |
|
22 | 22 | summary controller for pylons |
|
23 | 23 | @author: marcink |
|
24 | 24 | """ |
|
25 | 25 | from pylons import tmpl_context as c, request |
|
26 | 26 | from pylons_app.lib.auth import LoginRequired |
|
27 | 27 | from pylons_app.lib.base import BaseController, render |
|
28 |
from pylons_app.model.hg_model import HgModel |
|
|
28 | from pylons_app.model.hg_model import HgModel | |
|
29 | from webhelpers.paginate import Page | |
|
29 | 30 | import logging |
|
30 | 31 | |
|
31 | 32 | log = logging.getLogger(__name__) |
|
32 | 33 | |
|
33 | 34 | class SummaryController(BaseController): |
|
34 | 35 | |
|
35 | 36 | @LoginRequired() |
|
36 | 37 | def __before__(self): |
|
37 | 38 | super(SummaryController, self).__before__() |
|
38 | 39 | |
|
39 | 40 | def index(self): |
|
40 | 41 | hg_model = HgModel() |
|
41 | 42 | c.repo_info = hg_model.get_repo(c.repo_name) |
|
42 |
c.repo_changesets = |
|
|
43 | c.repo_changesets = Page(list(c.repo_info[:10]), page=1, items_per_page=20) | |
|
43 | 44 | e = request.environ |
|
44 | 45 | uri = u'%(protocol)s://%(user)s@%(host)s/%(repo_name)s' % { |
|
45 | 46 | 'protocol': e.get('wsgi.url_scheme'), |
|
46 | 47 | 'user':str(c.hg_app_user.username), |
|
47 | 48 | 'host':e.get('HTTP_HOST'), |
|
48 | 49 | 'repo_name':c.repo_name, } |
|
49 | 50 | c.clone_repo_url = uri |
|
50 | 51 | c.repo_tags = {} |
|
51 | 52 | for name, hash in c.repo_info.tags.items()[:10]: |
|
52 | 53 | c.repo_tags[name] = c.repo_info.get_changeset(hash) |
|
53 | 54 | |
|
54 | 55 | c.repo_branches = {} |
|
55 | 56 | for name, hash in c.repo_info.branches.items()[:10]: |
|
56 | 57 | c.repo_branches[name] = c.repo_info.get_changeset(hash) |
|
57 | 58 | |
|
58 | 59 | return render('summary/summary.html') |
@@ -1,205 +1,231 b'' | |||
|
1 | 1 | """Helper functions |
|
2 | 2 | |
|
3 | 3 | Consists of functions to typically be used within templates, but also |
|
4 | 4 | available to Controllers. This module is available to both as 'h'. |
|
5 | 5 | """ |
|
6 | 6 | from pygments.formatters import HtmlFormatter |
|
7 | 7 | from pygments import highlight as code_highlight |
|
8 | 8 | from pylons import url, app_globals as g |
|
9 | 9 | from pylons.i18n.translation import _, ungettext |
|
10 | 10 | from vcs.utils.annotate import annotate_highlight |
|
11 | 11 | from webhelpers.html import literal, HTML, escape |
|
12 | 12 | from webhelpers.html.tools import * |
|
13 | 13 | from webhelpers.html.builder import make_tag |
|
14 | 14 | from webhelpers.html.tags import auto_discovery_link, checkbox, css_classes, \ |
|
15 | 15 | end_form, file, form, hidden, image, javascript_link, link_to, link_to_if, \ |
|
16 | 16 | link_to_unless, ol, required_legend, select, stylesheet_link, submit, text, \ |
|
17 | 17 | password, textarea, title, ul, xml_declaration, radio |
|
18 | 18 | from webhelpers.html.tools import auto_link, button_to, highlight, js_obfuscate, \ |
|
19 | 19 | mail_to, strip_links, strip_tags, tag_re |
|
20 | 20 | from webhelpers.number import format_byte_size, format_bit_size |
|
21 | 21 | from webhelpers.pylonslib import Flash as _Flash |
|
22 | 22 | from webhelpers.pylonslib.secure_form import secure_form |
|
23 | 23 | from webhelpers.text import chop_at, collapse, convert_accented_entities, \ |
|
24 | 24 | convert_misc_entities, lchop, plural, rchop, remove_formatting, \ |
|
25 | 25 | replace_whitespace, urlify, truncate, wrap_paragraphs |
|
26 | 26 | |
|
27 | 27 | |
|
28 | 28 | #Custom helpers here :) |
|
29 | 29 | class _Link(object): |
|
30 | 30 | ''' |
|
31 | 31 | Make a url based on label and url with help of url_for |
|
32 | 32 | @param label:name of link if not defined url is used |
|
33 | 33 | @param url: the url for link |
|
34 | 34 | ''' |
|
35 | 35 | |
|
36 | 36 | def __call__(self, label='', *url_, **urlargs): |
|
37 | 37 | if label is None or '': |
|
38 | 38 | label = url |
|
39 | 39 | link_fn = link_to(label, url(*url_, **urlargs)) |
|
40 | 40 | return link_fn |
|
41 | 41 | |
|
42 | 42 | link = _Link() |
|
43 | 43 | |
|
44 | 44 | class _GetError(object): |
|
45 | 45 | |
|
46 | 46 | def __call__(self, field_name, form_errors): |
|
47 | 47 | tmpl = """<span class="error_msg">%s</span>""" |
|
48 | 48 | if form_errors and form_errors.has_key(field_name): |
|
49 | 49 | return literal(tmpl % form_errors.get(field_name)) |
|
50 | 50 | |
|
51 | 51 | get_error = _GetError() |
|
52 | 52 | |
|
53 | 53 | def recursive_replace(str, replace=' '): |
|
54 | 54 | """ |
|
55 | 55 | Recursive replace of given sign to just one instance |
|
56 | 56 | @param str: given string |
|
57 | 57 | @param replace:char to find and replace multiple instances |
|
58 | 58 | |
|
59 | 59 | Examples:: |
|
60 | 60 | >>> recursive_replace("Mighty---Mighty-Bo--sstones",'-') |
|
61 | 61 | 'Mighty-Mighty-Bo-sstones' |
|
62 | 62 | """ |
|
63 | 63 | |
|
64 | 64 | if str.find(replace * 2) == -1: |
|
65 | 65 | return str |
|
66 | 66 | else: |
|
67 | 67 | str = str.replace(replace * 2, replace) |
|
68 | 68 | return recursive_replace(str, replace) |
|
69 | 69 | |
|
70 | 70 | class _ToolTip(object): |
|
71 | 71 | |
|
72 | 72 | def __call__(self, tooltip_title, trim_at=50): |
|
73 | 73 | """ |
|
74 | 74 | Special function just to wrap our text into nice formatted autowrapped |
|
75 | 75 | text |
|
76 | 76 | @param tooltip_title: |
|
77 | 77 | """ |
|
78 | 78 | |
|
79 | 79 | return literal(wrap_paragraphs(tooltip_title, trim_at)\ |
|
80 | 80 | .replace('\n', '<br/>')) |
|
81 | 81 | |
|
82 | 82 | def activate(self): |
|
83 | 83 | """ |
|
84 | 84 | Adds tooltip mechanism to the given Html all tooltips have to have |
|
85 | 85 | set class tooltip and set attribute tooltip_title. |
|
86 | 86 | Then a tooltip will be generated based on that |
|
87 | 87 | All with yui js tooltip |
|
88 | 88 | """ |
|
89 | 89 | |
|
90 | 90 | js = ''' |
|
91 | 91 | YAHOO.util.Event.onDOMReady(function(){ |
|
92 | 92 | function toolTipsId(){ |
|
93 | 93 | var ids = []; |
|
94 | 94 | var tts = YAHOO.util.Dom.getElementsByClassName('tooltip'); |
|
95 | 95 | |
|
96 | 96 | for (var i = 0; i < tts.length; i++) { |
|
97 | 97 | //if element doesn not have and id autgenerate one for tooltip |
|
98 | 98 | |
|
99 | 99 | if (!tts[i].id){ |
|
100 | 100 | tts[i].id='tt'+i*100; |
|
101 | 101 | } |
|
102 | 102 | ids.push(tts[i].id); |
|
103 | 103 | } |
|
104 | 104 | return ids |
|
105 | 105 | }; |
|
106 | 106 | var myToolTips = new YAHOO.widget.Tooltip("tooltip", { |
|
107 | 107 | context: toolTipsId(), |
|
108 | 108 | monitorresize:false, |
|
109 | 109 | xyoffset :[0,0], |
|
110 | 110 | autodismissdelay:300000, |
|
111 | 111 | hidedelay:5, |
|
112 | 112 | showdelay:20, |
|
113 | 113 | }); |
|
114 | 114 | |
|
115 | 115 | //Mouse subscribe optional arguments |
|
116 | 116 | myToolTips.contextMouseOverEvent.subscribe( |
|
117 | 117 | function(type, args) { |
|
118 | 118 | var context = args[0]; |
|
119 | 119 | return true; |
|
120 | 120 | }); |
|
121 | 121 | |
|
122 | 122 | // Set the text for the tooltip just before we display it. Lazy method |
|
123 | 123 | myToolTips.contextTriggerEvent.subscribe( |
|
124 | 124 | function(type, args) { |
|
125 | 125 | var context = args[0]; |
|
126 | 126 | var txt = context.getAttribute('tooltip_title'); |
|
127 | 127 | this.cfg.setProperty("text", txt); |
|
128 | 128 | }); |
|
129 | 129 | }); |
|
130 | 130 | ''' |
|
131 | 131 | return literal(js) |
|
132 | 132 | |
|
133 | 133 | tooltip = _ToolTip() |
|
134 | 134 | |
|
135 | 135 | class _FilesBreadCrumbs(object): |
|
136 | 136 | |
|
137 | 137 | def __call__(self, repo_name, rev, paths): |
|
138 | 138 | url_l = [link_to(repo_name, url('files_home', repo_name=repo_name, revision=rev, f_path=''))] |
|
139 | 139 | paths_l = paths.split(' / ') |
|
140 | 140 | |
|
141 | 141 | for cnt, p in enumerate(paths_l, 1): |
|
142 | 142 | if p != '': |
|
143 | 143 | url_l.append(link_to(p, url('files_home', repo_name=repo_name, revision=rev, f_path=' / '.join(paths_l[:cnt])))) |
|
144 | 144 | |
|
145 | 145 | return literal(' / '.join(url_l)) |
|
146 | 146 | |
|
147 | 147 | files_breadcrumbs = _FilesBreadCrumbs() |
|
148 | 148 | |
|
149 | 149 | def pygmentize(filenode, **kwargs): |
|
150 | 150 | """ |
|
151 | 151 | pygmentize function using pygments |
|
152 | 152 | @param filenode: |
|
153 | 153 | """ |
|
154 | 154 | return literal(code_highlight(filenode.content, filenode.lexer, HtmlFormatter(**kwargs))) |
|
155 | 155 | |
|
156 | 156 | def pygmentize_annotation(filenode, **kwargs): |
|
157 | 157 | """ |
|
158 | 158 | pygmentize function for annotation |
|
159 | 159 | @param filenode: |
|
160 | 160 | """ |
|
161 | 161 | |
|
162 | 162 | color_dict = g.changeset_annotation_colors |
|
163 | 163 | def gen_color(): |
|
164 | 164 | import random |
|
165 | 165 | return [str(random.randrange(10, 235)) for _ in xrange(3)] |
|
166 | 166 | def get_color_string(cs): |
|
167 | 167 | if color_dict.has_key(cs): |
|
168 | 168 | col = color_dict[cs] |
|
169 | 169 | else: |
|
170 | 170 | color_dict[cs] = gen_color() |
|
171 | 171 | col = color_dict[cs] |
|
172 | 172 | return "color: rgb(%s) ! important;" % (', '.join(col)) |
|
173 | 173 | |
|
174 | 174 | def url_func(changeset): |
|
175 | 175 | tooltip_html = "<div style='font-size:0.8em'><b>Author:</b> %s<br/><b>Date:</b> %s</b><br/><b>Message:</b> %s<br/></div>" |
|
176 | 176 | |
|
177 | 177 | tooltip_html = tooltip_html % (changeset.author, |
|
178 | 178 | changeset.date, |
|
179 | 179 | tooltip(changeset.message)) |
|
180 | 180 | lnk_format = 'r%s:%s' % (changeset.revision, |
|
181 | 181 | changeset.raw_id) |
|
182 | 182 | uri = link_to( |
|
183 | 183 | lnk_format, |
|
184 | 184 | url('changeset_home', repo_name='test', |
|
185 | 185 | revision=changeset.raw_id), |
|
186 | 186 | style=get_color_string(changeset.raw_id), |
|
187 | 187 | class_='tooltip', |
|
188 | 188 | tooltip_title=tooltip_html |
|
189 | 189 | ) |
|
190 | 190 | |
|
191 | 191 | uri += '\n' |
|
192 | 192 | return uri |
|
193 | 193 | return literal(annotate_highlight(filenode, url_func, **kwargs)) |
|
194 | 194 | |
|
195 | 195 | def repo_name_slug(value): |
|
196 | 196 | """ |
|
197 | 197 | Return slug of name of repository |
|
198 | 198 | """ |
|
199 | 199 | slug = urlify(value) |
|
200 | 200 | for c in """=[]\;'"<>,/~!@#$%^&*()+{}|:""": |
|
201 | 201 | slug = slug.replace(c, '-') |
|
202 | 202 | slug = recursive_replace(slug, '-') |
|
203 | 203 | return slug |
|
204 | 204 | |
|
205 | 205 | flash = _Flash() |
|
206 | ||
|
207 | ||
|
208 | #=============================================================================== | |
|
209 | # MERCURIAL FILTERS available via h. | |
|
210 | #=============================================================================== | |
|
211 | ||
|
212 | ||
|
213 | from mercurial import util | |
|
214 | from mercurial.templatefilters import age as _age, person as _person | |
|
215 | ||
|
216 | age = lambda x:_age(x) | |
|
217 | capitalize = lambda x: x.capitalize() | |
|
218 | date = lambda x: util.datestr(x) | |
|
219 | email = util.email | |
|
220 | person = lambda x: _person(x) | |
|
221 | hgdate = lambda x: "%d %d" % x | |
|
222 | isodate = lambda x: util.datestr(x, '%Y-%m-%d %H:%M %1%2') | |
|
223 | isodatesec = lambda x: util.datestr(x, '%Y-%m-%d %H:%M:%S %1%2') | |
|
224 | localdate = lambda x: (x[0], util.makedate()[1]) | |
|
225 | rfc822date = lambda x: util.datestr(x, "%a, %d %b %Y %H:%M:%S %1%2") | |
|
226 | rfc3339date = lambda x: util.datestr(x, "%Y-%m-%dT%H:%M:%S%1:%2") | |
|
227 | time_ago = lambda x: util.datestr(_age(x), "%a, %d %b %Y %H:%M:%S %1%2") | |
|
228 | ||
|
229 | ||
|
230 | ||
|
231 |
@@ -1,46 +1,18 b'' | |||
|
1 | 1 | <%inherit file="/base/base.html"/> |
|
2 | <%! from pylons_app.lib import filters %> | |
|
3 | 2 | <%def name="title()"> |
|
4 | 3 | ${_('Branches')} |
|
5 | 4 | </%def> |
|
6 | 5 | <%def name="breadcrumbs()"> |
|
7 | 6 | ${h.link_to(u'Home',h.url('/'))} |
|
8 | 7 | / |
|
9 | 8 | ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))} |
|
10 | 9 | / |
|
11 | 10 | ${_('branches')} |
|
12 | 11 | </%def> |
|
13 | 12 | <%def name="page_nav()"> |
|
14 | 13 | ${self.menu('branches')} |
|
15 | 14 | </%def> |
|
16 | 15 | <%def name="main()"> |
|
17 | ||
|
18 | 16 | <h2 class="no-link no-border">${_('Branches')}</h2> |
|
19 | ||
|
20 | <table class="table_disp"> | |
|
21 | <tr class="header"> | |
|
22 | <td>${_('date')}</td> | |
|
23 | <td>${_('revision')}</td> | |
|
24 | <td>${_('name')}</td> | |
|
25 | <td>${_('links')}</td> | |
|
26 | </tr> | |
|
27 | %for cnt,branch in enumerate(c.repo_branches.items()): | |
|
28 | <tr class="parity${cnt%2}"> | |
|
29 | <td>${branch[1]._ctx.date()|n,filters.age}</td> | |
|
30 | <td>r${branch[1].revision}:${branch[1].raw_id}</td> | |
|
31 | <td> | |
|
32 | <span class="logtags"> | |
|
33 | <span class="branchtag">${h.link_to(branch[0], | |
|
34 | h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}</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[1].raw_id))} | |
|
39 | | | |
|
40 | ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id))} | |
|
41 | </td> | |
|
42 | </tr> | |
|
43 | %endfor | |
|
44 | </table> | |
|
45 | ||
|
17 | <%include file='branches_data.html'/> | |
|
46 | 18 | </%def> No newline at end of file |
@@ -1,92 +1,96 b'' | |||
|
1 | <%! | |
|
2 | from pylons_app.lib import filters | |
|
3 | %> | |
|
4 | 1 |
|
|
5 | 2 | |
|
6 | 3 | <%def name="title()"> |
|
7 | 4 | ${_('Changelog - %s') % c.repo_name} |
|
8 | 5 | </%def> |
|
9 | 6 | <%def name="breadcrumbs()"> |
|
10 | 7 | ${h.link_to(u'Home',h.url('/'))} |
|
11 | 8 | / |
|
12 | 9 | ${h.link_to(c.repo_name,h.url('changelog_home',repo_name=c.repo_name))} |
|
13 | 10 | / |
|
14 | 11 | ${_('changelog')} |
|
15 | 12 | </%def> |
|
16 | 13 | <%def name="page_nav()"> |
|
17 | 14 | ${self.menu('changelog')} |
|
18 | 15 | </%def> |
|
19 | 16 | |
|
20 | 17 | <%def name="main()"> |
|
21 | 18 | |
|
22 |
<h2 class="no-link no-border">${_('Changelog')} - ${_('showing |
|
|
19 | <h2 class="no-link no-border">${_('Changelog')} - ${_('showing ')} | |
|
20 | ${c.size if c.size <= c.total_cs else c.total_cs} | |
|
21 | ${_('out of')} ${c.total_cs} ${_('revisions')} | |
|
22 | </h2> | |
|
23 | 23 | <noscript>${_('The revision graph only works with JavaScript-enabled browsers.')}</noscript> |
|
24 | % if c.pagination: | |
|
24 | 25 | |
|
25 | 26 | <div id="graph"> |
|
26 | 27 | ##<div id="graph_nodes" style="height:1000px"> |
|
27 | 28 | ## <canvas id="graph" width="160"></canvas> |
|
28 | 29 | ##</div> |
|
29 | 30 | <div id="graph_content"> |
|
30 | 31 | <div class="container_header"> |
|
31 | 32 | ${h.form(h.url.current(),method='get')} |
|
32 | 33 | ${_('Show')}: ${h.text('size',size=2,value=c.size)} ${_('revisions')} |
|
33 | 34 | ${h.submit('','set')} |
|
34 | 35 | ${h.end_form()} |
|
35 | 36 | </div> |
|
36 | 37 | %for cnt,cs in enumerate(c.pagination): |
|
37 | 38 | <div class="container"> |
|
38 | 39 | <div class="left"> |
|
39 | 40 | <div class="date">${_('commit')} ${cs.revision}: ${cs.raw_id}@${cs.date}</div> |
|
40 | 41 | <div class="author">${cs.author}</div> |
|
41 | 42 | <div id="chg_${cnt}" class="message"> |
|
42 | 43 | ${h.link_to(cs.message, |
|
43 | 44 | h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id), |
|
44 | 45 | title=cs.message)} |
|
45 | 46 | </div> |
|
46 | 47 | <span class="logtags"> |
|
47 | 48 | <span class="branchtag">${cs.branch}</span> |
|
48 | 49 | %for tag in cs.tags: |
|
49 | 50 | <span class="tagtag">${tag}</span> |
|
50 | 51 | %endfor |
|
51 | 52 | </span> |
|
52 | 53 | </div> |
|
53 | 54 | <div class="right"> |
|
54 | 55 | <div class="changes"> |
|
55 | 56 | <span class="removed" title="${_('removed')}">${len(cs.removed)}</span> |
|
56 | 57 | <span class="changed" title="${_('changed')}">${len(cs.changed)}</span> |
|
57 | 58 | <span class="added" title="${_('added')}">${len(cs.added)}</span> |
|
58 | 59 | </div> |
|
59 | 60 | %if len(cs.parents)>1: |
|
60 | 61 | <div class="merge"> |
|
61 | 62 | ${_('merge')}<img alt="merge" src="/images/icons/arrow_join.png"> |
|
62 | 63 | </div> |
|
63 | 64 | %endif |
|
64 | 65 | %for p_cs in reversed(cs.parents): |
|
65 | 66 | <div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs.raw_id, |
|
66 | 67 | h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)} |
|
67 | 68 | </div> |
|
68 | 69 | %endfor |
|
69 | 70 | </div> |
|
70 | 71 | </div> |
|
71 | 72 | |
|
72 | 73 | %endfor |
|
73 | 74 | </div> |
|
74 | 75 | </div> |
|
75 | 76 | |
|
76 | 77 | ##<script type="text/javascript" src="/js/graph2.js"></script> |
|
77 | 78 | ##<script type="text/javascript" src="http://bitbucket-assets.s3.amazonaws.com/js/lib/bundle.160310Mar.js"></script> |
|
78 | 79 | ## |
|
79 | 80 | ##<script> |
|
80 | 81 | ##<!-- hide script content |
|
81 | 82 | ## |
|
82 | 83 | ##var jsdata = ${c.jsdata|n}; |
|
83 | 84 | ##var r = new BranchRenderer(); |
|
84 | 85 | ##r.render(jsdata); |
|
85 | 86 | |
|
86 | 87 | ##// stop hiding script --> |
|
87 | 88 | ##</script> |
|
88 | 89 | |
|
89 | 90 | <div> |
|
90 | 91 | <h2>${c.pagination.pager('$link_previous ~2~ $link_next')}</h2> |
|
91 | 92 | </div> |
|
93 | %else: | |
|
94 | ${_('There are no changes yet')} | |
|
95 | %endif | |
|
92 | 96 | </%def> No newline at end of file |
@@ -1,95 +1,92 b'' | |||
|
1 | <%! | |
|
2 | from pylons_app.lib import filters | |
|
3 | %> | |
|
4 | 1 |
|
|
5 | 2 | |
|
6 | 3 | <%def name="title()"> |
|
7 | 4 | ${_('Changeset')} |
|
8 | 5 | </%def> |
|
9 | 6 | <%def name="breadcrumbs()"> |
|
10 | 7 | ${h.link_to(u'Home',h.url('/'))} |
|
11 | 8 | / |
|
12 | 9 | ${h.link_to(c.repo_name,h.url('changeset_home',repo_name=c.repo_name))} |
|
13 | 10 | / |
|
14 | 11 | ${_('changeset')} |
|
15 | 12 | </%def> |
|
16 | 13 | <%def name="page_nav()"> |
|
17 | 14 | ${self.menu('changelog')} |
|
18 | 15 | </%def> |
|
19 | 16 | <%def name="css()"> |
|
20 | 17 | <link rel="stylesheet" href="/css/monoblue_custom.css" type="text/css" /> |
|
21 | 18 | <link rel="stylesheet" href="/css/diff.css" type="text/css" /> |
|
22 | 19 | </%def> |
|
23 | 20 | <%def name="main()"> |
|
24 | 21 | <h2 class="no-link no-border">${_('Changeset')} - r${c.changeset.revision}:${c.changeset.raw_id}</h2> |
|
25 | 22 | |
|
26 | 23 | <div id="changeset_content"> |
|
27 | 24 | <div class="container"> |
|
28 | 25 | <div class="left"> |
|
29 | 26 | <div class="date">${_('Date')}: ${c.changeset.date}</div> |
|
30 | 27 | <div class="author">${_('Author')}: ${c.changeset.author}</div> |
|
31 | 28 | <div class="message"> |
|
32 | 29 | ${c.changeset.message} |
|
33 | 30 | </div> |
|
34 | 31 | </div> |
|
35 | 32 | <div class="right"> |
|
36 | 33 | <span class="logtags"> |
|
37 | 34 | <span class="branchtag">${c.changeset.branch}</span> |
|
38 | 35 | %for tag in c.changeset.tags: |
|
39 | 36 | <span class="tagtag">${tag}</span> |
|
40 | 37 | %endfor |
|
41 | 38 | </span> |
|
42 | 39 | %if len(c.changeset.parents)>1: |
|
43 | 40 | <div class="merge"> |
|
44 | 41 | ${_('merge')} |
|
45 | 42 | <img alt="merge" src="/images/icons/arrow_join.png"> |
|
46 | 43 | </div> |
|
47 | 44 | %endif |
|
48 | 45 | %for p_cs in reversed(c.changeset.parents): |
|
49 | 46 | <div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs.raw_id, |
|
50 | 47 | h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)} |
|
51 | 48 | </div> |
|
52 | 49 | %endfor |
|
53 | 50 | </div> |
|
54 | 51 | </div> |
|
55 | 52 | </div> |
|
56 | 53 | |
|
57 | 54 | <div style="clear:both;height:10px"></div> |
|
58 | 55 | <div class="cs_files"> |
|
59 | 56 | %for change,filenode,diff,cs1,cs2 in c.changes: |
|
60 | 57 | <div class="cs_${change}">${h.link_to(filenode.path,h.url.current(anchor='CHANGE-%s'%filenode.path))}</div> |
|
61 | 58 | %endfor |
|
62 | 59 | </div> |
|
63 | 60 | |
|
64 | 61 | %for change,filenode,diff,cs1,cs2 in c.changes: |
|
65 | 62 | %if change !='removed': |
|
66 | 63 | <div style="clear:both;height:10px"></div> |
|
67 | 64 | <div id="body" class="diffblock"> |
|
68 | 65 | <div id="${'CHANGE-%s'%filenode.path}" class="code-header"> |
|
69 | 66 | <div> |
|
70 | 67 | <span> |
|
71 | 68 | ${h.link_to_if(change!='removed',filenode.path,h.url('files_home',repo_name=c.repo_name, |
|
72 | 69 | revision=filenode.changeset.raw_id,f_path=filenode.path))} |
|
73 | 70 | </span> |
|
74 | 71 | %if 1: |
|
75 | 72 | » <span style="font-size:77%">${h.link_to(_('diff'), |
|
76 | 73 | h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='diff'))}</span> |
|
77 | 74 | » <span style="font-size:77%">${h.link_to(_('raw diff'), |
|
78 | 75 | h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='raw'))}</span> |
|
79 | 76 | » <span style="font-size:77%">${h.link_to(_('download diff'), |
|
80 | 77 | h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='download'))}</span> |
|
81 | 78 | %endif |
|
82 | 79 | </div> |
|
83 | 80 | </div> |
|
84 | 81 | <div class="code-body"> |
|
85 | 82 | %if diff: |
|
86 | 83 | ${diff|n} |
|
87 | 84 | %else: |
|
88 | 85 | ${_('No changes in this file')} |
|
89 | 86 | %endif |
|
90 | 87 | </div> |
|
91 | 88 | </div> |
|
92 | 89 | %endif |
|
93 | 90 | %endfor |
|
94 | 91 | |
|
95 | 92 | </%def> No newline at end of file |
@@ -1,35 +1,32 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | <%! | |
|
3 | from pylons_app.lib import filters | |
|
4 | %> | |
|
5 | 2 | <%inherit file="./../base/base.html"/> |
|
6 | 3 | |
|
7 | 4 | <%def name="title()"> |
|
8 | 5 | ${_('Repository not found')} |
|
9 | 6 | </%def> |
|
10 | 7 | |
|
11 | 8 | <%def name="breadcrumbs()"> |
|
12 | 9 | ${h.link_to(u'Home',h.url('hg_home'))} |
|
13 | 10 | / |
|
14 | 11 | ${h.link_to(u'Admin',h.url('admin_home'))} |
|
15 | 12 | </%def> |
|
16 | 13 | |
|
17 | 14 | <%def name="page_nav()"> |
|
18 | 15 | ${self.menu('admin')} |
|
19 | 16 | </%def> |
|
20 | 17 | <%def name="js()"> |
|
21 | 18 | |
|
22 | 19 | </%def> |
|
23 | 20 | <%def name="main()"> |
|
24 | 21 | |
|
25 | 22 | <h2 class="no-link no-border">${_('Not Found')}</h2> |
|
26 | 23 | <p class="normal">${_('The specified repository "%s" is unknown, sorry.') % c.repo_name}</p> |
|
27 | 24 | <p class="normal"> |
|
28 | 25 | <a href="${h.url('new_repo',repo=c.repo_name_cleaned)}"> |
|
29 | 26 | ${_('Create "%s" repository as %s' % (c.repo_name,c.repo_name_cleaned))}</a> |
|
30 | 27 | |
|
31 | 28 | </p> |
|
32 | 29 | <p class="normal">${h.link_to(_('Go back to the main repository list page'),h.url('hg_home'))}</p> |
|
33 | 30 | <div class="page-footer"> |
|
34 | 31 | </div> |
|
35 | 32 | </%def> No newline at end of file |
@@ -1,56 +1,53 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | <%! | |
|
3 | from pylons_app.lib import filters | |
|
4 | %> | |
|
5 | 2 | <%inherit file="base/base.html"/> |
|
6 | 3 | <%def name="title()"> |
|
7 | 4 | ${c.repos_prefix} Mercurial Repositories |
|
8 | 5 | </%def> |
|
9 | 6 | <%def name="breadcrumbs()"> |
|
10 | 7 | ${c.repos_prefix} Mercurial Repositories |
|
11 | 8 | </%def> |
|
12 | 9 | <%def name="page_nav()"> |
|
13 | 10 | ${self.menu('home')} |
|
14 | 11 | </%def> |
|
15 | 12 | <%def name="main()"> |
|
16 | 13 | <%def name="get_sort(name)"> |
|
17 | 14 | <%name_slug = name.lower().replace(' ','_') %> |
|
18 | 15 | %if name_slug == c.cs_slug: |
|
19 | 16 | <span style="font-weight: bold;text-decoration: underline;">${name}</span> |
|
20 | 17 | %else: |
|
21 | 18 | <span style="font-weight: bold">${name}</span> |
|
22 | 19 | %endif |
|
23 | 20 | <a style="color:#FFF" href="?sort=${name_slug}">↓</a> |
|
24 | 21 | <a style="color:#FFF" href="?sort=-${name_slug}">↑</a> |
|
25 | 22 | </%def> |
|
26 | 23 | <table class="table_disp"> |
|
27 | 24 | <tr class="header"> |
|
28 | 25 | <td>${get_sort(_('Name'))}</td> |
|
29 | 26 | <td>${get_sort(_('Description'))}</td> |
|
30 | 27 | <td>${get_sort(_('Last change'))}</td> |
|
31 | 28 | <td>${get_sort(_('Tip'))}</td> |
|
32 | 29 | <td>${get_sort(_('Contact'))}</td> |
|
33 | 30 | <td>${_('RSS')}</td> |
|
34 | 31 | <td>${_('Atom')}</td> |
|
35 | 32 | </tr> |
|
36 | 33 | %for cnt,repo in enumerate(c.repos_list): |
|
37 | 34 | <tr class="parity${cnt%2}"> |
|
38 | 35 | <td>${h.link_to(repo['name'], |
|
39 | 36 | h.url('summary_home',repo_name=repo['name']))}</td> |
|
40 | 37 | <td title="${repo['description']}">${h.truncate(repo['description'],60)}</td> |
|
41 |
<td>${repo['last_change'] |
|
|
38 | <td>${h.age(repo['last_change'])}</td> | |
|
42 | 39 | <td>${h.link_to('r%s:%s' % (repo['rev'],repo['tip']), |
|
43 | 40 | h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']), |
|
44 | 41 | class_="tooltip", |
|
45 | 42 | tooltip_title=h.tooltip(repo['last_msg']))}</td> |
|
46 |
<td title="${repo['contact']}">${repo['contact'] |
|
|
43 | <td title="${repo['contact']}">${h.person(repo['contact'])}</td> | |
|
47 | 44 | <td> |
|
48 | 45 | <a title="${_('Subscribe to %s rss feed')%repo['name']}" class="rss_logo" href="${h.url('rss_feed_home',repo_name=repo['name'])}"></a> |
|
49 | 46 | </td> |
|
50 | 47 | <td> |
|
51 | 48 | <a title="${_('Subscribe to %s atom feed')%repo['name']}" class="atom_logo" href="${h.url('atom_feed_home',repo_name=repo['name'])}"></a> |
|
52 | 49 | </td> |
|
53 | 50 | </tr> |
|
54 | 51 | %endfor |
|
55 | 52 | </table> |
|
56 | 53 | </%def> |
@@ -1,40 +1,37 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | <%! | |
|
3 | from pylons_app.lib import filters | |
|
4 | %> | |
|
5 | 2 | <%inherit file="base/base.html"/> |
|
6 | 3 | <%def name="title()"> |
|
7 | 4 | ${c.repos_prefix} Mercurial Repositories |
|
8 | 5 | </%def> |
|
9 | 6 | <%def name="breadcrumbs()"> |
|
10 | 7 | ${c.repos_prefix} Mercurial Repositories |
|
11 | 8 | </%def> |
|
12 | 9 | <%def name="page_nav()"> |
|
13 | 10 | ${self.menu('home')} |
|
14 | 11 | </%def> |
|
15 | 12 | <%def name="main()"> |
|
16 | 13 | <div> |
|
17 | 14 | <br /> |
|
18 | 15 | <h2>${_('Login')}</h2> |
|
19 | 16 | ${h.form(h.url.current())} |
|
20 | 17 | <table> |
|
21 | 18 | <tr> |
|
22 | 19 | <td>${_('Username')}</td> |
|
23 | 20 | <td>${h.text('username')}</td> |
|
24 | 21 | <td>${self.get_form_error('username')}</td> |
|
25 | 22 | </tr> |
|
26 | 23 | <tr> |
|
27 | 24 | <td>${_('Password')}</td> |
|
28 | 25 | <td>${h.password('password')}</td> |
|
29 | 26 | <td>${self.get_form_error('password')}</td> |
|
30 | 27 | </tr> |
|
31 | 28 | <tr> |
|
32 | 29 | <td></td> |
|
33 | 30 | <td>${h.submit('login','login')}</td> |
|
34 | 31 | </tr> |
|
35 | 32 | </table> |
|
36 | 33 | ${h.end_form()} |
|
37 | 34 | </div> |
|
38 | 35 | </%def> |
|
39 | 36 | |
|
40 | 37 |
@@ -1,62 +1,64 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | <%! | |
|
3 | from pylons_app.lib import filters | |
|
4 | %> | |
|
2 | % if c.repo_changesets: | |
|
3 | ||
|
5 | 4 | <table class="table_disp"> |
|
6 | 5 | <tr class="header"> |
|
7 | 6 | <td>${_('date')}</td> |
|
8 | 7 | <td>${_('author')}</td> |
|
9 | 8 | <td>${_('revision')}</td> |
|
10 | 9 | <td>${_('commit message')}</td> |
|
11 | 10 | <td>${_('branch')}</td> |
|
12 | 11 | <td>${_('tags')}</td> |
|
13 | 12 | <td>${_('links')}</td> |
|
14 | 13 | |
|
15 | 14 | </tr> |
|
16 | 15 | %for cnt,cs in enumerate(c.repo_changesets): |
|
17 | 16 | <tr class="parity${cnt%2}"> |
|
18 |
<td>${cs._ctx.date() |
|
|
19 |
<td title="${cs.author}">${cs.author |
|
|
17 | <td>${h.age(cs._ctx.date())}</td> | |
|
18 | <td title="${cs.author}">${h.person(cs.author)}</td> | |
|
20 | 19 | <td>r${cs.revision}:${cs.raw_id}</td> |
|
21 | 20 | <td> |
|
22 | 21 | ${h.link_to(h.truncate(cs.message,60), |
|
23 | 22 | h.url('changeset_home',repo_name=c.repo_name,revision=cs._short), |
|
24 | 23 | title=cs.message)} |
|
25 | 24 | </td> |
|
26 | 25 | <td> |
|
27 | 26 | <span class="logtags"> |
|
28 | 27 | <span class="branchtag">${cs.branch}</span> |
|
29 | 28 | </span> |
|
30 | 29 | </td> |
|
31 | 30 | <td> |
|
32 | 31 | <span class="logtags"> |
|
33 | 32 | %for tag in cs.tags: |
|
34 | 33 | <span class="tagtag">${tag}</span> |
|
35 | 34 | %endfor |
|
36 | 35 | </span> |
|
37 | 36 | </td> |
|
38 | 37 | <td class="nowrap"> |
|
39 | 38 | ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} |
|
40 | 39 | | |
|
41 | 40 | ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} |
|
42 | 41 | </td> |
|
43 | 42 | </tr> |
|
44 | 43 | %endfor |
|
45 | 44 | |
|
46 | 45 | </table> |
|
47 | 46 | <div> |
|
48 | 47 | <script type="text/javascript"> |
|
49 | 48 | var data_div = 'shortlog_data'; |
|
50 | 49 | YAHOO.util.Event.onDOMReady(function(){ |
|
51 | 50 | YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName('pager_link'),"click",function(){ |
|
52 | 51 | YAHOO.util.Dom.setStyle('shortlog_data','opacity','0.3');});}); |
|
53 | 52 | </script> |
|
54 | 53 | <h2> |
|
55 | 54 | ${c.repo_changesets.pager('$link_previous ~2~ $link_next', |
|
56 | 55 | onclick="""YAHOO.util.Connect.asyncRequest('GET','$partial_url',{ |
|
57 | 56 | success:function(o){YAHOO.util.Dom.get(data_div).innerHTML=o.responseText; |
|
58 | 57 | YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName('pager_link'),"click",function(){ |
|
59 | 58 | YAHOO.util.Dom.setStyle(data_div,'opacity','0.3');}); |
|
60 | 59 | YAHOO.util.Dom.setStyle(data_div,'opacity','1');}},null); return false;""")} |
|
61 | 60 | </h2> |
|
62 | </div> No newline at end of file | |
|
61 | </div> | |
|
62 | %else: | |
|
63 | ${_('There are no commits yet')} | |
|
64 | %endif No newline at end of file |
@@ -1,162 +1,71 b'' | |||
|
1 | 1 | <%inherit file="/base/base.html"/> |
|
2 | <%! | |
|
3 | from pylons_app.lib import filters | |
|
4 | %> | |
|
5 | 2 | <%def name="title()"> |
|
6 | 3 | ${_('Repository managment')} |
|
7 | 4 | </%def> |
|
8 | 5 | <%def name="breadcrumbs()"> |
|
9 | 6 | ${h.link_to(u'Home',h.url('/'))} |
|
10 | 7 | / |
|
11 | 8 | ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))} |
|
12 | 9 | / |
|
13 | 10 | ${_('summary')} |
|
14 | 11 | </%def> |
|
15 | 12 | <%def name="page_nav()"> |
|
16 | 13 | ${self.menu('summary')} |
|
17 | 14 | </%def> |
|
18 | 15 | |
|
19 | 16 | <%def name="js()"> |
|
20 | 17 | <script type="text/javascript" src="/js/yui/utilities/utilities.js"></script> |
|
21 | 18 | <script type="text/javascript"> |
|
22 | 19 | var E = YAHOO.util.Event; |
|
23 | 20 | var D = YAHOO.util.Dom; |
|
24 | 21 | |
|
25 | 22 | E.onDOMReady(function(e){ |
|
26 | 23 | id = 'clone_url'; |
|
27 | 24 | E.addListener(id,'click',function(e){ |
|
28 | 25 | D.get('clone_url').select(); |
|
29 | 26 | }) |
|
30 | 27 | }) |
|
31 | 28 | </script> |
|
32 | 29 | </%def> |
|
33 | 30 | |
|
34 | 31 | <%def name="main()"> |
|
35 | 32 | <h2 class="no-link no-border">${_('Mercurial Repository Overview')}</h2> |
|
36 | 33 | <dl class="overview"> |
|
37 | 34 | <dt>${_('name')}</dt> |
|
38 | 35 | <dd>${c.repo_info.name}</dd> |
|
39 | 36 | <dt>${_('description')}</dt> |
|
40 | 37 | <dd>${c.repo_info.description}</dd> |
|
41 | 38 | <dt>${_('contact')}</dt> |
|
42 | 39 | <dd>${c.repo_info.contact}</dd> |
|
43 | 40 | <dt>${_('last change')}</dt> |
|
44 |
<dd>${c.repo_info.last_change |
|
|
41 | <dd>${h.age(c.repo_info.last_change)} - ${h.rfc822date(c.repo_info.last_change)}</dd> | |
|
45 | 42 | <dt>${_('clone url')}</dt> |
|
46 | 43 | <dd><input type="text" id="clone_url" readonly="readonly" value="hg clone ${c.clone_repo_url}" size="70"/></dd> |
|
47 | 44 | <dt>${_('download')}</dt> |
|
48 | 45 | <dd> |
|
49 | 46 | %for cnt,archive in enumerate(c.repo_info._get_archives()): |
|
50 | 47 | %if cnt >=1: |
|
51 | 48 | | |
|
52 | 49 | %endif |
|
53 | 50 | ${h.link_to(c.repo_info.name+'.'+archive['type'], |
|
54 | 51 | h.url('files_archive_home',repo_name=c.repo_info.name, |
|
55 | 52 | revision='tip',fileformat=archive['extension']),class_="archive_logo")} |
|
56 | 53 | %endfor |
|
57 | 54 | </dd> |
|
58 | 55 | <dt>${_('feeds')}</dt> |
|
59 | 56 | <dd> |
|
60 | 57 | ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.repo_info.name),class_='rss_logo')} |
|
61 | 58 | ${h.link_to(_('Atom'),h.url('atom_feed_home',repo_name=c.repo_info.name),class_='atom_logo')} |
|
62 | 59 | </dd> |
|
63 | 60 | </dl> |
|
64 | 61 | |
|
65 | 62 | <h2>${h.link_to(_('Last ten changes'),h.url('changelog_home',repo_name=c.repo_name))}</h2> |
|
66 | <table class="table_disp"> | |
|
67 | <tr class="header"> | |
|
68 | <td>${_('date')}</td> | |
|
69 | <td>${_('author')}</td> | |
|
70 | <td>${_('revision')}</td> | |
|
71 | <td>${_('commit message')}</td> | |
|
72 | <td>${_('branch')}</td> | |
|
73 | <td>${_('tags')}</td> | |
|
74 | <td>${_('links')}</td> | |
|
75 | ||
|
76 | </tr> | |
|
77 | %for cnt,cs in enumerate(c.repo_changesets): | |
|
78 | <tr class="parity${cnt%2}"> | |
|
79 | <td>${cs._ctx.date()|n,filters.age}</td> | |
|
80 | <td>${cs.author|n,filters.person}</td> | |
|
81 | <td>r${cs.revision}:${cs.raw_id}</td> | |
|
82 | <td> | |
|
83 | ${h.link_to(h.truncate(cs.message,60), | |
|
84 | h.url('changeset_home',repo_name=c.repo_name,revision=cs._short), | |
|
85 | title=cs.message)} | |
|
86 | </td> | |
|
87 | <td> | |
|
88 | <span class="logtags"> | |
|
89 | <span class="branchtag">${cs.branch}</span> | |
|
90 | </span> | |
|
91 | </td> | |
|
92 | <td> | |
|
93 | <span class="logtags"> | |
|
94 | %for tag in cs.tags: | |
|
95 | <span class="tagtag">${tag}</span> | |
|
96 | %endfor | |
|
97 | </span> | |
|
98 | </td> | |
|
99 | <td class="nowrap"> | |
|
100 | ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=cs._short))} | |
|
101 | | | |
|
102 | ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=cs._short))} | |
|
103 | </td> | |
|
104 | </tr> | |
|
105 | %endfor | |
|
106 | </table> | |
|
63 | <%include file='../shortlog/shortlog_data.html'/> | |
|
107 | 64 | |
|
108 | 65 | <h2>${h.link_to(_('Last ten tags'),h.url('tags_home',repo_name=c.repo_name))}</h2> |
|
109 | <table class="table_disp"> | |
|
110 | <tr class="header"> | |
|
111 | <td>${_('date')}</td> | |
|
112 | <td>${_('revision')}</td> | |
|
113 | <td>${_('name')}</td> | |
|
114 | <td>${_('links')}</td> | |
|
115 | </tr> | |
|
116 | %for cnt,tag in enumerate(c.repo_tags.items()): | |
|
117 | <tr class="parity${cnt%2}"> | |
|
118 | <td>${tag[1]._ctx.date()|n,filters.age}</td> | |
|
119 | <td>r${tag[1].revision}:${tag[1].raw_id}</td> | |
|
120 | <td> | |
|
121 | <span class="logtags"> | |
|
122 | <span class="tagtag">${h.link_to(tag[0], | |
|
123 | h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}</span> | |
|
124 | </span> | |
|
125 | </td> | |
|
126 | <td class="nowrap"> | |
|
127 | ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))} | |
|
128 | | | |
|
129 | ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag[1].raw_id))} | |
|
130 | </td> | |
|
131 | </tr> | |
|
132 | %endfor | |
|
133 | </table> | |
|
66 | <%include file='../tags/tags_data.html'/> | |
|
134 | 67 | |
|
135 | 68 | <h2>${h.link_to(_('Last ten branches'),h.url('branches_home',repo_name=c.repo_name))}</h2> |
|
136 | <table class="table_disp"> | |
|
137 | <tr class="header"> | |
|
138 | <td>${_('date')}</td> | |
|
139 | <td>${_('revision')}</td> | |
|
140 | <td>${_('name')}</td> | |
|
141 | <td>${_('links')}</td> | |
|
142 | </tr> | |
|
143 | %for cnt,branch in enumerate(c.repo_branches.items()): | |
|
144 | <tr class="parity${cnt%2}"> | |
|
145 | <td>${branch[1]._ctx.date()|n,filters.age}</td> | |
|
146 | <td>r${branch[1].revision}:${branch[1].raw_id}</td> | |
|
147 | <td> | |
|
148 | <span class="logtags"> | |
|
149 | <span class="branchtag">${h.link_to(branch[0], | |
|
150 | h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}</span> | |
|
151 | </span> | |
|
152 | </td> | |
|
153 | <td class="nowrap"> | |
|
154 | ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))} | |
|
155 | | | |
|
156 | ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id))} | |
|
157 | </td> | |
|
158 | </tr> | |
|
159 | %endfor | |
|
160 | </table> | |
|
69 | <%include file='../branches/branches_data.html'/> | |
|
161 | 70 | |
|
162 | 71 | </%def> No newline at end of file |
@@ -1,47 +1,20 b'' | |||
|
1 | 1 | <%inherit file="/base/base.html"/> |
|
2 | <%! | |
|
3 | from pylons_app.lib import filters | |
|
4 | %> | |
|
5 | 2 | <%def name="title()"> |
|
6 | 3 | ${_('Tags')} |
|
7 | 4 | </%def> |
|
8 | 5 | <%def name="breadcrumbs()"> |
|
9 | 6 | ${h.link_to(u'Home',h.url('/'))} |
|
10 | 7 | / |
|
11 | 8 | ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))} |
|
12 | 9 | / |
|
13 | 10 | ${_('tags')} |
|
14 | 11 | </%def> |
|
15 | 12 | <%def name="page_nav()"> |
|
16 | 13 | ${self.menu('tags')} |
|
17 | 14 | </%def> |
|
18 | 15 | <%def name="main()"> |
|
19 | 16 | |
|
20 | 17 | <h2 class="no-link no-border">${_('Tags')}</h2> |
|
21 | <table class="table_disp"> | |
|
22 | <tr class="header"> | |
|
23 | <td>${_('date')}</td> | |
|
24 | <td>${_('revision')}</td> | |
|
25 | <td>${_('name')}</td> | |
|
26 | <td>${_('links')}</td> | |
|
27 | </tr> | |
|
28 | %for cnt,tag in enumerate(c.repo_tags.items()): | |
|
29 | <tr class="parity${cnt%2}"> | |
|
30 | <td>${tag[1]._ctx.date()|n,filters.age}</td> | |
|
31 | <td>r${tag[1].revision}:${tag[1].raw_id}</td> | |
|
32 | <td> | |
|
33 | <span class="logtags"> | |
|
34 | <span class="tagtag">${h.link_to(tag[0], | |
|
35 | h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}</span> | |
|
36 | </span> | |
|
37 | </td> | |
|
38 | <td class="nowrap"> | |
|
39 | ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))} | |
|
40 | | | |
|
41 | ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag[1].raw_id))} | |
|
42 | </td> | |
|
43 | </tr> | |
|
44 | %endfor | |
|
45 | </table> | |
|
18 | <%include file='tags_data.html'/> | |
|
46 | 19 | |
|
47 | 20 | </%def> No newline at end of file |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now