##// END OF EJS Templates
bugfix hide fork option from non admin users
marcink -
r768:75802dfa beta
parent child Browse files
Show More
@@ -1,356 +1,356 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 3 <html xmlns="http://www.w3.org/1999/xhtml" id="mainhtml">
4 4 <head>
5 5 <title>${next.title()}</title>
6 6 <link rel="icon" href="/images/icons/database_gear.png" type="image/png" />
7 7 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8 8 <meta name="robots" content="index, nofollow"/>
9 9 <!-- stylesheets -->
10 10 ${self.css()}
11 11 <!-- scripts -->
12 12 ${self.js()}
13 13 </head>
14 14 <body>
15 15 <!-- header -->
16 16 <div id="header">
17 17 <!-- user -->
18 18 <ul id="logged-user">
19 19 <li class="first">
20 20 <div class="gravatar">
21 21 <img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,24)}" />
22 22 </div>
23 23 %if c.rhodecode_user.username == 'default':
24 24 <div class="account">
25 25 ${h.link_to('%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname),h.url('#'))}<br/>
26 26 ${h.link_to(c.rhodecode_user.username,h.url('#'))}
27 27 </div>
28 28 </li>
29 29 <li class="last highlight">${h.link_to(u'Login',h.url('login_home'))}</li>
30 30 %else:
31 31
32 32 <div class="account">
33 33 ${h.link_to('%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname),h.url('admin_settings_my_account'))}<br/>
34 34 ${h.link_to(c.rhodecode_user.username,h.url('admin_settings_my_account'))}
35 35 </div>
36 36 </li>
37 37 <li class="last highlight">${h.link_to(u'Logout',h.url('logout_home'))}</li>
38 38 %endif
39 39 </ul>
40 40 <!-- end user -->
41 41 <div id="header-inner" class="title top-left-rounded-corner top-right-rounded-corner">
42 42 <!-- logo -->
43 43 <div id="logo">
44 44 <h1><a href="${h.url('home')}">${c.rhodecode_name}</a></h1>
45 45 </div>
46 46 <!-- end logo -->
47 47 <!-- menu -->
48 48 ${self.page_nav()}
49 49 <!-- quick -->
50 50 </div>
51 51 </div>
52 52 <!-- end header -->
53 53
54 54 <!-- CONTENT -->
55 55 <div id="content">
56 56 <div class="flash_msg">
57 57 <% messages = h.flash.pop_messages() %>
58 58 % if messages:
59 59 <ul id="flash-messages">
60 60 % for message in messages:
61 61 <li class="${message.category}_msg">${message}</li>
62 62 % endfor
63 63 </ul>
64 64 % endif
65 65 </div>
66 66 <div id="main">
67 67 ${next.main()}
68 68 </div>
69 69 </div>
70 70 <!-- END CONTENT -->
71 71
72 72 <!-- footer -->
73 73 <div id="footer">
74 74 <div id="footer-inner" class="title bottom-left-rounded-corner bottom-right-rounded-corner">
75 75 <div>
76 76 <p class="footer-link">${h.link_to(_('Submit a bug'),h.url('bugtracker'))}</p>
77 77 <p class="footer-link">${h.link_to(_('GPL license'),h.url('gpl_license'))}</p>
78 78 <p>RhodeCode ${c.rhodecode_version} &copy; 2010 by Marcin Kuzminski</p>
79 79 </div>
80 80 </div>
81 81 <script type="text/javascript">${h.tooltip.activate()}</script>
82 82 </div>
83 83 <!-- end footer -->
84 84 </body>
85 85
86 86 </html>
87 87
88 88 ### MAKO DEFS ###
89 89 <%def name="page_nav()">
90 90 ${self.menu()}
91 91 </%def>
92 92
93 93 <%def name="menu(current=None)">
94 94 <%
95 95 def is_current(selected):
96 96 if selected == current:
97 97 return h.literal('class="current"')
98 98 %>
99 99 %if current not in ['home','admin']:
100 100 ##REGULAR MENU
101 101 <ul id="quick">
102 102 <!-- repo switcher -->
103 103 <li>
104 104 <a id="repo_switcher" title="${_('Switch repository')}" href="#">
105 105 <span class="icon">
106 106 <img src="/images/icons/database.png" alt="${_('Products')}" />
107 107 </span>
108 108 <span>&darr;</span>
109 109 </a>
110 110 <ul class="repo_switcher">
111 111 %for repo in c.cached_repo_list:
112 112
113 113 %if repo['repo'].dbrepo.private:
114 114 <li><img src="/images/icons/lock.png" alt="${_('Private repository')}" class="repo_switcher_type"/>${h.link_to(repo['repo'].name,h.url('summary_home',repo_name=repo['repo'].name),class_="%s" % repo['repo'].dbrepo.repo_type)}</li>
115 115 %else:
116 116 <li><img src="/images/icons/lock_open.png" alt="${_('Public repository')}" class="repo_switcher_type" />${h.link_to(repo['repo'].name,h.url('summary_home',repo_name=repo['repo'].name),class_="%s" % repo['repo'].dbrepo.repo_type)}</li>
117 117 %endif
118 118 %endfor
119 119 </ul>
120 120 </li>
121 121
122 122 <li ${is_current('summary')}>
123 123 <a title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}">
124 124 <span class="icon">
125 125 <img src="/images/icons/clipboard_16.png" alt="${_('Summary')}" />
126 126 </span>
127 127 <span>${_('Summary')}</span>
128 128 </a>
129 129 </li>
130 130 ##<li ${is_current('shortlog')}>
131 131 ## <a title="${_('Shortlog')}" href="${h.url('shortlog_home',repo_name=c.repo_name)}">
132 132 ## <span class="icon">
133 133 ## <img src="/images/icons/application_view_list.png" alt="${_('Shortlog')}" />
134 134 ## </span>
135 135 ## <span>${_('Shortlog')}</span>
136 136 ## </a>
137 137 ##</li>
138 138 <li ${is_current('changelog')}>
139 139 <a title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=c.repo_name)}">
140 140 <span class="icon">
141 141 <img src="/images/icons/time.png" alt="${_('Changelog')}" />
142 142 </span>
143 143 <span>${_('Changelog')}</span>
144 144 </a>
145 145 </li>
146 146
147 147 <li ${is_current('switch_to')}>
148 148 <a title="${_('Switch to')}" href="#">
149 149 <span class="icon">
150 150 <img src="/images/icons/arrow_switch.png" alt="${_('Switch to')}" />
151 151 </span>
152 152 <span>${_('Switch to')}</span>
153 153 </a>
154 154 <ul>
155 155 <li>
156 156 ${h.link_to('%s (%s)' % (_('branches'),len(c.repository_branches.values()),),h.url('branches_home',repo_name=c.repo_name),class_='branches childs')}
157 157 <ul>
158 158 %if c.repository_branches.values():
159 159 %for cnt,branch in enumerate(c.repository_branches.items()):
160 160 <li>${h.link_to('%s - %s' % (branch[0],h.short_id(branch[1])),h.url('files_home',repo_name=c.repo_name,revision=branch[1]))}</li>
161 161 %endfor
162 162 %else:
163 163 <li>${h.link_to(_('There are no branches yet'),'#')}</li>
164 164 %endif
165 165 </ul>
166 166 </li>
167 167 <li>
168 168 ${h.link_to('%s (%s)' % (_('tags'),len(c.repository_tags.values()),),h.url('tags_home',repo_name=c.repo_name),class_='tags childs')}
169 169 <ul>
170 170 %if c.repository_tags.values():
171 171 %for cnt,tag in enumerate(c.repository_tags.items()):
172 172 <li>${h.link_to('%s - %s' % (tag[0],h.short_id(tag[1])),h.url('files_home',repo_name=c.repo_name,revision=tag[1]))}</li>
173 173 %endfor
174 174 %else:
175 175 <li>${h.link_to(_('There are no tags yet'),'#')}</li>
176 176 %endif
177 177 </ul>
178 178 </li>
179 179 </ul>
180 180 </li>
181 181 <li ${is_current('files')}>
182 182 <a title="${_('Files')}" href="${h.url('files_home',repo_name=c.repo_name)}">
183 183 <span class="icon">
184 184 <img src="/images/icons/file.png" alt="${_('Files')}" />
185 185 </span>
186 186 <span>${_('Files')}</span>
187 187 </a>
188 188 </li>
189 189
190 190 <li ${is_current('options')}>
191 191 <a title="${_('Options')}" href="#">
192 192 <span class="icon">
193 193 <img src="/images/icons/table_gear.png" alt="${_('Admin')}" />
194 194 </span>
195 195 <span>${_('Options')}</span>
196 196 </a>
197 197 <ul>
198 198 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
199 199 <li>${h.link_to(_('settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li>
200 %endif
201 200 <li>${h.link_to(_('fork'),h.url('repo_fork_home',repo_name=c.repo_name),class_='fork')}</li>
201 %endif
202 202 <li>${h.link_to(_('search'),h.url('search_repo',search_repo=c.repo_name),class_='search')}</li>
203 203
204 204 %if h.HasPermissionAll('hg.admin')('access admin main page'):
205 205 <li>
206 206 ${h.link_to(_('admin'),h.url('admin_home'),class_='admin')}
207 207 <ul>
208 208 <li>${h.link_to(_('journal'),h.url('admin_home'),class_='journal')}</li>
209 209 <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li>
210 210 <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li>
211 211 <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li>
212 212 <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li>
213 213 </ul>
214 214 </li>
215 215 %endif
216 216
217 217 </ul>
218 218 </li>
219 219
220 220 <li>
221 221 <a title="${_('Followers')}" href="#">
222 222 <span class="icon_short">
223 223 <img src="/images/icons/heart.png" alt="${_('Followers')}" />
224 224 </span>
225 225 <span class="short">${c.repository_followers}</span>
226 226 </a>
227 227 </li>
228 228 <li>
229 229 <a title="${_('Forks')}" href="#">
230 230 <span class="icon_short">
231 231 <img src="/images/icons/arrow_divide.png" alt="${_('Forks')}" />
232 232 </span>
233 233 <span class="short">${c.repository_forks}</span>
234 234 </a>
235 235 </li>
236 236
237 237
238 238
239 239 </ul>
240 240 %else:
241 241 ##ROOT MENU
242 242 <ul id="quick">
243 243 <li>
244 244 <a title="${_('Home')}" href="${h.url('home')}">
245 245 <span class="icon">
246 246 <img src="/images/icons/home_16.png" alt="${_('Home')}" />
247 247 </span>
248 248 <span>${_('Home')}</span>
249 249 </a>
250 250 </li>
251 251
252 252 <li>
253 253 <a title="${_('Journal')}" href="${h.url('journal')}">
254 254 <span class="icon">
255 255 <img src="/images/icons/book.png" alt="${_('Journal')}" />
256 256 </span>
257 257 <span>${_('Journal')}</span>
258 258 </a>
259 259 </li>
260 260
261 261 <li>
262 262 <a title="${_('Search')}" href="${h.url('search')}">
263 263 <span class="icon">
264 264 <img src="/images/icons/search_16.png" alt="${_('Search')}" />
265 265 </span>
266 266 <span>${_('Search')}</span>
267 267 </a>
268 268 </li>
269 269
270 270 %if h.HasPermissionAll('hg.admin')('access admin main page'):
271 271 <li ${is_current('admin')}>
272 272 <a title="${_('Admin')}" href="${h.url('admin_home')}">
273 273 <span class="icon">
274 274 <img src="/images/icons/cog_edit.png" alt="${_('Admin')}" />
275 275 </span>
276 276 <span>${_('Admin')}</span>
277 277 </a>
278 278 <ul>
279 279 <li>${h.link_to(_('journal'),h.url('admin_home'),class_='journal')}</li>
280 280 <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li>
281 281 <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li>
282 282 <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li>
283 283 <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li>
284 284 </ul>
285 285 </li>
286 286 %endif
287 287
288 288 </ul>
289 289 %endif
290 290 </%def>
291 291
292 292
293 293 <%def name="css()">
294 294 <link rel="stylesheet" type="text/css" href="/css/style.css" media="screen" />
295 295 <link rel="stylesheet" type="text/css" href="/css/pygments.css" />
296 296 <link rel="stylesheet" type="text/css" href="/css/diff.css" />
297 297 </%def>
298 298
299 299 <%def name="js()">
300 300 ##<script type="text/javascript" src="/js/yui/utilities/utilities.js"></script>
301 301 ##<script type="text/javascript" src="/js/yui/container/container.js"></script>
302 302 ##<script type="text/javascript" src="/js/yui/datasource/datasource.js"></script>
303 303 ##<script type="text/javascript" src="/js/yui/autocomplete/autocomplete.js"></script>
304 304 ##<script type="text/javascript" src="/js/yui/selector/selector-min.js"></script>
305 305
306 306 <script type="text/javascript" src="/js/yui2a.js"></script>
307 307 <!--[if IE]><script language="javascript" type="text/javascript" src="/js/excanvas.min.js"></script><![endif]-->
308 308 <script type="text/javascript" src="/js/yui.flot.js"></script>
309 309
310 310 <script type="text/javascript">
311 311 var base_url ='/_admin/toggle_following';
312 312 var YUC = YAHOO.util.Connect;
313 313 var YUD = YAHOO.util.Dom;
314 314 var YUE = YAHOO.util.Event;
315 315
316 316 function onSuccess(){
317 317
318 318 var f = YUD.get('follow_toggle');
319 319 if(f.getAttribute('class')=='follow'){
320 320 f.setAttribute('class','following');
321 321 f.setAttribute('title',"${_('Stop following this repository')}");
322 322 }
323 323 else{
324 324 f.setAttribute('class','follow');
325 325 f.setAttribute('title',"${_('Start following this repository')}");
326 326 }
327 327 }
328 328
329 329 function toggleFollowingUser(fallows_user_id,token){
330 330 args = 'follows_user_id='+fallows_user_id;
331 331 args+= '&auth_token='+token;
332 332 YUC.asyncRequest('POST',base_url,{
333 333 success:function(o){
334 334 onSuccess();
335 335 }
336 336 },args); return false;
337 337 }
338 338
339 339 function toggleFollowingRepo(fallows_repo_id,token){
340 340 args = 'follows_repo_id='+fallows_repo_id;
341 341 args+= '&auth_token='+token;
342 342 YUC.asyncRequest('POST',base_url,{
343 343 success:function(o){
344 344 onSuccess();
345 345 }
346 346 },args); return false;
347 347 }
348 348 </script>
349 349
350 350 </%def>
351 351
352 352 <%def name="breadcrumbs()">
353 353 <div class="breadcrumbs">
354 354 ${self.breadcrumbs_links()}
355 355 </div>
356 356 </%def> No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now