##// END OF EJS Templates
small UI changes for pull-request view
marcink -
r2482:1fd3c043 beta
parent child Browse files
Show More
@@ -1,155 +1,154 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}" line="${co.line_no}">
7 <div class="comment" id="comment-${co.comment_id}" line="${co.line_no}">
8 <div class="comment-wrapp">
8 <div class="comment-wrapp">
9 <div class="meta">
9 <div class="meta">
10 <div style="float:left"> <img src="${h.gravatar_url(co.author.email, 20)}" /> </div>
10 <div style="float:left"> <img src="${h.gravatar_url(co.author.email, 20)}" /> </div>
11 <div class="user">
11 <div class="user">
12 ${co.author.username}
12 ${co.author.username}
13 </div>
13 </div>
14 <div class="date">
14 <div class="date">
15 ${h.age(co.modified_at)}
15 ${h.age(co.modified_at)}
16 </div>
16 </div>
17 %if co.status_change:
17 %if co.status_change:
18 <div style="float:left" class="changeset-status-container">
18 <div style="float:left" class="changeset-status-container">
19 <div style="float:left;padding:0px 2px 0px 2px"><span style="font-size: 18px;">&rsaquo;</span></div>
19 <div style="float:left;padding:0px 2px 0px 2px"><span style="font-size: 18px;">&rsaquo;</span></div>
20 <div title="${_('Changeset status')}" class="changeset-status-lbl"> ${co.status_change.status_lbl}</div>
20 <div title="${_('Changeset status')}" class="changeset-status-lbl"> ${co.status_change.status_lbl}</div>
21 <div class="changeset-status-ico"><img src="${h.url(str('/images/icons/flag_status_%s.png' % co.status_change.status))}" /></div>
21 <div class="changeset-status-ico"><img src="${h.url(str('/images/icons/flag_status_%s.png' % co.status_change.status))}" /></div>
22 </div>
22 </div>
23 %endif
23 %endif
24 %if h.HasPermissionAny('hg.admin', 'repository.admin')() or co.author.user_id == c.rhodecode_user.user_id:
24 %if h.HasPermissionAny('hg.admin', 'repository.admin')() or co.author.user_id == c.rhodecode_user.user_id:
25 <div class="buttons">
25 <div class="buttons">
26 <span onClick="deleteComment(${co.comment_id})" class="delete-comment ui-btn">${_('Delete')}</span>
26 <span onClick="deleteComment(${co.comment_id})" class="delete-comment ui-btn">${_('Delete')}</span>
27 </div>
27 </div>
28 %endif
28 %endif
29 </div>
29 </div>
30 <div class="text">
30 <div class="text">
31 ${h.rst_w_mentions(co.text)|n}
31 ${h.rst_w_mentions(co.text)|n}
32 </div>
32 </div>
33 </div>
33 </div>
34 </div>
34 </div>
35 </%def>
35 </%def>
36
36
37
37
38 <%def name="comment_inline_form(changeset)">
38 <%def name="comment_inline_form(changeset)">
39 <div id='comment-inline-form-template' style="display:none">
39 <div id='comment-inline-form-template' style="display:none">
40 <div class="comment-inline-form ac">
40 <div class="comment-inline-form ac">
41 %if c.rhodecode_user.username != 'default':
41 %if c.rhodecode_user.username != 'default':
42 <div class="overlay"><div class="overlay-text">${_('Submitting...')}</div></div>
42 <div class="overlay"><div class="overlay-text">${_('Submitting...')}</div></div>
43 ${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=changeset.raw_id),class_='inline-form')}
43 ${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=changeset.raw_id),class_='inline-form')}
44 <div class="clearfix">
44 <div class="clearfix">
45 <div class="comment-help">${_('Commenting on line {1}.')}
45 <div class="comment-help">${_('Commenting on line {1}.')}
46 ${(_('Comments parsed using %s syntax with %s support.') % (
46 ${(_('Comments parsed using %s syntax with %s support.') % (
47 ('<a href="%s">RST</a>' % h.url('rst_help')),
47 ('<a href="%s">RST</a>' % h.url('rst_help')),
48 ('<span style="color:#003367" class="tooltip" title="%s">@mention</span>' % _('Use @username inside this text to send notification to this RhodeCode user'))
48 ('<span style="color:#003367" class="tooltip" title="%s">@mention</span>' % _('Use @username inside this text to send notification to this RhodeCode user'))
49 )
49 )
50 )|n
50 )|n
51 }
51 }
52 </div>
52 </div>
53 <div class="mentions-container" id="mentions_container_{1}"></div>
53 <div class="mentions-container" id="mentions_container_{1}"></div>
54 <textarea id="text_{1}" name="text" class="yui-ac-input"></textarea>
54 <textarea id="text_{1}" name="text" class="yui-ac-input"></textarea>
55 </div>
55 </div>
56 <div class="comment-button">
56 <div class="comment-button">
57 <input type="hidden" name="f_path" value="{0}">
57 <input type="hidden" name="f_path" value="{0}">
58 <input type="hidden" name="line" value="{1}">
58 <input type="hidden" name="line" value="{1}">
59 ${h.submit('save', _('Comment'), class_='ui-btn save-inline-form')}
59 ${h.submit('save', _('Comment'), class_='ui-btn save-inline-form')}
60 ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')}
60 ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')}
61 </div>
61 </div>
62 ${h.end_form()}
62 ${h.end_form()}
63 %else:
63 %else:
64 ${h.form('')}
64 ${h.form('')}
65 <div class="clearfix">
65 <div class="clearfix">
66 <div class="comment-help">
66 <div class="comment-help">
67 ${_('You need to be logged in to comment.')} <a href="${h.url('login_home',came_from=h.url.current())}">${_('Login now')}</a>
67 ${_('You need to be logged in to comment.')} <a href="${h.url('login_home',came_from=h.url.current())}">${_('Login now')}</a>
68 </div>
68 </div>
69 </div>
69 </div>
70 <div class="comment-button">
70 <div class="comment-button">
71 ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')}
71 ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')}
72 </div>
72 </div>
73 ${h.end_form()}
73 ${h.end_form()}
74 %endif
74 %endif
75 </div>
75 </div>
76 </div>
76 </div>
77 </%def>
77 </%def>
78
78
79
79
80 ## generates inlines taken from c.comments var
80 ## generates inlines taken from c.comments var
81 <%def name="inlines()">
81 <%def name="inlines()">
82 <div class="comments-number">${ungettext("%d comment", "%d comments", len(c.comments)) % len(c.comments)} ${ungettext("(%d inline)", "(%d inline)", c.inline_cnt) % c.inline_cnt}</div>
82 <div class="comments-number">${ungettext("%d comment", "%d comments", len(c.comments)) % len(c.comments)} ${ungettext("(%d inline)", "(%d inline)", c.inline_cnt) % c.inline_cnt}</div>
83 %for path, lines in c.inline_comments:
83 %for path, lines in c.inline_comments:
84 % for line,comments in lines.iteritems():
84 % for line,comments in lines.iteritems():
85 <div style="display:none" class="inline-comment-placeholder" path="${path}" target_id="${h.safeid(h.safe_unicode(path))}">
85 <div style="display:none" class="inline-comment-placeholder" path="${path}" target_id="${h.safeid(h.safe_unicode(path))}">
86 %for co in comments:
86 %for co in comments:
87 ${comment_block(co)}
87 ${comment_block(co)}
88 %endfor
88 %endfor
89 </div>
89 </div>
90 %endfor
90 %endfor
91 %endfor
91 %endfor
92
92
93 </%def>
93 </%def>
94
94
95 ## MAIN COMMENT FORM
95 ## MAIN COMMENT FORM
96 <%def name="comments(post_url, cur_status)">
96 <%def name="comments(post_url, cur_status)">
97
97
98 <div class="comments">
98 <div class="comments">
99 <div id="inline-comments-container">
99 <div id="inline-comments-container">
100 ## generate inlines for this changeset
100 ## generate inlines for this changeset
101 ${inlines()}
101 ${inlines()}
102 </div>
102 </div>
103
103
104 %for co in c.comments:
104 %for co in c.comments:
105 <div id="comment-tr-${co.comment_id}">
105 <div id="comment-tr-${co.comment_id}">
106 ${comment_block(co)}
106 ${comment_block(co)}
107 </div>
107 </div>
108 %endfor
108 %endfor
109 %if c.rhodecode_user.username != 'default':
109 %if c.rhodecode_user.username != 'default':
110 <div class="comment-form ac">
110 <div class="comment-form ac">
111 ${h.form(post_url)}
111 ${h.form(post_url)}
112 <strong>${_('Leave a comment')}</strong>
112 <strong>${_('Leave a comment')}</strong>
113 <div class="clearfix">
113 <div class="clearfix">
114 <div class="comment-help">
114 <div class="comment-help">
115 ${(_('Comments parsed using %s syntax with %s support.') % (('<a href="%s">RST</a>' % h.url('rst_help')),
115 ${(_('Comments parsed using %s syntax with %s support.') % (('<a href="%s">RST</a>' % h.url('rst_help')),
116 '<span style="color:#003367" class="tooltip" title="%s">@mention</span>' %
116 '<span style="color:#003367" class="tooltip" title="%s">@mention</span>' %
117 _('Use @username inside this text to send notification to this RhodeCode user')))|n}
117 _('Use @username inside this text to send notification to this RhodeCode user')))|n}
118 | <span class="tooltip" title="${_('Check this to change current status of code-review for this changeset')}"> ${_('change status')}
118 | <label for="show_changeset_status_box" class="tooltip" title="${_('Check this to change current status of code-review for this changeset')}"> ${_('change status')}</label>
119 <input style="vertical-align: bottom;margin-bottom:-2px" id="show_changeset_status_box" type="checkbox" name="change_changeset_status" />
119 <input style="vertical-align: bottom;margin-bottom:-2px" id="show_changeset_status_box" type="checkbox" name="change_changeset_status" />
120 </span>
121 </div>
120 </div>
122 <div id="status_block_container" class="status-block" style="display:none">
121 <div id="status_block_container" class="status-block" style="display:none">
123 %for status,lbl in c.changeset_statuses:
122 %for status,lbl in c.changeset_statuses:
124 <div class="">
123 <div class="">
125 <img src="${h.url('/images/icons/flag_status_%s.png' % status)}" /> <input ${'checked="checked"' if status == cur_status else ''}" type="radio" name="changeset_status" value="${status}"> <label>${lbl}</label>
124 <img src="${h.url('/images/icons/flag_status_%s.png' % status)}" /> <input ${'checked="checked"' if status == cur_status else ''}" type="radio" name="changeset_status" value="${status}"> <label>${lbl}</label>
126 </div>
125 </div>
127 %endfor
126 %endfor
128 </div>
127 </div>
129 <div class="mentions-container" id="mentions_container"></div>
128 <div class="mentions-container" id="mentions_container"></div>
130 ${h.textarea('text')}
129 ${h.textarea('text')}
131 </div>
130 </div>
132 <div class="comment-button">
131 <div class="comment-button">
133 ${h.submit('save', _('Comment'), class_='ui-button')}
132 ${h.submit('save', _('Comment'), class_='ui-button')}
134 </div>
133 </div>
135 ${h.end_form()}
134 ${h.end_form()}
136 </div>
135 </div>
137 %endif
136 %endif
138 </div>
137 </div>
139 <script>
138 <script>
140 YUE.onDOMReady(function () {
139 YUE.onDOMReady(function () {
141 MentionsAutoComplete('text', 'mentions_container', _USERS_AC_DATA, _GROUPS_AC_DATA);
140 MentionsAutoComplete('text', 'mentions_container', _USERS_AC_DATA, _GROUPS_AC_DATA);
142
141
143 // changeset status box listener
142 // changeset status box listener
144 YUE.on(YUD.get('show_changeset_status_box'),'change',function(e){
143 YUE.on(YUD.get('show_changeset_status_box'),'change',function(e){
145 if(e.currentTarget.checked){
144 if(e.currentTarget.checked){
146 YUD.setStyle('status_block_container','display','');
145 YUD.setStyle('status_block_container','display','');
147 }
146 }
148 else{
147 else{
149 YUD.setStyle('status_block_container','display','none');
148 YUD.setStyle('status_block_container','display','none');
150 }
149 }
151 })
150 })
152
151
153 });
152 });
154 </script>
153 </script>
155 </%def>
154 </%def>
@@ -1,107 +1,104 b''
1 <%inherit file="/base/base.html"/>
1 <%inherit file="/base/base.html"/>
2
2
3 <%def name="title()">
3 <%def name="title()">
4 ${c.repo_name} ${_('Pull request #%s') % c.pull_request.pull_request_id}
4 ${c.repo_name} ${_('Pull request #%s') % c.pull_request.pull_request_id}
5 </%def>
5 </%def>
6
6
7 <%def name="breadcrumbs_links()">
7 <%def name="breadcrumbs_links()">
8 ${h.link_to(u'Home',h.url('/'))}
8 ${h.link_to(u'Home',h.url('/'))}
9 &raquo;
9 &raquo;
10 ${h.link_to(c.repo_name,h.url('changelog_home',repo_name=c.repo_name))}
10 ${h.link_to(c.repo_name,h.url('changelog_home',repo_name=c.repo_name))}
11 &raquo;
11 &raquo;
12 ${_('Pull request #%s') % c.pull_request.pull_request_id}
12 ${_('Pull request #%s') % c.pull_request.pull_request_id}
13 </%def>
13 </%def>
14
14
15 <%def name="main()">
15 <%def name="main()">
16
16
17 <div class="box">
17 <div class="box">
18 <!-- box / title -->
18 <!-- box / title -->
19 <div class="title">
19 <div class="title">
20 ${self.breadcrumbs()}
20 ${self.breadcrumbs()}
21 </div>
21 </div>
22
22
23 <h3>${_('Title')}: ${c.pull_request.title}</h3>
23 <h3>${_('Title')}: ${c.pull_request.title}
24 <div class="changeset-status-container" style="float:left;padding:0px 20px 0px 20px">
24 <div class="changeset-status-container" style="float:none">
25 %if c.current_changeset_status:
25 %if c.current_changeset_status:
26 <div title="${_('Changeset status')}" class="changeset-status-lbl">[${h.changeset_status_lbl(c.current_changeset_status)}]</div>
26 <div title="${_('Pull request status')}" class="changeset-status-lbl">[${h.changeset_status_lbl(c.current_changeset_status)}]</div>
27 <div class="changeset-status-ico"><img src="${h.url('/images/icons/flag_status_%s.png' % c.current_changeset_status)}" /></div>
27 <div class="changeset-status-ico" style="padding:4px"><img src="${h.url('/images/icons/flag_status_%s.png' % c.current_changeset_status)}" /></div>
28 %endif
28 %endif
29 </div>
29 </div>
30 <div style="padding:4px 4px 10px 4px">
30 </h3>
31 <div>${h.fmt_date(c.pull_request.created_on)}</div>
31 <div style="white-space:pre-wrap;padding:3px 3px 5px 20px">${h.literal(c.pull_request.description)}</div>
32 <div style="padding:4px 4px 10px 20px">
33 <div>${_('Created on')}: ${h.fmt_date(c.pull_request.created_on)}</div>
32 </div>
34 </div>
33
35
34 ## REVIEWERS
36 ## REVIEWERS
35 <div>
37 <div>
36 <div class="table" style="float:right;width:46%;clear:none">
38 <div class="table" style="float:right;width:46%;clear:none">
37 <div id="body" class="diffblock">
39 <div id="body" class="diffblock">
38 <div style="white-space:pre-wrap;padding:5px">${_('Pull request reviewers')}</div>
40 <div style="white-space:pre-wrap;padding:5px">${_('Pull request reviewers')}</div>
39 </div>
41 </div>
40 <div style="border: 1px solid #CCC">
42 <div style="border: 1px solid #CCC">
41 <div class="group_members_wrap">
43 <div class="group_members_wrap">
42 <ul class="group_members">
44 <ul class="group_members">
43 %for user,status in c.pull_request_reviewers:
45 %for user,status in c.pull_request_reviewers:
44 <li>
46 <li>
45 <div class="group_member">
47 <div class="group_member">
46 <div style="float:left;padding:3px">
48 <div style="float:left;padding:3px" class="tooltip" title="${h.tooltip(h.changeset_status_lbl(status[0][1].status if status else 'not_reviewed'))}">
47 <img src="${h.url(str('/images/icons/flag_status_%s.png' % (status[0][1].status if status else 'not_reviewed')))}"/>
49 <img src="${h.url(str('/images/icons/flag_status_%s.png' % (status[0][1].status if status else 'not_reviewed')))}"/>
48 </div>
50 </div>
49 <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(user.email,20)}"/> </div>
51 <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(user.email,20)}"/> </div>
50 <div style="float:left">${user.username}</div>
52 <div style="float:left">${user.username}</div>
51 </div>
53 </div>
52 </li>
54 </li>
53 %endfor
55 %endfor
54 </ul>
56 </ul>
55 </div>
57 </div>
56 </div>
58 </div>
57 </div>
59 </div>
58 ##DIFF
60 ##DIFF
59 <div class="table" style="float:left;width:46%;clear:none">
61 <div class="table" style="float:left;width:46%;clear:none">
60 <div id="body" class="diffblock">
62 <div id="body" class="diffblock">
61 <div style="white-space:pre-wrap;padding:5px">${h.literal(c.pull_request.description)}</div>
63 <div style="white-space:pre-wrap;padding:5px">${_('Compare view')}</div>
62 </div>
64 </div>
63 <div id="changeset_compare_view_content">
65 <div id="changeset_compare_view_content">
64 ##CS
66 ##CS
65 <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${_('Incoming changesets')}</div>
67 <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${_('Incoming changesets')}</div>
66 <%include file="/compare/compare_cs.html" />
68 <%include file="/compare/compare_cs.html" />
67
69
68 ## FILES
70 ## FILES
69 <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${_('Files affected')}</div>
71 <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${_('Files affected')}</div>
70 <div class="cs_files">
72 <div class="cs_files">
71 %for fid, change, f, stat in c.files:
73 %for fid, change, f, stat in c.files:
72 <div class="cs_${change}">
74 <div class="cs_${change}">
73 <div class="node">${h.link_to(h.safe_unicode(f),h.url.current(anchor=fid))}</div>
75 <div class="node">${h.link_to(h.safe_unicode(f),h.url.current(anchor=fid))}</div>
74 <div class="changes">${h.fancy_file_stats(stat)}</div>
76 <div class="changes">${h.fancy_file_stats(stat)}</div>
75 </div>
77 </div>
76 %endfor
78 %endfor
77 </div>
79 </div>
78 </div>
80 </div>
79 </div>
81 </div>
80 </div>
82 </div>
81 <script>
83 <script>
82 var _USERS_AC_DATA = ${c.users_array|n};
84 var _USERS_AC_DATA = ${c.users_array|n};
83 var _GROUPS_AC_DATA = ${c.users_groups_array|n};
85 var _GROUPS_AC_DATA = ${c.users_groups_array|n};
84 </script>
86 </script>
85
87
86 ## diff block
88 ## diff block
87 <%namespace name="diff_block" file="/changeset/diff_block.html"/>
89 <%namespace name="diff_block" file="/changeset/diff_block.html"/>
88 %for fid, change, f, stat in c.files:
90 %for fid, change, f, stat in c.files:
89 ${diff_block.diff_block_simple([c.changes[fid]])}
91 ${diff_block.diff_block_simple([c.changes[fid]])}
90 %endfor
92 %endfor
91
93
92 ## template for inline comment form
94 ## template for inline comment form
93 <%namespace name="comment" file="/changeset/changeset_file_comment.html"/>
95 <%namespace name="comment" file="/changeset/changeset_file_comment.html"/>
94 ##${comment.comment_inline_form(c.changeset)}
96 ##${comment.comment_inline_form(c.changeset)}
95
97
96 ## render comments main comments form and it status
98 ## render comments main comments form and it status
97 ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name, pull_request_id=c.pull_request.pull_request_id),
99 ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name, pull_request_id=c.pull_request.pull_request_id),
98 c.current_changeset_status)}
100 c.current_changeset_status)}
99
101
100 </div>
102 </div>
101
103
102 <script type="text/javascript">
103
104
105 </script>
106
107 </%def>
104 </%def>
General Comments 0
You need to be logged in to leave comments. Login now