Mercurial > kallithea
comparison rhodecode/templates/base/base.html @ 3527:87c97fcea029 beta
Adding the context bar too all pages related to a Repository.
Deleted top menu items that are on the context bar already.
author | Leonardo <leo@unity3d.com> |
---|---|
date | Mon, 04 Mar 2013 12:15:34 +0100 |
parents | fe2bb88bf7ac |
children | 0ba1736437e0 |
comparison
equal
deleted
inserted
replaced
3526:79c980b628e3 | 3527:87c97fcea029 |
---|---|
57 | 57 |
58 <%def name="breadcrumbs()"> | 58 <%def name="breadcrumbs()"> |
59 <div class="breadcrumbs"> | 59 <div class="breadcrumbs"> |
60 ${self.breadcrumbs_links()} | 60 ${self.breadcrumbs_links()} |
61 </div> | 61 </div> |
62 </%def> | |
63 | |
64 <%def name="context_bar(current=None)"> | |
65 %if c.repo_name: | |
66 ${repo_context_bar(current)} | |
67 %endif | |
68 </%def> | |
69 | |
70 <%def name="repo_context_bar(current=None)"> | |
71 <% | |
72 def follow_class(): | |
73 if c.repository_following: | |
74 return h.literal('following') | |
75 else: | |
76 return h.literal('follow') | |
77 %> | |
78 <% | |
79 def is_current(selected): | |
80 if selected == current: | |
81 return h.literal('class="current"') | |
82 %> | |
83 | |
84 <!--- CONTEXT BAR --> | |
85 <div id="context-bar" class="box"> | |
86 <div id="context-top"> | |
87 <div id= "breadcrumbs"> | |
88 ${h.link_to(_(u'Repositories'),h.url('home'))} | |
89 ยป | |
90 ${h.repo_link(c.rhodecode_db_repo.groups_and_repo)} | |
91 </div> | |
92 ## TODO: this check feels wrong, it would be better to have a check for permissions | |
93 ## also it feels like a job for the controller | |
94 %if c.rhodecode_user.username != 'default': | |
95 <ul id="context-actions" class="horizontal-list"> | |
96 <li> | |
97 <button class="${follow_class()}" onclick="javascript:toggleFollowingRepo(this,${c.rhodecode_db_repo.repo_id},'${str(h.get_token())}');"> | |
98 <!--span class="icon show-follow follow"></span> | |
99 <span class="icon show-following following"></span--> | |
100 <span class="show-follow">${_('Follow')}</span> | |
101 <span class="show-following">${_('Unfollow')}</span> | |
102 </button> | |
103 </li> | |
104 <li><a href="${h.url('repo_fork_home',repo_name=c.repo_name)}" class="fork">${_('Fork')}</a></li> | |
105 %if h.is_hg(c.rhodecode_repo): | |
106 <li><a href="${h.url('pullrequest_home',repo_name=c.repo_name)}" class="pull-request">${_('Pull Request')}</a></li> | |
107 %endif | |
108 </ul> | |
109 %endif | |
110 </div> | |
111 <div id="context-state"> | |
112 <button id="revision-changer"> | |
113 <span class="branch-name">graphics/shader-move</span> | |
114 <span class="revision">@73318:8d3d6ee94072</span> | |
115 </button> | |
116 <ul id="context-pages" class="horizontal-list"> | |
117 <li ${is_current('summary')}><a href="${h.url('summary_home', repo_name=c.repo_name)}" class="summary">${_('Summary')}</a></li> | |
118 <li ${is_current('changelog')}><a href="${h.url('changelog_home', repo_name=c.repo_name)}" class="changelogs">${_('Changelogs')}</a></li> | |
119 <li ${is_current('files')}><a href="${h.url('files_home', repo_name=c.repo_name)}" class="files"></span>${_('Files')}</a></li> | |
120 <li> | |
121 <a href="#" id="branch_tag_switcher_2" class="dropdown switch-to"></span>${_('Switch To')}</a> | |
122 <ul id="switch_to_list_2" class="switch_to submenu"> | |
123 <li><a href="#">${_('loading...')}</a></li> | |
124 </ul> | |
125 </li> | |
126 <li ${is_current('options')}> | |
127 <a href="#" class="dropdown options"></span>Options</a> | |
128 <ul> | |
129 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name): | |
130 %if h.HasPermissionAll('hg.admin')('access settings on repository'): | |
131 <li>${h.link_to(_('repository settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li> | |
132 %else: | |
133 <li>${h.link_to(_('repository settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li> | |
134 %endif | |
135 %endif | |
136 %if c.rhodecode_db_repo.fork: | |
137 <li>${h.link_to(_('compare fork'),h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,org_ref_type='branch',org_ref='default',other_repo=c.repo_name,other_ref_type='branch',other_ref=request.GET.get('branch') or 'default'),class_='compare_request')}</li> | |
138 %endif | |
139 <li>${h.link_to(_('lightweight changelog'),h.url('shortlog_home',repo_name=c.repo_name),class_='shortlog')}</li> | |
140 <li>${h.link_to(_('search'),h.url('search_repo',repo_name=c.repo_name),class_='search')}</li> | |
141 | |
142 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking: | |
143 %if c.rhodecode_db_repo.locked[0]: | |
144 <li>${h.link_to(_('unlock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_del')}</li> | |
145 %else: | |
146 <li>${h.link_to(_('lock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_add')}</li> | |
147 %endif | |
148 %endif | |
149 | |
150 % if h.HasPermissionAll('hg.admin')('access admin main page'): | |
151 <li> | |
152 ${h.link_to(_('admin'),h.url('admin_home'),class_='admin childs')} | |
153 <%def name="admin_menu()"> | |
154 <ul class="admin_menu"> | |
155 <li>${h.link_to(_('admin journal'),h.url('admin_home'),class_='journal')}</li> | |
156 <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li> | |
157 <li>${h.link_to(_('repositories groups'),h.url('repos_groups'),class_='repos_groups')}</li> | |
158 <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li> | |
159 <li>${h.link_to(_('users groups'),h.url('users_groups'),class_='groups')}</li> | |
160 <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li> | |
161 <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li> | |
162 <li>${h.link_to(_('defaults'),h.url('defaults'),class_='defaults')}</li> | |
163 <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li> | |
164 </ul> | |
165 </%def> | |
166 ## ADMIN MENU | |
167 ${admin_menu()} | |
168 </li> | |
169 ## if you're a admin of any groups, show admin menu for it | |
170 % elif c.rhodecode_user.groups_admin: | |
171 <li> | |
172 ${h.link_to(_('admin'),h.url('admin_home'),class_='admin')} | |
173 <%def name="admin_menu_simple()"> | |
174 <ul> | |
175 <li>${h.link_to(_('repositories groups'),h.url('repos_groups'),class_='repos_groups')}</li> | |
176 </ul> | |
177 </%def> | |
178 ## ADMIN MENU | |
179 ${admin_menu_simple()} | |
180 </li> | |
181 % endif | |
182 </ul> | |
183 </li> | |
184 <li ${is_current('showpullrequest')}><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name)}" title="${_('Show Pull Requests')}" class="pull-request">1</a></li> | |
185 </ul> | |
186 </div> | |
187 </div> | |
188 <script type="text/javascript"> | |
189 YUE.on('branch_tag_switcher_2','mouseover',function(){ | |
190 var loaded = YUD.hasClass('branch_tag_switcher_2','loaded'); | |
191 if(!loaded){ | |
192 YUD.addClass('branch_tag_switcher_2','loaded'); | |
193 ypjax("${h.url('branch_tag_switcher',repo_name=c.repo_name)}",'switch_to_list_2', | |
194 function(o){}, | |
195 function(o){YUD.removeClass('branch_tag_switcher_2','loaded');} | |
196 ,null); | |
197 } | |
198 return false; | |
199 }); | |
200 </script> | |
201 <!--- END CONTEXT BAR --> | |
62 </%def> | 202 </%def> |
63 | 203 |
64 <%def name="usermenu()"> | 204 <%def name="usermenu()"> |
65 ## USER MENU | 205 ## USER MENU |
66 <li> | 206 <li> |
162 </ul> | 302 </ul> |
163 </li> | 303 </li> |
164 ## we render this menu only not for those pages | 304 ## we render this menu only not for those pages |
165 %if current not in ['home','admin', 'search', 'journal']: | 305 %if current not in ['home','admin', 'search', 'journal']: |
166 ##REGULAR MENU | 306 ##REGULAR MENU |
167 <li ${is_current('summary')}> | |
168 <a class="menu_link" title="${_('Summary page')}" href="${h.url('summary_home',repo_name=c.repo_name)}"> | |
169 <span class="icon"> | |
170 <img src="${h.url('/images/icons/clipboard_16.png')}" alt="${_('Summary')}" /> | |
171 </span> | |
172 <span>${_('Summary')}</span> | |
173 </a> | |
174 </li> | |
175 <li ${is_current('changelog')}> | |
176 <a class="menu_link" title="${_('Changeset list')}" href="${h.url('changelog_home',repo_name=c.repo_name)}"> | |
177 <span class="icon"> | |
178 <img src="${h.url('/images/icons/time.png')}" alt="${_('Changelog')}" /> | |
179 </span> | |
180 <span>${_('Changelog')}</span> | |
181 </a> | |
182 </li> | |
183 <li ${is_current('switch_to')}> | |
184 <a class="menu_link" id="branch_tag_switcher" title="${_('Switch to')}" href="#"> | |
185 <span class="icon"> | |
186 <img src="${h.url('/images/icons/arrow_switch.png')}" alt="${_('Switch to')}" /> | |
187 </span> | |
188 <span>${_('Switch to')}</span> | |
189 </a> | |
190 <ul id="switch_to_list" class="switch_to"> | |
191 <li><a href="#">${_('loading...')}</a></li> | |
192 </ul> | |
193 </li> | |
194 <li ${is_current('files')}> | |
195 <a class="menu_link" title="${_('Show repository content')}" href="${h.url('files_home',repo_name=c.repo_name)}"> | |
196 <span class="icon"> | |
197 <img src="${h.url('/images/icons/file.png')}" alt="${_('Files')}" /> | |
198 </span> | |
199 <span>${_('Files')}</span> | |
200 </a> | |
201 </li> | |
202 <li ${is_current('options')}> | |
203 <a class="menu_link" title="${_('Options')}" href="#"> | |
204 <span class="icon"> | |
205 <img src="${h.url('/images/icons/table_gear.png')}" alt="${_('Admin')}" /> | |
206 </span> | |
207 <span>${_('Options')}</span> | |
208 </a> | |
209 <ul> | |
210 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name): | |
211 %if h.HasPermissionAll('hg.admin')('access settings on repository'): | |
212 <li>${h.link_to(_('repository settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li> | |
213 %else: | |
214 <li>${h.link_to(_('repository settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li> | |
215 %endif | |
216 %endif | |
217 | |
218 <li>${h.link_to(_('fork'),h.url('repo_fork_home',repo_name=c.repo_name),class_='fork')}</li> | |
219 %if h.is_hg(c.rhodecode_repo): | |
220 <li>${h.link_to(_('open new pull request'),h.url('pullrequest_home',repo_name=c.repo_name),class_='pull_request')}</li> | |
221 %endif | |
222 %if c.rhodecode_db_repo.fork: | |
223 <li>${h.link_to(_('compare fork'),h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,org_ref_type='branch',org_ref='default',other_repo=c.repo_name,other_ref_type='branch',other_ref=request.GET.get('branch') or 'default'),class_='compare_request')}</li> | |
224 %endif | |
225 <li>${h.link_to(_('lightweight changelog'),h.url('shortlog_home',repo_name=c.repo_name),class_='shortlog')}</li> | |
226 <li>${h.link_to(_('search'),h.url('search_repo',repo_name=c.repo_name),class_='search')}</li> | |
227 | |
228 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking: | |
229 %if c.rhodecode_db_repo.locked[0]: | |
230 <li>${h.link_to(_('unlock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_del')}</li> | |
231 %else: | |
232 <li>${h.link_to(_('lock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_add')}</li> | |
233 %endif | |
234 %endif | |
235 | |
236 % if h.HasPermissionAll('hg.admin')('access admin main page'): | |
237 <li> | |
238 ${h.link_to(_('admin'),h.url('admin_home'),class_='admin')} | |
239 <%def name="admin_menu()"> | |
240 <ul> | |
241 <li>${h.link_to(_('admin journal'),h.url('admin_home'),class_='journal')}</li> | |
242 <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li> | |
243 <li>${h.link_to(_('repositories groups'),h.url('repos_groups'),class_='repos_groups')}</li> | |
244 <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li> | |
245 <li>${h.link_to(_('users groups'),h.url('users_groups'),class_='groups')}</li> | |
246 <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li> | |
247 <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li> | |
248 <li>${h.link_to(_('defaults'),h.url('defaults'),class_='defaults')}</li> | |
249 <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li> | |
250 </ul> | |
251 </%def> | |
252 ## ADMIN MENU | |
253 ${admin_menu()} | |
254 </li> | |
255 ## if you're a admin of any groups, show admin menu for it | |
256 % elif c.rhodecode_user.groups_admin: | |
257 <li> | |
258 ${h.link_to(_('admin'),h.url('admin_home'),class_='admin')} | |
259 <%def name="admin_menu_simple()"> | |
260 <ul> | |
261 <li>${h.link_to(_('repositories groups'),h.url('repos_groups'),class_='repos_groups')}</li> | |
262 </ul> | |
263 </%def> | |
264 ## ADMIN MENU | |
265 ${admin_menu_simple()} | |
266 </li> | |
267 % endif | |
268 </ul> | |
269 </li> | |
270 <li> | 307 <li> |
271 <a class="menu_link" title="${_('Followers')}" href="${h.url('repo_followers_home',repo_name=c.repo_name)}"> | 308 <a class="menu_link" title="${_('Followers')}" href="${h.url('repo_followers_home',repo_name=c.repo_name)}"> |
272 <span class="icon_short"> | 309 <span class="icon_short"> |
273 <img src="${h.url('/images/icons/heart.png')}" alt="${_('Followers')}" /> | 310 <img src="${h.url('/images/icons/heart.png')}" alt="${_('Followers')}" /> |
274 </span> | 311 </span> |
279 <a class="menu_link" title="${_('Forks')}" href="${h.url('repo_forks_home',repo_name=c.repo_name)}"> | 316 <a class="menu_link" title="${_('Forks')}" href="${h.url('repo_forks_home',repo_name=c.repo_name)}"> |
280 <span class="icon_short"> | 317 <span class="icon_short"> |
281 <img src="${h.url('/images/icons/arrow_divide.png')}" alt="${_('Forks')}" /> | 318 <img src="${h.url('/images/icons/arrow_divide.png')}" alt="${_('Forks')}" /> |
282 </span> | 319 </span> |
283 <span class="short">${c.repository_forks}</span> | 320 <span class="short">${c.repository_forks}</span> |
284 </a> | |
285 </li> | |
286 <li> | |
287 <a class="menu_link" title="${_('Pull requests')}" href="${h.url('pullrequest_show_all',repo_name=c.repo_name)}"> | |
288 <span class="icon_short"> | |
289 <img src="${h.url('/images/icons/arrow_join.png')}" alt="${_('Pull requests')}" /> | |
290 </span> | |
291 <span class="short">${c.repository_pull_requests}</span> | |
292 </a> | 321 </a> |
293 </li> | 322 </li> |
294 ${usermenu()} | 323 ${usermenu()} |
295 <script type="text/javascript"> | 324 <script type="text/javascript"> |
296 YUE.on('branch_tag_switcher','mouseover',function(){ | 325 YUE.on('branch_tag_switcher','mouseover',function(){ |