##// END OF EJS Templates
Improved i18n on changelog and user group administration pages.
Vincent Duvert -
r2312:f6d57d05 beta
parent child Browse files
Show More
@@ -1,53 +1,53 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.html"/>
3 3
4 4 <%def name="title()">
5 5 ${_('Users groups administration')} - ${c.rhodecode_name}
6 6 </%def>
7 7
8 8 <%def name="breadcrumbs_links()">
9 9 ${h.link_to(_('Admin'),h.url('admin_home'))} &raquo; ${_('Users groups')}
10 10 </%def>
11 11
12 12 <%def name="page_nav()">
13 13 ${self.menu('admin')}
14 14 </%def>
15 15
16 16 <%def name="main()">
17 17 <div class="box">
18 18 <!-- box / title -->
19 19 <div class="title">
20 20 ${self.breadcrumbs()}
21 21 <ul class="links">
22 22 <li>
23 23 <span>${h.link_to(_(u'ADD NEW USER GROUP'),h.url('new_users_group'))}</span>
24 24 </li>
25 25
26 26 </ul>
27 27 </div>
28 28 <!-- end box / title -->
29 29 <div class="table">
30 30 <table class="table_disp">
31 31 <tr class="header">
32 32 <th class="left">${_('group name')}</th>
33 33 <th class="left">${_('members')}</th>
34 34 <th class="left">${_('active')}</th>
35 35 <th class="left">${_('action')}</th>
36 36 </tr>
37 37 %for cnt,u_group in enumerate(c.users_groups_list):
38 38 <tr class="parity${cnt%2}">
39 39 <td>${h.link_to(u_group.users_group_name,h.url('edit_users_group', id=u_group.users_group_id))}</td>
40 40 <td><span class="tooltip" title="${', '.join(map(h.safe_unicode,[x.user.username for x in u_group.members[:50]]))}">${len(u_group.members)}</span></td>
41 41 <td>${h.bool2icon(u_group.users_group_active)}</td>
42 42 <td>
43 43 ${h.form(url('users_group', id=u_group.users_group_id),method='delete')}
44 ${h.submit('remove_','delete',id="remove_group_%s" % u_group.users_group_id,
44 ${h.submit('remove_',_('delete'),id="remove_group_%s" % u_group.users_group_id,
45 45 class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this users group: %s') % u_group.users_group_name+"');")}
46 46 ${h.end_form()}
47 47 </td>
48 48 </tr>
49 49 %endfor
50 50 </table>
51 51 </div>
52 52 </div>
53 53 </%def>
@@ -1,238 +1,239 b''
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} ${_('Changelog')} - ${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 ${_('Changelog')} - ${_('showing ')} ${c.size if c.size <= c.total_cs else c.total_cs} ${_('out of')} ${c.total_cs} ${_('revisions')}
14 <% size = c.size if c.size <= c.total_cs else c.total_cs %>
15 ${_('Changelog')} - ${ungettext('showing %d out of %d revision', 'showing %d out of %d revisions', size) % (size, c.total_cs)}
15 16 </%def>
16 17
17 18 <%def name="page_nav()">
18 19 ${self.menu('changelog')}
19 20 </%def>
20 21
21 22 <%def name="main()">
22 23 <div class="box">
23 24 <!-- box / title -->
24 25 <div class="title">
25 26 ${self.breadcrumbs()}
26 27 </div>
27 28 <div class="table">
28 29 % if c.pagination:
29 30 <div id="graph">
30 31 <div id="graph_nodes">
31 32 <canvas id="graph_canvas"></canvas>
32 33 </div>
33 34 <div id="graph_content">
34 35 <div class="container_header">
35 36 ${h.form(h.url.current(),method='get')}
36 37 <div class="info_box" style="float:left">
37 38 ${h.submit('set',_('Show'),class_="ui-btn")}
38 39 ${h.text('size',size=1,value=c.size)}
39 40 ${_('revisions')}
40 41 </div>
41 42 ${h.end_form()}
42 43 <div id="rev_range_container" style="display:none"></div>
43 44 <div style="float:right">${h.select('branch_filter',c.branch_name,c.branch_filters)}</div>
44 45 </div>
45 46
46 47 %for cnt,cs in enumerate(c.pagination):
47 48 <div id="chg_${cnt+1}" class="container ${'tablerow%s' % (cnt%2)}">
48 49 <div class="left">
49 50 <div>
50 51 ${h.checkbox(cs.short_id,class_="changeset_range")}
51 52 <span class="tooltip" title="${h.age(cs.date)}"><a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}"><span class="changeset_id">${cs.revision}:<span class="changeset_hash">${h.short_id(cs.raw_id)}</span></span></a></span>
52 53 </div>
53 54 <div class="author">
54 55 <div class="gravatar">
55 56 <img alt="gravatar" src="${h.gravatar_url(h.email(cs.author),16)}"/>
56 57 </div>
57 58 <div title="${cs.author}" class="user">${h.person(cs.author)}</div>
58 59 </div>
59 60 <div class="date">${cs.date}</div>
60 61 </div>
61 62 <div class="mid">
62 63 <div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div>
63 64 <div class="expand"><span class="expandtext">&darr; ${_('show more')} &darr;</span></div>
64 65 </div>
65 66 <div class="right">
66 67 <div class="changes">
67 68 <div id="${cs.raw_id}" style="float:right;" class="changed_total tooltip" title="${_('Affected number of files, click to show more details')}">${len(cs.affected_files)}</div>
68 69 <div class="comments-container">
69 70 %if len(c.comments.get(cs.raw_id,[])) > 0:
70 71 <div class="comments-cnt" title="${('comments')}">
71 72 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}">
72 73 <div class="comments-cnt">${len(c.comments[cs.raw_id])}</div>
73 74 <img src="${h.url('/images/icons/comments.png')}">
74 75 </a>
75 76 </div>
76 77 %endif
77 78 </div>
78 79 </div>
79 80 %if cs.parents:
80 81 %for p_cs in reversed(cs.parents):
81 82 <div class="parent">${_('Parent')}
82 83 <span class="changeset_id">${p_cs.revision}:<span class="changeset_hash">${h.link_to(h.short_id(p_cs.raw_id),
83 84 h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}</span></span>
84 85 </div>
85 86 %endfor
86 87 %else:
87 88 <div class="parent">${_('No parents')}</div>
88 89 %endif
89 90
90 91 <span class="logtags">
91 92 %if len(cs.parents)>1:
92 93 <span class="merge">${_('merge')}</span>
93 94 %endif
94 95 %if cs.branch:
95 96 <span class="branchtag" title="${'%s %s' % (_('branch'),cs.branch)}">
96 97 ${h.link_to(h.shorter(cs.branch),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
97 98 </span>
98 99 %endif
99 100 %if h.is_hg(c.rhodecode_repo):
100 101 %for book in cs.bookmarks:
101 102 <span class="bookbook" title="${'%s %s' % (_('bookmark'),book)}">
102 103 ${h.link_to(h.shorter(book),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
103 104 </span>
104 105 %endfor
105 106 %endif
106 107 %for tag in cs.tags:
107 108 <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}">
108 109 ${h.link_to(h.shorter(tag),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span>
109 110 %endfor
110 111 </span>
111 112 </div>
112 113 </div>
113 114
114 115 %endfor
115 116 <div class="pagination-wh pagination-left">
116 117 ${c.pagination.pager('$link_previous ~2~ $link_next')}
117 118 </div>
118 119 </div>
119 120 </div>
120 121
121 122 <script type="text/javascript" src="${h.url('/js/graph.js')}"></script>
122 123 <script type="text/javascript">
123 124 YAHOO.util.Event.onDOMReady(function(){
124 125
125 126 //Monitor range checkboxes and build a link to changesets
126 127 //ranges
127 128 var checkboxes = YUD.getElementsByClassName('changeset_range');
128 129 var url_tmpl = "${h.url('changeset_home',repo_name=c.repo_name,revision='__REVRANGE__')}";
129 130 YUE.on(checkboxes,'click',function(e){
130 131 var checked_checkboxes = [];
131 132 for (pos in checkboxes){
132 133 if(checkboxes[pos].checked){
133 134 checked_checkboxes.push(checkboxes[pos]);
134 135 }
135 136 }
136 137 if(checked_checkboxes.length>1){
137 138 var rev_end = checked_checkboxes[0].name;
138 139 var rev_start = checked_checkboxes[checked_checkboxes.length-1].name;
139 140
140 141 var url = url_tmpl.replace('__REVRANGE__',
141 142 rev_start+'...'+rev_end);
142 143
143 144 var link = "<a href="+url+">${_('Show selected changes __S -> __E')}</a>"
144 145 link = link.replace('__S',rev_start);
145 146 link = link.replace('__E',rev_end);
146 147 YUD.get('rev_range_container').innerHTML = link;
147 148 YUD.setStyle('rev_range_container','display','');
148 149 }
149 150 else{
150 151 YUD.setStyle('rev_range_container','display','none');
151 152
152 153 }
153 154 });
154 155
155 156 var msgs = YUQ('.message');
156 157 // get first element height
157 158 var el = YUQ('#graph_content .container')[0];
158 159 var row_h = el.clientHeight;
159 160 for(var i=0;i<msgs.length;i++){
160 161 var m = msgs[i];
161 162
162 163 var h = m.clientHeight;
163 164 var pad = YUD.getStyle(m,'padding');
164 165 if(h > row_h){
165 166 var offset = row_h - (h+12);
166 167 YUD.setStyle(m.nextElementSibling,'display','block');
167 168 YUD.setStyle(m.nextElementSibling,'margin-top',offset+'px');
168 169 };
169 170 }
170 171 YUE.on(YUQ('.expand'),'click',function(e){
171 172 var elem = e.currentTarget.parentNode.parentNode;
172 173 YUD.setStyle(e.currentTarget,'display','none');
173 174 YUD.setStyle(elem,'height','auto');
174 175
175 176 //redraw the graph, max_w and jsdata are global vars
176 177 set_canvas(max_w);
177 178
178 179 var r = new BranchRenderer();
179 180 r.render(jsdata,max_w);
180 181
181 182 })
182 183
183 184 // Fetch changeset details
184 185 YUE.on(YUD.getElementsByClassName('changed_total'),'click',function(e){
185 186 var id = e.currentTarget.id
186 187 var url = "${h.url('changelog_details',repo_name=c.repo_name,cs='__CS__')}"
187 188 var url = url.replace('__CS__',id);
188 189 ypjax(url,id,function(){tooltip_activate()});
189 190 });
190 191
191 192 // change branch filter
192 193 YUE.on(YUD.get('branch_filter'),'change',function(e){
193 194 var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value;
194 195 var url_main = "${h.url('changelog_home',repo_name=c.repo_name)}";
195 196 var url = "${h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__')}";
196 197 var url = url.replace('__BRANCH__',selected_branch);
197 198 if(selected_branch != ''){
198 199 window.location = url;
199 200 }else{
200 201 window.location = url_main;
201 202 }
202 203
203 204 });
204 205
205 206 function set_canvas(heads) {
206 207 var c = document.getElementById('graph_nodes');
207 208 var t = document.getElementById('graph_content');
208 209 canvas = document.getElementById('graph_canvas');
209 210 var div_h = t.clientHeight;
210 211 c.style.height=div_h+'px';
211 212 canvas.setAttribute('height',div_h);
212 213 c.style.height=max_w+'px';
213 214 canvas.setAttribute('width',max_w);
214 215 };
215 216 var heads = 1;
216 217 var max_heads = 0;
217 218 var jsdata = ${c.jsdata|n};
218 219
219 220 for( var i=0;i<jsdata.length;i++){
220 221 var m = Math.max.apply(Math, jsdata[i][1]);
221 222 if (m>max_heads){
222 223 max_heads = m;
223 224 }
224 225 }
225 226 var max_w = Math.max(100,max_heads*25);
226 227 set_canvas(max_w);
227 228
228 229 var r = new BranchRenderer();
229 230 r.render(jsdata,max_w);
230 231
231 232 });
232 233 </script>
233 234 %else:
234 235 ${_('There are no changes yet')}
235 236 %endif
236 237 </div>
237 238 </div>
238 239 </%def>
General Comments 0
You need to be logged in to leave comments. Login now