##// END OF EJS Templates
Adding context bar to the changeset page
Leonardo -
r3533:5462bb07 beta
parent child Browse files
Show More
@@ -1,202 +1,199 b''
1 1 ## -*- coding: utf-8 -*-
2 2
3 3 <%inherit file="/base/base.html"/>
4 4
5 5 <%def name="title()">
6 6 ${_('%s Changeset') % c.repo_name} - 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 ${h.link_to(_(u'Home'),h.url('/'))}
11 &raquo;
12 ${h.repo_link(c.rhodecode_db_repo.groups_and_repo)}
13 &raquo;
14 10 ${_('changeset')} - <span class='hash'>r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)}</span>
15 11 </%def>
16 12
17 13 <%def name="page_nav()">
18 14 ${self.menu('changelog')}
19 15 </%def>
20 16
21 17 <%def name="main()">
18 ${self.context_bar('changelog')}
22 19 <div class="box">
23 20 <!-- box / title -->
24 21 <div class="title">
25 22 ${self.breadcrumbs()}
26 23 </div>
27 24 <script>
28 25 var _USERS_AC_DATA = ${c.users_array|n};
29 26 var _GROUPS_AC_DATA = ${c.users_groups_array|n};
30 27 AJAX_COMMENT_URL = "${url('changeset_comment',repo_name=c.repo_name,revision=c.changeset.raw_id)}";
31 28 AJAX_COMMENT_DELETE_URL = "${url('changeset_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}";
32 29 </script>
33 30 <div class="table">
34 31 <div class="diffblock">
35 32 <div class="parents">
36 33 %if c.changeset.parents:
37 34 %for n, p_cs in enumerate(reversed(c.changeset.parents)):
38 35 <span class="changeset_hash">&laquo; ${h.link_to('%s:%s' % (p_cs.revision,p_cs.raw_id[:6]),h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}</span>
39 36 <br>
40 37 %endfor
41 38 %else:
42 39 <span>${_('No parents')}</span>
43 40 %endif
44 41 </div>
45 42 <div class="children">
46 43 %if c.changeset.children:
47 44 %for n, p_cs in enumerate(reversed(c.changeset.children)):
48 45 <span class="changeset_hash">${h.link_to('%s:%s' % (p_cs.revision,p_cs.raw_id[:6]),h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)} &raquo;</span>
49 46 <br>
50 47 %endfor
51 48 %else:
52 49 <span>${_('No children')}</span>
53 50 %endif
54 51 </div>
55 52 <div class="code-header banner">
56 53
57 54 <div class="hash">
58 55 r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)}
59 56 </div>
60 57 <div class="date">
61 58 ${h.fmt_date(c.changeset.date)}
62 59 </div>
63 60 <div class="changeset-status-container">
64 61 %if c.statuses:
65 62 <div title="${_('Changeset status')}" class="changeset-status-lbl">[${h.changeset_status_lbl(c.statuses[0])}]</div>
66 63 <div class="changeset-status-ico"><img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses[0])}" /></div>
67 64 %endif
68 65 </div>
69 66 <div class="diff-actions">
70 67 <a href="${h.url('changeset_raw_home',repo_name=c.repo_name,revision=c.changeset.raw_id)}" class="tooltip" title="${h.tooltip(_('raw diff'))}"><img class="icon" src="${h.url('/images/icons/page_white.png')}"/></a>
71 68 <a href="${h.url('changeset_patch_home',repo_name=c.repo_name,revision=c.changeset.raw_id)}" class="tooltip" title="${h.tooltip(_('patch diff'))}"><img class="icon" src="${h.url('/images/icons/page_add.png')}"/></a>
72 69 <a href="${h.url('changeset_download_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download')}" class="tooltip" title="${h.tooltip(_('download diff'))}"><img class="icon" src="${h.url('/images/icons/page_save.png')}"/></a>
73 70 ${c.ignorews_url(request.GET)}
74 71 ${c.context_url(request.GET)}
75 72 </div>
76 73 <div class="comments-number" style="float:right;padding-right:5px">${ungettext("%d comment", "%d comments", len(c.comments)) % len(c.comments)} ${ungettext("(%d inline)", "(%d inline)", c.inline_cnt) % c.inline_cnt}</div>
77 74 </div>
78 75 </div>
79 76 <div id="changeset_content">
80 77 <div class="container">
81 78 <div class="left">
82 79 <div class="author">
83 80 <div class="gravatar">
84 81 <img alt="gravatar" src="${h.gravatar_url(h.email_or_none(c.changeset.author),20)}"/>
85 82 </div>
86 83 <span>${h.person(c.changeset.author)}</span><br/>
87 84 <span><a href="mailto:${h.email_or_none(c.changeset.author)}">${h.email_or_none(c.changeset.author)}</a></span><br/>
88 85 </div>
89 86 <div class="message">${h.urlify_commit(c.changeset.message, c.repo_name)}</div>
90 87 </div>
91 88 <div class="right">
92 89 <div class="changes">
93 90 % if (len(c.changeset.affected_files) <= c.affected_files_cut_off) or c.fulldiff:
94 91 <span class="removed" title="${_('removed')}">${len(c.changeset.removed)}</span>
95 92 <span class="changed" title="${_('changed')}">${len(c.changeset.changed)}</span>
96 93 <span class="added" title="${_('added')}">${len(c.changeset.added)}</span>
97 94 % else:
98 95 <span class="removed" title="${_('affected %s files') % len(c.changeset.affected_files)}">!</span>
99 96 <span class="changed" title="${_('affected %s files') % len(c.changeset.affected_files)}">!</span>
100 97 <span class="added" title="${_('affected %s files') % len(c.changeset.affected_files)}">!</span>
101 98 % endif
102 99 </div>
103 100
104 101 <span class="logtags">
105 102 %if len(c.changeset.parents)>1:
106 103 <span class="merge">${_('merge')}</span>
107 104 %endif
108 105 %if c.changeset.branch:
109 106 <span class="branchtag" title="${'%s %s' % (_('branch'),c.changeset.branch)}">
110 107 ${h.link_to(c.changeset.branch,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}
111 108 </span>
112 109 %endif
113 110 %for tag in c.changeset.tags:
114 111 <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}">
115 112 ${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</span>
116 113 %endfor
117 114 </span>
118 115 </div>
119 116 </div>
120 117 <span>
121 118 % if c.limited_diff:
122 119 ${ungettext('%s file changed','%s files changed',len(c.changeset.affected_files)) % (len(c.changeset.affected_files))}:
123 120 % else:
124 121 ${ungettext('%s file changed with %s insertions and %s deletions','%s files changed with %s insertions and %s deletions', len(c.changeset.affected_files)) % (len(c.changeset.affected_files),c.lines_added,c.lines_deleted)}:
125 122 %endif
126 123 </span>
127 124 <div class="cs_files">
128 125 %for FID, (cs1, cs2, change, path, diff, stats) in c.changes[c.changeset.raw_id].iteritems():
129 126 <div class="cs_${change}">
130 127 <div class="node">
131 128 <a href="#${FID}">${h.safe_unicode(path)}</a>
132 129 </div>
133 130 <div class="changes">${h.fancy_file_stats(stats)}</div>
134 131 </div>
135 132 %endfor
136 133 % if c.limited_diff:
137 134 <h5>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("confirm to show potentially huge diff")}')">${_('Show full diff')}</a></h5>
138 135 % endif
139 136 </div>
140 137 </div>
141 138
142 139 </div>
143 140
144 141 ## diff block
145 142 <%namespace name="diff_block" file="/changeset/diff_block.html"/>
146 143 ${diff_block.diff_block(c.changes[c.changeset.raw_id])}
147 144
148 145 % if c.limited_diff:
149 146 <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("confirm to show potentially huge diff")}')">${_('Show full diff')}</a></h4>
150 147 % endif
151 148
152 149 ## template for inline comment form
153 150 <%namespace name="comment" file="/changeset/changeset_file_comment.html"/>
154 151 ${comment.comment_inline_form()}
155 152
156 153 ## render comments and inlines
157 154 ${comment.generate_comments()}
158 155
159 156 ## main comment form and it status
160 157 ${comment.comments(h.url('changeset_comment', repo_name=c.repo_name, revision=c.changeset.raw_id),
161 158 h.changeset_status(c.rhodecode_db_repo, c.changeset.raw_id))}
162 159
163 160 ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS
164 161 <script type="text/javascript">
165 162 YUE.onDOMReady(function(){
166 163 YUE.on(YUQ('.show-inline-comments'),'change',function(e){
167 164 var show = 'none';
168 165 var target = e.currentTarget;
169 166 if(target == null){
170 167 target = this;
171 168 }
172 169 if(target.checked){
173 170 var show = ''
174 171 }
175 172 var boxid = YUD.getAttribute(target,'id_for');
176 173 var comments = YUQ('#{0} .inline-comments'.format(boxid));
177 174 for(c in comments){
178 175 YUD.setStyle(comments[c],'display',show);
179 176 }
180 177 var btns = YUQ('#{0} .inline-comments-button'.format(boxid));
181 178 for(c in btns){
182 179 YUD.setStyle(btns[c],'display',show);
183 180 }
184 181 })
185 182
186 183 YUE.on(YUQ('.line'),'click',function(e){
187 184 var tr = e.currentTarget;
188 185 if(tr == null){
189 186 tr = this;
190 187 }
191 188 injectInlineForm(tr);
192 189 });
193 190
194 191 // inject comments into they proper positions
195 192 var file_comments = YUQ('.inline-comment-placeholder');
196 193 renderInlineComments(file_comments);
197 194 })
198 195
199 196 </script>
200 197
201 198 </div>
202 199 </%def>
General Comments 0
You need to be logged in to leave comments. Login now