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