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