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