Show More
@@ -1,111 +1,111 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | ## usage: |
|
2 | ## usage: | |
3 | ## <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> |
|
3 | ## <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> | |
4 | ## ${comment.comment_block(co)} |
|
4 | ## ${comment.comment_block(co)} | |
5 | ## |
|
5 | ## | |
6 | <%def name="comment_block(co)"> |
|
6 | <%def name="comment_block(co)"> | |
7 | <div class="comment" id="comment-${co.comment_id}"> |
|
7 | <div class="comment" id="comment-${co.comment_id}"> | |
8 | <div class="comment-wrapp"> |
|
8 | <div class="comment-wrapp"> | |
9 | <div class="meta"> |
|
9 | <div class="meta"> | |
10 | <span class="user"> |
|
10 | <span class="user"> | |
11 | <img src="${h.gravatar_url(co.author.email, 20)}" /> |
|
11 | <img src="${h.gravatar_url(co.author.email, 20)}" /> | |
12 | ${co.author.username} |
|
12 | ${co.author.username} | |
13 | </span> |
|
13 | </span> | |
14 | <a href="${h.url.current(anchor='comment-%s' % co.comment_id)}"> ${_('commented on')} </a> |
|
14 | <a href="${h.url.current(anchor='comment-%s' % co.comment_id)}"> ${_('commented on')} </a> | |
15 | ${h.short_id(co.revision)} |
|
15 | ${h.short_id(co.revision)} | |
16 | %if co.f_path: |
|
16 | %if co.f_path: | |
17 | ${_(' in file ')} |
|
17 | ${_(' in file ')} | |
18 | ${co.f_path}:L ${co.line_no} |
|
18 | ${co.f_path}:L ${co.line_no} | |
19 | %endif |
|
19 | %endif | |
20 | <span class="date"> |
|
20 | <span class="date"> | |
21 | ${h.age(co.modified_at)} |
|
21 | ${h.age(co.modified_at)} | |
22 | </span> |
|
22 | </span> | |
23 | </div> |
|
23 | </div> | |
24 | <div class="text"> |
|
24 | <div class="text"> | |
25 | %if h.HasPermissionAny('hg.admin', 'repository.admin')() or co.author.user_id == c.rhodecode_user.user_id: |
|
25 | %if h.HasPermissionAny('hg.admin', 'repository.admin')() or co.author.user_id == c.rhodecode_user.user_id: | |
26 | <div class="buttons"> |
|
26 | <div class="buttons"> | |
27 | <span onClick="deleteComment(${co.comment_id})" class="delete-comment ui-btn">${_('Delete')}</span> |
|
27 | <span onClick="deleteComment(${co.comment_id})" class="delete-comment ui-btn">${_('Delete')}</span> | |
28 | </div> |
|
28 | </div> | |
29 | %endif |
|
29 | %endif | |
30 | ${h.rst_w_mentions(co.text)|n} |
|
30 | ${h.rst_w_mentions(co.text)|n} | |
31 | </div> |
|
31 | </div> | |
32 | </div> |
|
32 | </div> | |
33 | </div> |
|
33 | </div> | |
34 | </%def> |
|
34 | </%def> | |
35 |
|
35 | |||
36 |
|
36 | |||
37 | <%def name="comment_inline_form(changeset)"> |
|
37 | <%def name="comment_inline_form(changeset)"> | |
38 | <div id='comment-inline-form-template' style="display:none"> |
|
38 | <div id='comment-inline-form-template' style="display:none"> | |
39 | <div class="comment-inline-form"> |
|
39 | <div class="comment-inline-form"> | |
40 | %if c.rhodecode_user.username != 'default': |
|
40 | %if c.rhodecode_user.username != 'default': | |
41 | ${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=changeset.raw_id))} |
|
41 | ${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=changeset.raw_id))} | |
42 | <div class="clearfix"> |
|
42 | <div class="clearfix"> | |
43 | <div class="comment-help">${_('Commenting on line')} {1}. ${_('Comments parsed using')} |
|
43 | <div class="comment-help">${_('Commenting on line')} {1}. ${_('Comments parsed using')} | |
44 | <a href="${h.url('rst_help')}">RST</a> ${_('syntax')} ${_('with')} |
|
44 | <a href="${h.url('rst_help')}">RST</a> ${_('syntax')} ${_('with')} | |
45 | <span style="color:#003367" class="tooltip" title="${_('Use @username inside this text to send notification to this RhodeCode user')}">@mention</span> ${_('support')} |
|
45 | <span style="color:#003367" class="tooltip" title="${_('Use @username inside this text to send notification to this RhodeCode user')}">@mention</span> ${_('support')} | |
46 | </div> |
|
46 | </div> | |
47 | <textarea id="text_{1}" name="text"></textarea> |
|
47 | <textarea id="text_{1}" name="text"></textarea> | |
48 | </div> |
|
48 | </div> | |
49 | <div class="comment-button"> |
|
49 | <div class="comment-button"> | |
50 | <input type="hidden" name="f_path" value="{0}"> |
|
50 | <input type="hidden" name="f_path" value="{0}"> | |
51 | <input type="hidden" name="line" value="{1}"> |
|
51 | <input type="hidden" name="line" value="{1}"> | |
52 | ${h.submit('save', _('Comment'), class_='ui-btn')} |
|
52 | ${h.submit('save', _('Comment'), class_='ui-btn')} | |
53 | ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')} |
|
53 | ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')} | |
54 | </div> |
|
54 | </div> | |
55 | ${h.end_form()} |
|
55 | ${h.end_form()} | |
56 | %else: |
|
56 | %else: | |
57 | ${h.form('')} |
|
57 | ${h.form('')} | |
58 | <div class="clearfix"> |
|
58 | <div class="clearfix"> | |
59 | <div class="comment-help"> |
|
59 | <div class="comment-help"> | |
60 | ${'You need to be logged in to comment.'} <a href="${h.url('login_home',came_from=h.url.current())}">${_('Login now')}</a> |
|
60 | ${'You need to be logged in to comment.'} <a href="${h.url('login_home',came_from=h.url.current())}">${_('Login now')}</a> | |
61 | </div> |
|
61 | </div> | |
62 | </div> |
|
62 | </div> | |
63 | <div class="comment-button"> |
|
63 | <div class="comment-button"> | |
64 | ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')} |
|
64 | ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')} | |
65 | </div> |
|
65 | </div> | |
66 | ${h.end_form()} |
|
66 | ${h.end_form()} | |
67 | %endif |
|
67 | %endif | |
68 | </div> |
|
68 | </div> | |
69 | </div> |
|
69 | </div> | |
70 | </%def> |
|
70 | </%def> | |
71 |
|
71 | |||
72 |
|
72 | |||
73 | <%def name="comments(changeset)"> |
|
73 | <%def name="comments(changeset)"> | |
74 |
|
74 | |||
75 | <div class="comments"> |
|
75 | <div class="comments"> | |
76 | <div class="comments-number">${len(c.comments)} comment(s) (${c.inline_cnt} ${_('inline')})</div> |
|
76 | <div class="comments-number">${len(c.comments)} comment(s) (${c.inline_cnt} ${_('inline')})</div> | |
77 |
|
77 | |||
78 | %for path, lines in c.inline_comments: |
|
78 | %for path, lines in c.inline_comments: | |
79 | <div style="display:none" class="inline-comment-placeholder" path="${path}" target_id="${h.FID(changeset.raw_id,path)}"> |
|
79 | <div style="display:none" class="inline-comment-placeholder" path="${path}" target_id="${h.FID(changeset.raw_id,path)}"> | |
80 | % for line,comments in lines.iteritems(): |
|
80 | % for line,comments in lines.iteritems(): | |
81 | <div class="inline-comment-placeholder-line" line="${line}" target_id="${h.safeid(h.safe_unicode(path))}"> |
|
81 | <div class="inline-comment-placeholder-line" line="${line}" target_id="${h.safeid(h.safe_unicode(path))}"> | |
82 | %for co in comments: |
|
82 | %for co in comments: | |
83 | ${comment_block(co)} |
|
83 | ${comment_block(co)} | |
84 | %endfor |
|
84 | %endfor | |
85 | </div> |
|
85 | </div> | |
86 | %endfor |
|
86 | %endfor | |
87 | </div> |
|
87 | </div> | |
88 | %endfor |
|
88 | %endfor | |
89 |
|
89 | |||
90 | %for co in c.comments: |
|
90 | %for co in c.comments: | |
91 |
${comment |
|
91 | ${comment_block(co)} | |
92 | %endfor |
|
92 | %endfor | |
93 | %if c.rhodecode_user.username != 'default': |
|
93 | %if c.rhodecode_user.username != 'default': | |
94 | <div class="comment-form"> |
|
94 | <div class="comment-form"> | |
95 | ${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=changeset.raw_id))} |
|
95 | ${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=changeset.raw_id))} | |
96 | <strong>${_('Leave a comment')}</strong> |
|
96 | <strong>${_('Leave a comment')}</strong> | |
97 | <div class="clearfix"> |
|
97 | <div class="clearfix"> | |
98 | <div class="comment-help"> |
|
98 | <div class="comment-help"> | |
99 | ${_('Comments parsed using')} <a href="${h.url('rst_help')}">RST</a> ${_('syntax')} |
|
99 | ${_('Comments parsed using')} <a href="${h.url('rst_help')}">RST</a> ${_('syntax')} | |
100 | ${_('with')} <span style="color:#003367" class="tooltip" title="${_('Use @username inside this text to send notification to this RhodeCode user')}">@mention</span> ${_('support')} |
|
100 | ${_('with')} <span style="color:#003367" class="tooltip" title="${_('Use @username inside this text to send notification to this RhodeCode user')}">@mention</span> ${_('support')} | |
101 | </div> |
|
101 | </div> | |
102 | ${h.textarea('text')} |
|
102 | ${h.textarea('text')} | |
103 | </div> |
|
103 | </div> | |
104 | <div class="comment-button"> |
|
104 | <div class="comment-button"> | |
105 | ${h.submit('save', _('Comment'), class_='ui-button')} |
|
105 | ${h.submit('save', _('Comment'), class_='ui-button')} | |
106 | </div> |
|
106 | </div> | |
107 | ${h.end_form()} |
|
107 | ${h.end_form()} | |
108 | </div> |
|
108 | </div> | |
109 | %endif |
|
109 | %endif | |
110 | </div> |
|
110 | </div> | |
111 | </%def> |
|
111 | </%def> |
@@ -1,18 +1,17 b'' | |||||
1 | from rhodecode.tests import * |
|
1 | from rhodecode.tests import * | |
2 |
|
2 | |||
3 | class TestBranchesController(TestController): |
|
3 | class TestBranchesController(TestController): | |
4 |
|
4 | |||
5 | def test_index(self): |
|
5 | def test_index(self): | |
6 | self.log_user() |
|
6 | self.log_user() | |
7 | response = self.app.get(url(controller='branches', |
|
7 | response = self.app.get(url(controller='branches', | |
8 | action='index', repo_name=HG_REPO)) |
|
8 | action='index', repo_name=HG_REPO)) | |
9 |
|
9 | response.mustcontain("""<a href="/%s/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/">default</a>""" % HG_REPO) | ||
10 | self.assertTrue("""<a href="/%s/changeset/27cd5cce30c96924232dffcd24178a07ffeb5dfc">default</a>""" % HG_REPO in response.body) |
|
10 | response.mustcontain("""<a href="/%s/files/97e8b885c04894463c51898e14387d80c30ed1ee/">git</a>""" % HG_REPO) | |
11 | self.assertTrue("""<a href="/%s/changeset/97e8b885c04894463c51898e14387d80c30ed1ee">git</a>""" % HG_REPO in response.body) |
|
11 | response.mustcontain("""<a href="/%s/files/2e6a2bf9356ca56df08807f4ad86d480da72a8f4/">web</a>""" % HG_REPO) | |
12 | self.assertTrue("""<a href="/%s/changeset/2e6a2bf9356ca56df08807f4ad86d480da72a8f4">web</a>""" % HG_REPO in response.body) |
|
|||
13 |
|
12 | |||
14 |
|
13 | |||
15 |
|
14 | |||
16 |
|
15 | |||
17 |
|
16 | |||
18 |
|
17 |
@@ -1,22 +1,22 b'' | |||||
1 | from rhodecode.tests import * |
|
1 | from rhodecode.tests import * | |
2 |
|
2 | |||
|
3 | ||||
3 | class TestHomeController(TestController): |
|
4 | class TestHomeController(TestController): | |
4 |
|
5 | |||
5 | def test_index(self): |
|
6 | def test_index(self): | |
6 | self.log_user() |
|
7 | self.log_user() | |
7 | response = self.app.get(url(controller='home', action='index')) |
|
8 | response = self.app.get(url(controller='home', action='index')) | |
8 | #if global permission is set |
|
9 | #if global permission is set | |
9 | self.assertTrue('ADD NEW REPOSITORY' in response.body) |
|
10 | response.mustcontain('ADD REPOSITORY') | |
10 |
se |
|
11 | response.mustcontain('href="/%s/summary"' % HG_REPO) | |
11 | # Test response... |
|
|||
12 |
|
12 | |||
13 |
se |
|
13 | response.mustcontain("""<img class="icon" title="Mercurial repository" """ | |
14 | """alt="Mercurial repository" src="/images/icons/hg""" |
|
14 | """alt="Mercurial repository" src="/images/icons/hg""" | |
15 |
"""icon.png"/>""" |
|
15 | """icon.png"/>""") | |
16 |
se |
|
16 | response.mustcontain("""<img class="icon" title="public repository" """ | |
17 | """alt="public repository" src="/images/icons/lock_""" |
|
17 | """alt="public repository" src="/images/icons/lock_""" | |
18 |
"""open.png"/>""" |
|
18 | """open.png"/>""") | |
19 |
|
19 | |||
20 | self.assertTrue("""<a title="Marcin Kuzminski <marcin@python-works.com> |
|
20 | response.mustcontain( | |
21 | merge" class="tooltip" href="/vcs_test_hg/changeset/27cd5cce30c96924232dffcd24178a07ffeb5dfc">r173:27cd5cce30c9</a>""" |
|
21 | """<a title="Marcin Kuzminski <marcin@python-works.com>:\n | |
22 | in response.body) |
|
22 | merge" class="tooltip" href="/vcs_test_hg/changeset/27cd5cce30c96924232dffcd24178a07ffeb5dfc">r173:27cd5cce30c9</a>""") |
@@ -1,13 +1,13 b'' | |||||
1 | from rhodecode.tests import * |
|
1 | from rhodecode.tests import * | |
2 |
|
2 | |||
3 | class TestTagsController(TestController): |
|
3 | class TestTagsController(TestController): | |
4 |
|
4 | |||
5 | def test_index(self): |
|
5 | def test_index(self): | |
6 | self.log_user() |
|
6 | self.log_user() | |
7 | response = self.app.get(url(controller='tags', action='index', repo_name=HG_REPO)) |
|
7 | response = self.app.get(url(controller='tags', action='index', repo_name=HG_REPO)) | |
8 |
|
|
8 | response.mustcontain("""<a href="/%s/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/">tip</a>""" % HG_REPO) | |
9 |
|
|
9 | response.mustcontain("""<a href="/%s/files/fd4bdb5e9b2a29b4393a4ac6caef48c17ee1a200/">0.1.4</a>""" % HG_REPO) | |
10 |
|
|
10 | response.mustcontain("""<a href="/%s/files/17544fbfcd33ffb439e2b728b5d526b1ef30bfcf/">0.1.3</a>""" % HG_REPO) | |
11 |
|
|
11 | response.mustcontain("""<a href="/%s/files/a7e60bff65d57ac3a1a1ce3b12a70f8a9e8a7720/">0.1.2</a>""" % HG_REPO) | |
12 |
|
|
12 | response.mustcontain("""<a href="/%s/files/eb3a60fc964309c1a318b8dfe26aa2d1586c85ae/">0.1.1</a>""" % HG_REPO) | |
13 | # Test response... |
|
13 |
General Comments 0
You need to be logged in to leave comments.
Login now