Show More
@@ -1,205 +1,206 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | <%inherit file="/base/base.html"/> |
|
3 | <%inherit file="/base/base.html"/> | |
4 |
|
4 | |||
5 | <%def name="title()"> |
|
5 | <%def name="title()"> | |
6 | ${c.repo_name} ${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)} - ${c.rhodecode_name} |
|
6 | ${c.repo_name} ${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)} - ${c.rhodecode_name} | |
7 | </%def> |
|
7 | </%def> | |
8 |
|
8 | |||
9 | <%def name="breadcrumbs_links()"> |
|
9 | <%def name="breadcrumbs_links()"> | |
10 | ${h.link_to(u'Home',h.url('/'))} |
|
10 | ${h.link_to(u'Home',h.url('/'))} | |
11 | » |
|
11 | » | |
12 | ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))} |
|
12 | ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))} | |
13 | » |
|
13 | » | |
14 | ${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)} |
|
14 | ${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)} | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 | <%def name="page_nav()"> |
|
17 | <%def name="page_nav()"> | |
18 | ${self.menu('changelog')} |
|
18 | ${self.menu('changelog')} | |
19 | </%def> |
|
19 | </%def> | |
20 |
|
20 | |||
21 | <%def name="main()"> |
|
21 | <%def name="main()"> | |
22 | <div class="box"> |
|
22 | <div class="box"> | |
23 | <!-- box / title --> |
|
23 | <!-- box / title --> | |
24 | <div class="title"> |
|
24 | <div class="title"> | |
25 | ${self.breadcrumbs()} |
|
25 | ${self.breadcrumbs()} | |
26 | </div> |
|
26 | </div> | |
27 | <div class="table"> |
|
27 | <div class="table"> | |
28 | <div class="diffblock"> |
|
28 | <div class="diffblock"> | |
29 | <div class="code-header"> |
|
29 | <div class="code-header"> | |
30 | <div class="date">${c.changeset.revision}: |
|
30 | <div class="date">${c.changeset.revision}: | |
31 | ${h.link_to(h.short_id(c.changeset.raw_id),h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))} |
|
31 | ${h.link_to(h.short_id(c.changeset.raw_id),h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))} | |
32 | ${c.changeset.date}</div> |
|
32 | ${c.changeset.date}</div> | |
33 | <div class="diff-menu-wrapper"> |
|
33 | <div class="diff-menu-wrapper"> | |
34 | <img class="diff-menu-activate" style="cursor: pointer" alt="diff-menu" src="${h.url('/images/icons/script_gear.png')}" /> |
|
34 | <img class="diff-menu-activate" style="cursor: pointer" alt="diff-menu" src="${h.url('/images/icons/script_gear.png')}" /> | |
35 | <div class="diff-menu" style="display:none"> |
|
35 | <div class="diff-menu" style="display:none"> | |
36 | <ul> |
|
36 | <ul> | |
37 | <li>${h.link_to(_('raw diff'),h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='show'))}</li> |
|
37 | <li>${h.link_to(_('raw diff'),h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='show'))}</li> | |
38 | <li>${h.link_to(_('download diff'),h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download'))}</li> |
|
38 | <li>${h.link_to(_('download diff'),h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download'))}</li> | |
39 | <li>${c.ignorews_url()}</li> |
|
39 | <li>${c.ignorews_url()}</li> | |
40 | <li>${c.context_url()}</li> |
|
40 | <li>${c.context_url()}</li> | |
41 | </ul> |
|
41 | </ul> | |
42 | </div> |
|
42 | </div> | |
43 | </div> |
|
43 | </div> | |
44 | <div class="comments-number" style="float:right;padding-right:5px">${len(c.comments)} comment(s) (${c.inline_cnt} ${_('inline')})</div> |
|
44 | <div class="comments-number" style="float:right;padding-right:5px">${len(c.comments)} comment(s) (${c.inline_cnt} ${_('inline')})</div> | |
45 | </div> |
|
45 | </div> | |
46 | </div> |
|
46 | </div> | |
47 | <div id="changeset_content"> |
|
47 | <div id="changeset_content"> | |
48 | <div class="container"> |
|
48 | <div class="container"> | |
49 | <div class="left"> |
|
49 | <div class="left"> | |
50 | <div class="author"> |
|
50 | <div class="author"> | |
51 | <div class="gravatar"> |
|
51 | <div class="gravatar"> | |
52 | <img alt="gravatar" src="${h.gravatar_url(h.email(c.changeset.author),20)}"/> |
|
52 | <img alt="gravatar" src="${h.gravatar_url(h.email(c.changeset.author),20)}"/> | |
53 | </div> |
|
53 | </div> | |
54 | <span>${h.person(c.changeset.author)}</span><br/> |
|
54 | <span>${h.person(c.changeset.author)}</span><br/> | |
55 | <span><a href="mailto:${h.email_or_none(c.changeset.author)}">${h.email_or_none(c.changeset.author)}</a></span><br/> |
|
55 | <span><a href="mailto:${h.email_or_none(c.changeset.author)}">${h.email_or_none(c.changeset.author)}</a></span><br/> | |
56 | </div> |
|
56 | </div> | |
57 | <div class="message">${h.wrap_paragraphs(c.changeset.message)}</div> |
|
57 | <div class="message">${h.wrap_paragraphs(c.changeset.message)}</div> | |
58 | </div> |
|
58 | </div> | |
59 | <div class="right"> |
|
59 | <div class="right"> | |
60 | <div class="changes"> |
|
60 | <div class="changes"> | |
61 | % if len(c.changeset.affected_files) <= c.affected_files_cut_off: |
|
61 | % if len(c.changeset.affected_files) <= c.affected_files_cut_off: | |
62 | <span class="removed" title="${_('removed')}">${len(c.changeset.removed)}</span> |
|
62 | <span class="removed" title="${_('removed')}">${len(c.changeset.removed)}</span> | |
63 | <span class="changed" title="${_('changed')}">${len(c.changeset.changed)}</span> |
|
63 | <span class="changed" title="${_('changed')}">${len(c.changeset.changed)}</span> | |
64 | <span class="added" title="${_('added')}">${len(c.changeset.added)}</span> |
|
64 | <span class="added" title="${_('added')}">${len(c.changeset.added)}</span> | |
65 | % else: |
|
65 | % else: | |
66 | <span class="removed" title="${_('affected %s files') % len(c.changeset.affected_files)}">!</span> |
|
66 | <span class="removed" title="${_('affected %s files') % len(c.changeset.affected_files)}">!</span> | |
67 | <span class="changed" title="${_('affected %s files') % len(c.changeset.affected_files)}">!</span> |
|
67 | <span class="changed" title="${_('affected %s files') % len(c.changeset.affected_files)}">!</span> | |
68 | <span class="added" title="${_('affected %s files') % len(c.changeset.affected_files)}">!</span> |
|
68 | <span class="added" title="${_('affected %s files') % len(c.changeset.affected_files)}">!</span> | |
69 | % endif |
|
69 | % endif | |
70 | </div> |
|
70 | </div> | |
71 |
|
71 | |||
72 | %if c.changeset.parents: |
|
72 | %if c.changeset.parents: | |
73 | %for p_cs in reversed(c.changeset.parents): |
|
73 | %for p_cs in reversed(c.changeset.parents): | |
74 |
<div class="parent">${_('Parent')} |
|
74 | <div class="parent">${_('Parent')} | |
75 | h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)} |
|
75 | <span class="changeset_id">${p_cs.revision}:<span class="changeset_hash">${h.link_to(h.short_id(p_cs.raw_id), | |
|
76 | h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}</span></span> | |||
76 | </div> |
|
77 | </div> | |
77 | %endfor |
|
78 | %endfor | |
78 | %else: |
|
79 | %else: | |
79 | <div class="parent">${_('No parents')}</div> |
|
80 | <div class="parent">${_('No parents')}</div> | |
80 | %endif |
|
81 | %endif | |
81 | <span class="logtags"> |
|
82 | <span class="logtags"> | |
82 | %if len(c.changeset.parents)>1: |
|
83 | %if len(c.changeset.parents)>1: | |
83 | <span class="merge">${_('merge')}</span> |
|
84 | <span class="merge">${_('merge')}</span> | |
84 | %endif |
|
85 | %endif | |
85 | <span class="branchtag" title="${'%s %s' % (_('branch'),c.changeset.branch)}"> |
|
86 | <span class="branchtag" title="${'%s %s' % (_('branch'),c.changeset.branch)}"> | |
86 | ${h.link_to(c.changeset.branch,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</span> |
|
87 | ${h.link_to(c.changeset.branch,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</span> | |
87 | %for tag in c.changeset.tags: |
|
88 | %for tag in c.changeset.tags: | |
88 | <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}"> |
|
89 | <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}"> | |
89 | ${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</span> |
|
90 | ${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</span> | |
90 | %endfor |
|
91 | %endfor | |
91 | </span> |
|
92 | </span> | |
92 | </div> |
|
93 | </div> | |
93 | </div> |
|
94 | </div> | |
94 | <span style="font-size:1.1em;font-weight: bold"> |
|
95 | <span style="font-size:1.1em;font-weight: bold"> | |
95 | ${_('%s files affected with %s additions and %s deletions.') % (len(c.changeset.affected_files),c.lines_added,c.lines_deleted)} |
|
96 | ${_('%s files affected with %s additions and %s deletions.') % (len(c.changeset.affected_files),c.lines_added,c.lines_deleted)} | |
96 | </span> |
|
97 | </span> | |
97 | <div class="cs_files"> |
|
98 | <div class="cs_files"> | |
98 | %for change,filenode,diff,cs1,cs2,stat in c.changes: |
|
99 | %for change,filenode,diff,cs1,cs2,stat in c.changes: | |
99 | <div class="cs_${change}"> |
|
100 | <div class="cs_${change}"> | |
100 | <div class="node"> |
|
101 | <div class="node"> | |
101 | %if change != 'removed': |
|
102 | %if change != 'removed': | |
102 | ${h.link_to(h.safe_unicode(filenode.path),c.anchor_url(filenode.changeset.raw_id,filenode.path))} |
|
103 | ${h.link_to(h.safe_unicode(filenode.path),c.anchor_url(filenode.changeset.raw_id,filenode.path))} | |
103 | %else: |
|
104 | %else: | |
104 | ${h.link_to(h.safe_unicode(filenode.path),h.url.current(anchor=h.FID('',filenode.path)))} |
|
105 | ${h.link_to(h.safe_unicode(filenode.path),h.url.current(anchor=h.FID('',filenode.path)))} | |
105 | %endif |
|
106 | %endif | |
106 | </div> |
|
107 | </div> | |
107 | <div class="changes">${h.fancy_file_stats(stat)}</div> |
|
108 | <div class="changes">${h.fancy_file_stats(stat)}</div> | |
108 | </div> |
|
109 | </div> | |
109 | %endfor |
|
110 | %endfor | |
110 | % if c.cut_off: |
|
111 | % if c.cut_off: | |
111 | ${_('Changeset was too big and was cut off...')} |
|
112 | ${_('Changeset was too big and was cut off...')} | |
112 | % endif |
|
113 | % endif | |
113 | </div> |
|
114 | </div> | |
114 | </div> |
|
115 | </div> | |
115 |
|
116 | |||
116 | </div> |
|
117 | </div> | |
117 |
|
118 | |||
118 | ## diff block |
|
119 | ## diff block | |
119 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> |
|
120 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> | |
120 | ${diff_block.diff_block(c.changes)} |
|
121 | ${diff_block.diff_block(c.changes)} | |
121 |
|
122 | |||
122 | ## template for inline comment form |
|
123 | ## template for inline comment form | |
123 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> |
|
124 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> | |
124 | ${comment.comment_inline_form(c.changeset)} |
|
125 | ${comment.comment_inline_form(c.changeset)} | |
125 |
|
126 | |||
126 | ${comment.comments(c.changeset)} |
|
127 | ${comment.comments(c.changeset)} | |
127 |
|
128 | |||
128 | <script type="text/javascript"> |
|
129 | <script type="text/javascript"> | |
129 | var deleteComment = function(comment_id){ |
|
130 | var deleteComment = function(comment_id){ | |
130 |
|
131 | |||
131 | var url = "${url('changeset_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}".replace('__COMMENT_ID__',comment_id); |
|
132 | var url = "${url('changeset_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}".replace('__COMMENT_ID__',comment_id); | |
132 | var postData = '_method=delete'; |
|
133 | var postData = '_method=delete'; | |
133 | var success = function(o){ |
|
134 | var success = function(o){ | |
134 | var n = YUD.get('comment-'+comment_id); |
|
135 | var n = YUD.get('comment-'+comment_id); | |
135 | n.parentNode.removeChild(n); |
|
136 | n.parentNode.removeChild(n); | |
136 | } |
|
137 | } | |
137 | ajaxPOST(url,postData,success); |
|
138 | ajaxPOST(url,postData,success); | |
138 | } |
|
139 | } | |
139 |
|
140 | |||
140 | YUE.onDOMReady(function(){ |
|
141 | YUE.onDOMReady(function(){ | |
141 |
|
142 | |||
142 | YUE.on(YUQ('.diff-menu-activate'),'click',function(e){ |
|
143 | YUE.on(YUQ('.diff-menu-activate'),'click',function(e){ | |
143 | var act = e.currentTarget.nextElementSibling; |
|
144 | var act = e.currentTarget.nextElementSibling; | |
144 |
|
145 | |||
145 | if(YUD.hasClass(act,'active')){ |
|
146 | if(YUD.hasClass(act,'active')){ | |
146 | YUD.removeClass(act,'active'); |
|
147 | YUD.removeClass(act,'active'); | |
147 | YUD.setStyle(act,'display','none'); |
|
148 | YUD.setStyle(act,'display','none'); | |
148 | }else{ |
|
149 | }else{ | |
149 | YUD.addClass(act,'active'); |
|
150 | YUD.addClass(act,'active'); | |
150 | YUD.setStyle(act,'display',''); |
|
151 | YUD.setStyle(act,'display',''); | |
151 | } |
|
152 | } | |
152 | }); |
|
153 | }); | |
153 |
|
154 | |||
154 | YUE.on(YUQ('.show-inline-comments'),'change',function(e){ |
|
155 | YUE.on(YUQ('.show-inline-comments'),'change',function(e){ | |
155 | var show = 'none'; |
|
156 | var show = 'none'; | |
156 | var target = e.currentTarget; |
|
157 | var target = e.currentTarget; | |
157 | if(target.checked){ |
|
158 | if(target.checked){ | |
158 | var show = '' |
|
159 | var show = '' | |
159 | } |
|
160 | } | |
160 | var boxid = YUD.getAttribute(target,'id_for'); |
|
161 | var boxid = YUD.getAttribute(target,'id_for'); | |
161 | var comments = YUQ('#{0} .inline-comments'.format(boxid)); |
|
162 | var comments = YUQ('#{0} .inline-comments'.format(boxid)); | |
162 | for(c in comments){ |
|
163 | for(c in comments){ | |
163 | YUD.setStyle(comments[c],'display',show); |
|
164 | YUD.setStyle(comments[c],'display',show); | |
164 | } |
|
165 | } | |
165 | var btns = YUQ('#{0} .inline-comments-button'.format(boxid)); |
|
166 | var btns = YUQ('#{0} .inline-comments-button'.format(boxid)); | |
166 | for(c in btns){ |
|
167 | for(c in btns){ | |
167 | YUD.setStyle(btns[c],'display',show); |
|
168 | YUD.setStyle(btns[c],'display',show); | |
168 | } |
|
169 | } | |
169 | }) |
|
170 | }) | |
170 |
|
171 | |||
171 | YUE.on(YUQ('.line'),'click',function(e){ |
|
172 | YUE.on(YUQ('.line'),'click',function(e){ | |
172 | var tr = e.currentTarget; |
|
173 | var tr = e.currentTarget; | |
173 | injectInlineForm(tr); |
|
174 | injectInlineForm(tr); | |
174 | }); |
|
175 | }); | |
175 |
|
176 | |||
176 | // inject comments into they proper positions |
|
177 | // inject comments into they proper positions | |
177 | var file_comments = YUQ('.inline-comment-placeholder'); |
|
178 | var file_comments = YUQ('.inline-comment-placeholder'); | |
178 |
|
179 | |||
179 | for (f in file_comments){ |
|
180 | for (f in file_comments){ | |
180 | var box = file_comments[f]; |
|
181 | var box = file_comments[f]; | |
181 | var inlines = box.children; |
|
182 | var inlines = box.children; | |
182 | for(var i=0; i<inlines.length; i++){ |
|
183 | for(var i=0; i<inlines.length; i++){ | |
183 | try{ |
|
184 | try{ | |
184 |
|
185 | |||
185 | var inline = inlines[i]; |
|
186 | var inline = inlines[i]; | |
186 | var lineno = YUD.getAttribute(inlines[i],'line'); |
|
187 | var lineno = YUD.getAttribute(inlines[i],'line'); | |
187 | var lineid = "{0}_{1}".format(YUD.getAttribute(inline,'target_id'),lineno); |
|
188 | var lineid = "{0}_{1}".format(YUD.getAttribute(inline,'target_id'),lineno); | |
188 | var target_line = YUD.get(lineid); |
|
189 | var target_line = YUD.get(lineid); | |
189 |
|
190 | |||
190 | var add = createInlineAddButton(target_line.parentNode,'${_("add another comment")}'); |
|
191 | var add = createInlineAddButton(target_line.parentNode,'${_("add another comment")}'); | |
191 | YUD.insertAfter(add,target_line.parentNode); |
|
192 | YUD.insertAfter(add,target_line.parentNode); | |
192 |
|
193 | |||
193 | var comment = new YAHOO.util.Element(tableTr('inline-comments',inline.innerHTML)) |
|
194 | var comment = new YAHOO.util.Element(tableTr('inline-comments',inline.innerHTML)) | |
194 | YUD.insertAfter(comment,target_line.parentNode); |
|
195 | YUD.insertAfter(comment,target_line.parentNode); | |
195 | }catch(e){ |
|
196 | }catch(e){ | |
196 | console.log(e); |
|
197 | console.log(e); | |
197 | } |
|
198 | } | |
198 | } |
|
199 | } | |
199 | } |
|
200 | } | |
200 | }) |
|
201 | }) | |
201 |
|
202 | |||
202 | </script> |
|
203 | </script> | |
203 |
|
204 | |||
204 | </div> |
|
205 | </div> | |
205 | </%def> |
|
206 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now