##// END OF EJS Templates
navigation: remove # from url in options navigation entry....
marcink -
r1783:8b9b6ea1 default
parent child Browse files
Show More
@@ -1,602 +1,604 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="root.mako"/>
2 <%inherit file="root.mako"/>
3
3
4 <div class="outerwrapper">
4 <div class="outerwrapper">
5 <!-- HEADER -->
5 <!-- HEADER -->
6 <div class="header">
6 <div class="header">
7 <div id="header-inner" class="wrapper">
7 <div id="header-inner" class="wrapper">
8 <div id="logo">
8 <div id="logo">
9 <div class="logo-wrapper">
9 <div class="logo-wrapper">
10 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-216x60.png')}" alt="RhodeCode"/></a>
10 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-216x60.png')}" alt="RhodeCode"/></a>
11 </div>
11 </div>
12 %if c.rhodecode_name:
12 %if c.rhodecode_name:
13 <div class="branding">- ${h.branding(c.rhodecode_name)}</div>
13 <div class="branding">- ${h.branding(c.rhodecode_name)}</div>
14 %endif
14 %endif
15 </div>
15 </div>
16 <!-- MENU BAR NAV -->
16 <!-- MENU BAR NAV -->
17 ${self.menu_bar_nav()}
17 ${self.menu_bar_nav()}
18 <!-- END MENU BAR NAV -->
18 <!-- END MENU BAR NAV -->
19 </div>
19 </div>
20 </div>
20 </div>
21 ${self.menu_bar_subnav()}
21 ${self.menu_bar_subnav()}
22 <!-- END HEADER -->
22 <!-- END HEADER -->
23
23
24 <!-- CONTENT -->
24 <!-- CONTENT -->
25 <div id="content" class="wrapper">
25 <div id="content" class="wrapper">
26
26
27 <rhodecode-toast id="notifications"></rhodecode-toast>
27 <rhodecode-toast id="notifications"></rhodecode-toast>
28
28
29 <div class="main">
29 <div class="main">
30 ${next.main()}
30 ${next.main()}
31 </div>
31 </div>
32 </div>
32 </div>
33 <!-- END CONTENT -->
33 <!-- END CONTENT -->
34
34
35 </div>
35 </div>
36 <!-- FOOTER -->
36 <!-- FOOTER -->
37 <div id="footer">
37 <div id="footer">
38 <div id="footer-inner" class="title wrapper">
38 <div id="footer-inner" class="title wrapper">
39 <div>
39 <div>
40 <p class="footer-link-right">
40 <p class="footer-link-right">
41 % if c.visual.show_version:
41 % if c.visual.show_version:
42 RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition}
42 RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition}
43 % endif
43 % endif
44 &copy; 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
44 &copy; 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
45 % if c.visual.rhodecode_support_url:
45 % if c.visual.rhodecode_support_url:
46 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
46 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
47 % endif
47 % endif
48 </p>
48 </p>
49 <% sid = 'block' if request.GET.get('showrcid') else 'none' %>
49 <% sid = 'block' if request.GET.get('showrcid') else 'none' %>
50 <p class="server-instance" style="display:${sid}">
50 <p class="server-instance" style="display:${sid}">
51 ## display hidden instance ID if specially defined
51 ## display hidden instance ID if specially defined
52 % if c.rhodecode_instanceid:
52 % if c.rhodecode_instanceid:
53 ${_('RhodeCode instance id: %s') % c.rhodecode_instanceid}
53 ${_('RhodeCode instance id: %s') % c.rhodecode_instanceid}
54 % endif
54 % endif
55 </p>
55 </p>
56 </div>
56 </div>
57 </div>
57 </div>
58 </div>
58 </div>
59
59
60 <!-- END FOOTER -->
60 <!-- END FOOTER -->
61
61
62 ### MAKO DEFS ###
62 ### MAKO DEFS ###
63
63
64 <%def name="menu_bar_subnav()">
64 <%def name="menu_bar_subnav()">
65 </%def>
65 </%def>
66
66
67 <%def name="breadcrumbs(class_='breadcrumbs')">
67 <%def name="breadcrumbs(class_='breadcrumbs')">
68 <div class="${class_}">
68 <div class="${class_}">
69 ${self.breadcrumbs_links()}
69 ${self.breadcrumbs_links()}
70 </div>
70 </div>
71 </%def>
71 </%def>
72
72
73 <%def name="admin_menu()">
73 <%def name="admin_menu()">
74 <ul class="admin_menu submenu">
74 <ul class="admin_menu submenu">
75 <li><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
75 <li><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
76 <li><a href="${h.url('repos')}">${_('Repositories')}</a></li>
76 <li><a href="${h.url('repos')}">${_('Repositories')}</a></li>
77 <li><a href="${h.url('repo_groups')}">${_('Repository groups')}</a></li>
77 <li><a href="${h.url('repo_groups')}">${_('Repository groups')}</a></li>
78 <li><a href="${h.route_path('users')}">${_('Users')}</a></li>
78 <li><a href="${h.route_path('users')}">${_('Users')}</a></li>
79 <li><a href="${h.url('users_groups')}">${_('User groups')}</a></li>
79 <li><a href="${h.url('users_groups')}">${_('User groups')}</a></li>
80 <li><a href="${h.url('admin_permissions_application')}">${_('Permissions')}</a></li>
80 <li><a href="${h.url('admin_permissions_application')}">${_('Permissions')}</a></li>
81 <li><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
81 <li><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
82 <li><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
82 <li><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
83 <li><a href="${h.url('admin_defaults_repositories')}">${_('Defaults')}</a></li>
83 <li><a href="${h.url('admin_defaults_repositories')}">${_('Defaults')}</a></li>
84 <li class="last"><a href="${h.url('admin_settings')}">${_('Settings')}</a></li>
84 <li class="last"><a href="${h.url('admin_settings')}">${_('Settings')}</a></li>
85 </ul>
85 </ul>
86 </%def>
86 </%def>
87
87
88
88
89 <%def name="dt_info_panel(elements)">
89 <%def name="dt_info_panel(elements)">
90 <dl class="dl-horizontal">
90 <dl class="dl-horizontal">
91 %for dt, dd, title, show_items in elements:
91 %for dt, dd, title, show_items in elements:
92 <dt>${dt}:</dt>
92 <dt>${dt}:</dt>
93 <dd title="${title}">
93 <dd title="${title}">
94 %if callable(dd):
94 %if callable(dd):
95 ## allow lazy evaluation of elements
95 ## allow lazy evaluation of elements
96 ${dd()}
96 ${dd()}
97 %else:
97 %else:
98 ${dd}
98 ${dd}
99 %endif
99 %endif
100 %if show_items:
100 %if show_items:
101 <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span>
101 <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span>
102 %endif
102 %endif
103 </dd>
103 </dd>
104
104
105 %if show_items:
105 %if show_items:
106 <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none">
106 <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none">
107 %for item in show_items:
107 %for item in show_items:
108 <dt></dt>
108 <dt></dt>
109 <dd>${item}</dd>
109 <dd>${item}</dd>
110 %endfor
110 %endfor
111 </div>
111 </div>
112 %endif
112 %endif
113
113
114 %endfor
114 %endfor
115 </dl>
115 </dl>
116 </%def>
116 </%def>
117
117
118
118
119 <%def name="gravatar(email, size=16)">
119 <%def name="gravatar(email, size=16)">
120 <%
120 <%
121 if (size > 16):
121 if (size > 16):
122 gravatar_class = 'gravatar gravatar-large'
122 gravatar_class = 'gravatar gravatar-large'
123 else:
123 else:
124 gravatar_class = 'gravatar'
124 gravatar_class = 'gravatar'
125 %>
125 %>
126 <%doc>
126 <%doc>
127 TODO: johbo: For now we serve double size images to make it smooth
127 TODO: johbo: For now we serve double size images to make it smooth
128 for retina. This is how it worked until now. Should be replaced
128 for retina. This is how it worked until now. Should be replaced
129 with a better solution at some point.
129 with a better solution at some point.
130 </%doc>
130 </%doc>
131 <img class="${gravatar_class}" src="${h.gravatar_url(email, size * 2)}" height="${size}" width="${size}">
131 <img class="${gravatar_class}" src="${h.gravatar_url(email, size * 2)}" height="${size}" width="${size}">
132 </%def>
132 </%def>
133
133
134
134
135 <%def name="gravatar_with_user(contact, size=16, show_disabled=False)">
135 <%def name="gravatar_with_user(contact, size=16, show_disabled=False)">
136 <% email = h.email_or_none(contact) %>
136 <% email = h.email_or_none(contact) %>
137 <div class="rc-user tooltip" title="${h.author_string(email)}">
137 <div class="rc-user tooltip" title="${h.author_string(email)}">
138 ${self.gravatar(email, size)}
138 ${self.gravatar(email, size)}
139 <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span>
139 <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span>
140 </div>
140 </div>
141 </%def>
141 </%def>
142
142
143
143
144 ## admin menu used for people that have some admin resources
144 ## admin menu used for people that have some admin resources
145 <%def name="admin_menu_simple(repositories=None, repository_groups=None, user_groups=None)">
145 <%def name="admin_menu_simple(repositories=None, repository_groups=None, user_groups=None)">
146 <ul class="submenu">
146 <ul class="submenu">
147 %if repositories:
147 %if repositories:
148 <li class="local-admin-repos"><a href="${h.url('repos')}">${_('Repositories')}</a></li>
148 <li class="local-admin-repos"><a href="${h.url('repos')}">${_('Repositories')}</a></li>
149 %endif
149 %endif
150 %if repository_groups:
150 %if repository_groups:
151 <li class="local-admin-repo-groups"><a href="${h.url('repo_groups')}">${_('Repository groups')}</a></li>
151 <li class="local-admin-repo-groups"><a href="${h.url('repo_groups')}">${_('Repository groups')}</a></li>
152 %endif
152 %endif
153 %if user_groups:
153 %if user_groups:
154 <li class="local-admin-user-groups"><a href="${h.url('users_groups')}">${_('User groups')}</a></li>
154 <li class="local-admin-user-groups"><a href="${h.url('users_groups')}">${_('User groups')}</a></li>
155 %endif
155 %endif
156 </ul>
156 </ul>
157 </%def>
157 </%def>
158
158
159 <%def name="repo_page_title(repo_instance)">
159 <%def name="repo_page_title(repo_instance)">
160 <div class="title-content">
160 <div class="title-content">
161 <div class="title-main">
161 <div class="title-main">
162 ## SVN/HG/GIT icons
162 ## SVN/HG/GIT icons
163 %if h.is_hg(repo_instance):
163 %if h.is_hg(repo_instance):
164 <i class="icon-hg"></i>
164 <i class="icon-hg"></i>
165 %endif
165 %endif
166 %if h.is_git(repo_instance):
166 %if h.is_git(repo_instance):
167 <i class="icon-git"></i>
167 <i class="icon-git"></i>
168 %endif
168 %endif
169 %if h.is_svn(repo_instance):
169 %if h.is_svn(repo_instance):
170 <i class="icon-svn"></i>
170 <i class="icon-svn"></i>
171 %endif
171 %endif
172
172
173 ## public/private
173 ## public/private
174 %if repo_instance.private:
174 %if repo_instance.private:
175 <i class="icon-repo-private"></i>
175 <i class="icon-repo-private"></i>
176 %else:
176 %else:
177 <i class="icon-repo-public"></i>
177 <i class="icon-repo-public"></i>
178 %endif
178 %endif
179
179
180 ## repo name with group name
180 ## repo name with group name
181 ${h.breadcrumb_repo_link(c.rhodecode_db_repo)}
181 ${h.breadcrumb_repo_link(c.rhodecode_db_repo)}
182
182
183 </div>
183 </div>
184
184
185 ## FORKED
185 ## FORKED
186 %if repo_instance.fork:
186 %if repo_instance.fork:
187 <p>
187 <p>
188 <i class="icon-code-fork"></i> ${_('Fork of')}
188 <i class="icon-code-fork"></i> ${_('Fork of')}
189 <a href="${h.url('summary_home',repo_name=repo_instance.fork.repo_name)}">${repo_instance.fork.repo_name}</a>
189 <a href="${h.url('summary_home',repo_name=repo_instance.fork.repo_name)}">${repo_instance.fork.repo_name}</a>
190 </p>
190 </p>
191 %endif
191 %endif
192
192
193 ## IMPORTED FROM REMOTE
193 ## IMPORTED FROM REMOTE
194 %if repo_instance.clone_uri:
194 %if repo_instance.clone_uri:
195 <p>
195 <p>
196 <i class="icon-code-fork"></i> ${_('Clone from')}
196 <i class="icon-code-fork"></i> ${_('Clone from')}
197 <a href="${h.url(h.safe_str(h.hide_credentials(repo_instance.clone_uri)))}">${h.hide_credentials(repo_instance.clone_uri)}</a>
197 <a href="${h.url(h.safe_str(h.hide_credentials(repo_instance.clone_uri)))}">${h.hide_credentials(repo_instance.clone_uri)}</a>
198 </p>
198 </p>
199 %endif
199 %endif
200
200
201 ## LOCKING STATUS
201 ## LOCKING STATUS
202 %if repo_instance.locked[0]:
202 %if repo_instance.locked[0]:
203 <p class="locking_locked">
203 <p class="locking_locked">
204 <i class="icon-repo-lock"></i>
204 <i class="icon-repo-lock"></i>
205 ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}}
205 ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}}
206 </p>
206 </p>
207 %elif repo_instance.enable_locking:
207 %elif repo_instance.enable_locking:
208 <p class="locking_unlocked">
208 <p class="locking_unlocked">
209 <i class="icon-repo-unlock"></i>
209 <i class="icon-repo-unlock"></i>
210 ${_('Repository not locked. Pull repository to lock it.')}
210 ${_('Repository not locked. Pull repository to lock it.')}
211 </p>
211 </p>
212 %endif
212 %endif
213
213
214 </div>
214 </div>
215 </%def>
215 </%def>
216
216
217 <%def name="repo_menu(active=None)">
217 <%def name="repo_menu(active=None)">
218 <%
218 <%
219 def is_active(selected):
219 def is_active(selected):
220 if selected == active:
220 if selected == active:
221 return "active"
221 return "active"
222 %>
222 %>
223
223
224 <!--- CONTEXT BAR -->
224 <!--- CONTEXT BAR -->
225 <div id="context-bar">
225 <div id="context-bar">
226 <div class="wrapper">
226 <div class="wrapper">
227 <ul id="context-pages" class="horizontal-list navigation">
227 <ul id="context-pages" class="horizontal-list navigation">
228 <li class="${is_active('summary')}"><a class="menulink" href="${h.url('summary_home', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li>
228 <li class="${is_active('summary')}"><a class="menulink" href="${h.url('summary_home', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li>
229 <li class="${is_active('changelog')}"><a class="menulink" href="${h.url('changelog_home', repo_name=c.repo_name)}"><div class="menulabel">${_('Changelog')}</div></a></li>
229 <li class="${is_active('changelog')}"><a class="menulink" href="${h.url('changelog_home', repo_name=c.repo_name)}"><div class="menulabel">${_('Changelog')}</div></a></li>
230 <li class="${is_active('files')}"><a class="menulink" href="${h.url('files_home', repo_name=c.repo_name, revision=c.rhodecode_db_repo.landing_rev[1])}"><div class="menulabel">${_('Files')}</div></a></li>
230 <li class="${is_active('files')}"><a class="menulink" href="${h.url('files_home', repo_name=c.repo_name, revision=c.rhodecode_db_repo.landing_rev[1])}"><div class="menulabel">${_('Files')}</div></a></li>
231 <li class="${is_active('compare')}">
231 <li class="${is_active('compare')}">
232 <a class="menulink" href="${h.url('compare_home',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a>
232 <a class="menulink" href="${h.url('compare_home',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a>
233 </li>
233 </li>
234 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
234 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
235 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
235 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
236 <li class="${is_active('showpullrequest')}">
236 <li class="${is_active('showpullrequest')}">
237 <a class="menulink" href="${h.route_path('pullrequest_show_all', repo_name=c.repo_name)}" title="${_('Show Pull Requests for %s') % c.repo_name}">
237 <a class="menulink" href="${h.route_path('pullrequest_show_all', repo_name=c.repo_name)}" title="${_('Show Pull Requests for %s') % c.repo_name}">
238 %if c.repository_pull_requests:
238 %if c.repository_pull_requests:
239 <span class="pr_notifications">${c.repository_pull_requests}</span>
239 <span class="pr_notifications">${c.repository_pull_requests}</span>
240 %endif
240 %endif
241 <div class="menulabel">${_('Pull Requests')}</div>
241 <div class="menulabel">${_('Pull Requests')}</div>
242 </a>
242 </a>
243 </li>
243 </li>
244 %endif
244 %endif
245 <li class="${is_active('options')}">
245 <li class="${is_active('options')}">
246 <a class="menulink" href="#" class="dropdown"><div class="menulabel">${_('Options')} <div class="show_more"></div></div></a>
246 <a class="menulink dropdown">
247 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
248 </a>
247 <ul class="submenu">
249 <ul class="submenu">
248 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
250 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
249 <li><a href="${h.route_path('edit_repo',repo_name=c.repo_name)}">${_('Settings')}</a></li>
251 <li><a href="${h.route_path('edit_repo',repo_name=c.repo_name)}">${_('Settings')}</a></li>
250 %endif
252 %endif
251 %if c.rhodecode_db_repo.fork:
253 %if c.rhodecode_db_repo.fork:
252 <li><a href="${h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,source_ref_type=c.rhodecode_db_repo.landing_rev[0],source_ref=c.rhodecode_db_repo.landing_rev[1], target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0],target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1], merge=1)}">
254 <li><a href="${h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,source_ref_type=c.rhodecode_db_repo.landing_rev[0],source_ref=c.rhodecode_db_repo.landing_rev[1], target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0],target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1], merge=1)}">
253 ${_('Compare fork')}</a></li>
255 ${_('Compare fork')}</a></li>
254 %endif
256 %endif
255
257
256 <li><a href="${h.route_path('search_repo',repo_name=c.repo_name)}">${_('Search')}</a></li>
258 <li><a href="${h.route_path('search_repo',repo_name=c.repo_name)}">${_('Search')}</a></li>
257
259
258 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking:
260 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking:
259 %if c.rhodecode_db_repo.locked[0]:
261 %if c.rhodecode_db_repo.locked[0]:
260 <li><a class="locking_del" href="${h.url('toggle_locking',repo_name=c.repo_name)}">${_('Unlock')}</a></li>
262 <li><a class="locking_del" href="${h.url('toggle_locking',repo_name=c.repo_name)}">${_('Unlock')}</a></li>
261 %else:
263 %else:
262 <li><a class="locking_add" href="${h.url('toggle_locking',repo_name=c.repo_name)}">${_('Lock')}</a></li>
264 <li><a class="locking_add" href="${h.url('toggle_locking',repo_name=c.repo_name)}">${_('Lock')}</a></li>
263 %endif
265 %endif
264 %endif
266 %endif
265 %if c.rhodecode_user.username != h.DEFAULT_USER:
267 %if c.rhodecode_user.username != h.DEFAULT_USER:
266 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
268 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
267 <li><a href="${h.url('repo_fork_home',repo_name=c.repo_name)}">${_('Fork')}</a></li>
269 <li><a href="${h.url('repo_fork_home',repo_name=c.repo_name)}">${_('Fork')}</a></li>
268 <li><a href="${h.url('pullrequest_home',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li>
270 <li><a href="${h.url('pullrequest_home',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li>
269 %endif
271 %endif
270 %endif
272 %endif
271 </ul>
273 </ul>
272 </li>
274 </li>
273 </ul>
275 </ul>
274 </div>
276 </div>
275 <div class="clear"></div>
277 <div class="clear"></div>
276 </div>
278 </div>
277 <!--- END CONTEXT BAR -->
279 <!--- END CONTEXT BAR -->
278
280
279 </%def>
281 </%def>
280
282
281 <%def name="usermenu(active=False)">
283 <%def name="usermenu(active=False)">
282 ## USER MENU
284 ## USER MENU
283 <li id="quick_login_li" class="${'active' if active else ''}">
285 <li id="quick_login_li" class="${'active' if active else ''}">
284 <a id="quick_login_link" class="menulink childs">
286 <a id="quick_login_link" class="menulink childs">
285 ${gravatar(c.rhodecode_user.email, 20)}
287 ${gravatar(c.rhodecode_user.email, 20)}
286 <span class="user">
288 <span class="user">
287 %if c.rhodecode_user.username != h.DEFAULT_USER:
289 %if c.rhodecode_user.username != h.DEFAULT_USER:
288 <span class="menu_link_user">${c.rhodecode_user.username}</span><div class="show_more"></div>
290 <span class="menu_link_user">${c.rhodecode_user.username}</span><div class="show_more"></div>
289 %else:
291 %else:
290 <span>${_('Sign in')}</span>
292 <span>${_('Sign in')}</span>
291 %endif
293 %endif
292 </span>
294 </span>
293 </a>
295 </a>
294
296
295 <div class="user-menu submenu">
297 <div class="user-menu submenu">
296 <div id="quick_login">
298 <div id="quick_login">
297 %if c.rhodecode_user.username == h.DEFAULT_USER:
299 %if c.rhodecode_user.username == h.DEFAULT_USER:
298 <h4>${_('Sign in to your account')}</h4>
300 <h4>${_('Sign in to your account')}</h4>
299 ${h.form(h.route_path('login', _query={'came_from': h.url.current()}), needs_csrf_token=False)}
301 ${h.form(h.route_path('login', _query={'came_from': h.url.current()}), needs_csrf_token=False)}
300 <div class="form form-vertical">
302 <div class="form form-vertical">
301 <div class="fields">
303 <div class="fields">
302 <div class="field">
304 <div class="field">
303 <div class="label">
305 <div class="label">
304 <label for="username">${_('Username')}:</label>
306 <label for="username">${_('Username')}:</label>
305 </div>
307 </div>
306 <div class="input">
308 <div class="input">
307 ${h.text('username',class_='focus',tabindex=1)}
309 ${h.text('username',class_='focus',tabindex=1)}
308 </div>
310 </div>
309
311
310 </div>
312 </div>
311 <div class="field">
313 <div class="field">
312 <div class="label">
314 <div class="label">
313 <label for="password">${_('Password')}:</label>
315 <label for="password">${_('Password')}:</label>
314 %if h.HasPermissionAny('hg.password_reset.enabled')():
316 %if h.HasPermissionAny('hg.password_reset.enabled')():
315 <span class="forgot_password">${h.link_to(_('(Forgot password?)'),h.route_path('reset_password'), class_='pwd_reset')}</span>
317 <span class="forgot_password">${h.link_to(_('(Forgot password?)'),h.route_path('reset_password'), class_='pwd_reset')}</span>
316 %endif
318 %endif
317 </div>
319 </div>
318 <div class="input">
320 <div class="input">
319 ${h.password('password',class_='focus',tabindex=2)}
321 ${h.password('password',class_='focus',tabindex=2)}
320 </div>
322 </div>
321 </div>
323 </div>
322 <div class="buttons">
324 <div class="buttons">
323 <div class="register">
325 <div class="register">
324 %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
326 %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
325 ${h.link_to(_("Don't have an account?"),h.route_path('register'))} <br/>
327 ${h.link_to(_("Don't have an account?"),h.route_path('register'))} <br/>
326 %endif
328 %endif
327 ${h.link_to(_("Using external auth? Sign In here."),h.route_path('login'))}
329 ${h.link_to(_("Using external auth? Sign In here."),h.route_path('login'))}
328 </div>
330 </div>
329 <div class="submit">
331 <div class="submit">
330 ${h.submit('sign_in',_('Sign In'),class_="btn btn-small",tabindex=3)}
332 ${h.submit('sign_in',_('Sign In'),class_="btn btn-small",tabindex=3)}
331 </div>
333 </div>
332 </div>
334 </div>
333 </div>
335 </div>
334 </div>
336 </div>
335 ${h.end_form()}
337 ${h.end_form()}
336 %else:
338 %else:
337 <div class="">
339 <div class="">
338 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
340 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
339 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
341 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
340 <div class="email">${c.rhodecode_user.email}</div>
342 <div class="email">${c.rhodecode_user.email}</div>
341 </div>
343 </div>
342 <div class="">
344 <div class="">
343 <ol class="links">
345 <ol class="links">
344 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
346 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
345 % if c.rhodecode_user.personal_repo_group:
347 % if c.rhodecode_user.personal_repo_group:
346 <li>${h.link_to(_(u'My personal group'), h.route_path('repo_group_home', repo_group_name=c.rhodecode_user.personal_repo_group.group_name))}</li>
348 <li>${h.link_to(_(u'My personal group'), h.route_path('repo_group_home', repo_group_name=c.rhodecode_user.personal_repo_group.group_name))}</li>
347 % endif
349 % endif
348 <li class="logout">
350 <li class="logout">
349 ${h.secure_form(h.route_path('logout'))}
351 ${h.secure_form(h.route_path('logout'))}
350 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
352 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
351 ${h.end_form()}
353 ${h.end_form()}
352 </li>
354 </li>
353 </ol>
355 </ol>
354 </div>
356 </div>
355 %endif
357 %endif
356 </div>
358 </div>
357 </div>
359 </div>
358 %if c.rhodecode_user.username != h.DEFAULT_USER:
360 %if c.rhodecode_user.username != h.DEFAULT_USER:
359 <div class="pill_container">
361 <div class="pill_container">
360 % if c.unread_notifications == 0:
362 % if c.unread_notifications == 0:
361 <a class="menu_link_notifications empty" href="${h.url('notifications')}">${c.unread_notifications}</a>
363 <a class="menu_link_notifications empty" href="${h.url('notifications')}">${c.unread_notifications}</a>
362 % else:
364 % else:
363 <a class="menu_link_notifications" href="${h.url('notifications')}">${c.unread_notifications}</a>
365 <a class="menu_link_notifications" href="${h.url('notifications')}">${c.unread_notifications}</a>
364 % endif
366 % endif
365 </div>
367 </div>
366 % endif
368 % endif
367 </li>
369 </li>
368 </%def>
370 </%def>
369
371
370 <%def name="menu_items(active=None)">
372 <%def name="menu_items(active=None)">
371 <%
373 <%
372 def is_active(selected):
374 def is_active(selected):
373 if selected == active:
375 if selected == active:
374 return "active"
376 return "active"
375 return ""
377 return ""
376 %>
378 %>
377 <ul id="quick" class="main_nav navigation horizontal-list">
379 <ul id="quick" class="main_nav navigation horizontal-list">
378 <!-- repo switcher -->
380 <!-- repo switcher -->
379 <li class="${is_active('repositories')} repo_switcher_li has_select2">
381 <li class="${is_active('repositories')} repo_switcher_li has_select2">
380 <input id="repo_switcher" name="repo_switcher" type="hidden">
382 <input id="repo_switcher" name="repo_switcher" type="hidden">
381 </li>
383 </li>
382
384
383 ## ROOT MENU
385 ## ROOT MENU
384 %if c.rhodecode_user.username != h.DEFAULT_USER:
386 %if c.rhodecode_user.username != h.DEFAULT_USER:
385 <li class="${is_active('journal')}">
387 <li class="${is_active('journal')}">
386 <a class="menulink" title="${_('Show activity journal')}" href="${h.url('journal')}">
388 <a class="menulink" title="${_('Show activity journal')}" href="${h.url('journal')}">
387 <div class="menulabel">${_('Journal')}</div>
389 <div class="menulabel">${_('Journal')}</div>
388 </a>
390 </a>
389 </li>
391 </li>
390 %else:
392 %else:
391 <li class="${is_active('journal')}">
393 <li class="${is_active('journal')}">
392 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.url('public_journal')}">
394 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.url('public_journal')}">
393 <div class="menulabel">${_('Public journal')}</div>
395 <div class="menulabel">${_('Public journal')}</div>
394 </a>
396 </a>
395 </li>
397 </li>
396 %endif
398 %endif
397 <li class="${is_active('gists')}">
399 <li class="${is_active('gists')}">
398 <a class="menulink childs" title="${_('Show Gists')}" href="${h.url('gists')}">
400 <a class="menulink childs" title="${_('Show Gists')}" href="${h.url('gists')}">
399 <div class="menulabel">${_('Gists')}</div>
401 <div class="menulabel">${_('Gists')}</div>
400 </a>
402 </a>
401 </li>
403 </li>
402 <li class="${is_active('search')}">
404 <li class="${is_active('search')}">
403 <a class="menulink" title="${_('Search in repositories you have access to')}" href="${h.route_path('search')}">
405 <a class="menulink" title="${_('Search in repositories you have access to')}" href="${h.route_path('search')}">
404 <div class="menulabel">${_('Search')}</div>
406 <div class="menulabel">${_('Search')}</div>
405 </a>
407 </a>
406 </li>
408 </li>
407 % if h.HasPermissionAll('hg.admin')('access admin main page'):
409 % if h.HasPermissionAll('hg.admin')('access admin main page'):
408 <li class="${is_active('admin')}">
410 <li class="${is_active('admin')}">
409 <a class="menulink childs" title="${_('Admin settings')}" href="#" onclick="return false;">
411 <a class="menulink childs" title="${_('Admin settings')}" href="#" onclick="return false;">
410 <div class="menulabel">${_('Admin')} <div class="show_more"></div></div>
412 <div class="menulabel">${_('Admin')} <div class="show_more"></div></div>
411 </a>
413 </a>
412 ${admin_menu()}
414 ${admin_menu()}
413 </li>
415 </li>
414 % elif c.rhodecode_user.repositories_admin or c.rhodecode_user.repository_groups_admin or c.rhodecode_user.user_groups_admin:
416 % elif c.rhodecode_user.repositories_admin or c.rhodecode_user.repository_groups_admin or c.rhodecode_user.user_groups_admin:
415 <li class="${is_active('admin')}">
417 <li class="${is_active('admin')}">
416 <a class="menulink childs" title="${_('Delegated Admin settings')}">
418 <a class="menulink childs" title="${_('Delegated Admin settings')}">
417 <div class="menulabel">${_('Admin')} <div class="show_more"></div></div>
419 <div class="menulabel">${_('Admin')} <div class="show_more"></div></div>
418 </a>
420 </a>
419 ${admin_menu_simple(c.rhodecode_user.repositories_admin,
421 ${admin_menu_simple(c.rhodecode_user.repositories_admin,
420 c.rhodecode_user.repository_groups_admin,
422 c.rhodecode_user.repository_groups_admin,
421 c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')())}
423 c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')())}
422 </li>
424 </li>
423 % endif
425 % endif
424 % if c.debug_style:
426 % if c.debug_style:
425 <li class="${is_active('debug_style')}">
427 <li class="${is_active('debug_style')}">
426 <a class="menulink" title="${_('Style')}" href="${h.url('debug_style_home')}">
428 <a class="menulink" title="${_('Style')}" href="${h.url('debug_style_home')}">
427 <div class="menulabel">${_('Style')}</div>
429 <div class="menulabel">${_('Style')}</div>
428 </a>
430 </a>
429 </li>
431 </li>
430 % endif
432 % endif
431 ## render extra user menu
433 ## render extra user menu
432 ${usermenu(active=(active=='my_account'))}
434 ${usermenu(active=(active=='my_account'))}
433 </ul>
435 </ul>
434
436
435 <script type="text/javascript">
437 <script type="text/javascript">
436 var visual_show_public_icon = "${c.visual.show_public_icon}" == "True";
438 var visual_show_public_icon = "${c.visual.show_public_icon}" == "True";
437
439
438 /*format the look of items in the list*/
440 /*format the look of items in the list*/
439 var format = function(state, escapeMarkup){
441 var format = function(state, escapeMarkup){
440 if (!state.id){
442 if (!state.id){
441 return state.text; // optgroup
443 return state.text; // optgroup
442 }
444 }
443 var obj_dict = state.obj;
445 var obj_dict = state.obj;
444 var tmpl = '';
446 var tmpl = '';
445
447
446 if(obj_dict && state.type == 'repo'){
448 if(obj_dict && state.type == 'repo'){
447 if(obj_dict['repo_type'] === 'hg'){
449 if(obj_dict['repo_type'] === 'hg'){
448 tmpl += '<i class="icon-hg"></i> ';
450 tmpl += '<i class="icon-hg"></i> ';
449 }
451 }
450 else if(obj_dict['repo_type'] === 'git'){
452 else if(obj_dict['repo_type'] === 'git'){
451 tmpl += '<i class="icon-git"></i> ';
453 tmpl += '<i class="icon-git"></i> ';
452 }
454 }
453 else if(obj_dict['repo_type'] === 'svn'){
455 else if(obj_dict['repo_type'] === 'svn'){
454 tmpl += '<i class="icon-svn"></i> ';
456 tmpl += '<i class="icon-svn"></i> ';
455 }
457 }
456 if(obj_dict['private']){
458 if(obj_dict['private']){
457 tmpl += '<i class="icon-lock" ></i> ';
459 tmpl += '<i class="icon-lock" ></i> ';
458 }
460 }
459 else if(visual_show_public_icon){
461 else if(visual_show_public_icon){
460 tmpl += '<i class="icon-unlock-alt"></i> ';
462 tmpl += '<i class="icon-unlock-alt"></i> ';
461 }
463 }
462 }
464 }
463 if(obj_dict && state.type == 'commit') {
465 if(obj_dict && state.type == 'commit') {
464 tmpl += '<i class="icon-tag"></i>';
466 tmpl += '<i class="icon-tag"></i>';
465 }
467 }
466 if(obj_dict && state.type == 'group'){
468 if(obj_dict && state.type == 'group'){
467 tmpl += '<i class="icon-folder-close"></i> ';
469 tmpl += '<i class="icon-folder-close"></i> ';
468 }
470 }
469 tmpl += escapeMarkup(state.text);
471 tmpl += escapeMarkup(state.text);
470 return tmpl;
472 return tmpl;
471 };
473 };
472
474
473 var formatResult = function(result, container, query, escapeMarkup) {
475 var formatResult = function(result, container, query, escapeMarkup) {
474 return format(result, escapeMarkup);
476 return format(result, escapeMarkup);
475 };
477 };
476
478
477 var formatSelection = function(data, container, escapeMarkup) {
479 var formatSelection = function(data, container, escapeMarkup) {
478 return format(data, escapeMarkup);
480 return format(data, escapeMarkup);
479 };
481 };
480
482
481 $("#repo_switcher").select2({
483 $("#repo_switcher").select2({
482 cachedDataSource: {},
484 cachedDataSource: {},
483 minimumInputLength: 2,
485 minimumInputLength: 2,
484 placeholder: '<div class="menulabel">${_('Go to')} <div class="show_more"></div></div>',
486 placeholder: '<div class="menulabel">${_('Go to')} <div class="show_more"></div></div>',
485 dropdownAutoWidth: true,
487 dropdownAutoWidth: true,
486 formatResult: formatResult,
488 formatResult: formatResult,
487 formatSelection: formatSelection,
489 formatSelection: formatSelection,
488 containerCssClass: "repo-switcher",
490 containerCssClass: "repo-switcher",
489 dropdownCssClass: "repo-switcher-dropdown",
491 dropdownCssClass: "repo-switcher-dropdown",
490 escapeMarkup: function(m){
492 escapeMarkup: function(m){
491 // don't escape our custom placeholder
493 // don't escape our custom placeholder
492 if(m.substr(0,23) == '<div class="menulabel">'){
494 if(m.substr(0,23) == '<div class="menulabel">'){
493 return m;
495 return m;
494 }
496 }
495
497
496 return Select2.util.escapeMarkup(m);
498 return Select2.util.escapeMarkup(m);
497 },
499 },
498 query: $.debounce(250, function(query){
500 query: $.debounce(250, function(query){
499 self = this;
501 self = this;
500 var cacheKey = query.term;
502 var cacheKey = query.term;
501 var cachedData = self.cachedDataSource[cacheKey];
503 var cachedData = self.cachedDataSource[cacheKey];
502
504
503 if (cachedData) {
505 if (cachedData) {
504 query.callback({results: cachedData.results});
506 query.callback({results: cachedData.results});
505 } else {
507 } else {
506 $.ajax({
508 $.ajax({
507 url: pyroutes.url('goto_switcher_data'),
509 url: pyroutes.url('goto_switcher_data'),
508 data: {'query': query.term},
510 data: {'query': query.term},
509 dataType: 'json',
511 dataType: 'json',
510 type: 'GET',
512 type: 'GET',
511 success: function(data) {
513 success: function(data) {
512 self.cachedDataSource[cacheKey] = data;
514 self.cachedDataSource[cacheKey] = data;
513 query.callback({results: data.results});
515 query.callback({results: data.results});
514 },
516 },
515 error: function(data, textStatus, errorThrown) {
517 error: function(data, textStatus, errorThrown) {
516 alert("Error while fetching entries.\nError code {0} ({1}).".format(data.status, data.statusText));
518 alert("Error while fetching entries.\nError code {0} ({1}).".format(data.status, data.statusText));
517 }
519 }
518 })
520 })
519 }
521 }
520 })
522 })
521 });
523 });
522
524
523 $("#repo_switcher").on('select2-selecting', function(e){
525 $("#repo_switcher").on('select2-selecting', function(e){
524 e.preventDefault();
526 e.preventDefault();
525 window.location = e.choice.url;
527 window.location = e.choice.url;
526 });
528 });
527
529
528 </script>
530 </script>
529 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
531 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
530 </%def>
532 </%def>
531
533
532 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
534 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
533 <div class="modal-dialog">
535 <div class="modal-dialog">
534 <div class="modal-content">
536 <div class="modal-content">
535 <div class="modal-header">
537 <div class="modal-header">
536 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
538 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
537 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
539 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
538 </div>
540 </div>
539 <div class="modal-body">
541 <div class="modal-body">
540 <div class="block-left">
542 <div class="block-left">
541 <table class="keyboard-mappings">
543 <table class="keyboard-mappings">
542 <tbody>
544 <tbody>
543 <tr>
545 <tr>
544 <th></th>
546 <th></th>
545 <th>${_('Site-wide shortcuts')}</th>
547 <th>${_('Site-wide shortcuts')}</th>
546 </tr>
548 </tr>
547 <%
549 <%
548 elems = [
550 elems = [
549 ('/', 'Open quick search box'),
551 ('/', 'Open quick search box'),
550 ('g h', 'Goto home page'),
552 ('g h', 'Goto home page'),
551 ('g g', 'Goto my private gists page'),
553 ('g g', 'Goto my private gists page'),
552 ('g G', 'Goto my public gists page'),
554 ('g G', 'Goto my public gists page'),
553 ('n r', 'New repository page'),
555 ('n r', 'New repository page'),
554 ('n g', 'New gist page'),
556 ('n g', 'New gist page'),
555 ]
557 ]
556 %>
558 %>
557 %for key, desc in elems:
559 %for key, desc in elems:
558 <tr>
560 <tr>
559 <td class="keys">
561 <td class="keys">
560 <span class="key tag">${key}</span>
562 <span class="key tag">${key}</span>
561 </td>
563 </td>
562 <td>${desc}</td>
564 <td>${desc}</td>
563 </tr>
565 </tr>
564 %endfor
566 %endfor
565 </tbody>
567 </tbody>
566 </table>
568 </table>
567 </div>
569 </div>
568 <div class="block-left">
570 <div class="block-left">
569 <table class="keyboard-mappings">
571 <table class="keyboard-mappings">
570 <tbody>
572 <tbody>
571 <tr>
573 <tr>
572 <th></th>
574 <th></th>
573 <th>${_('Repositories')}</th>
575 <th>${_('Repositories')}</th>
574 </tr>
576 </tr>
575 <%
577 <%
576 elems = [
578 elems = [
577 ('g s', 'Goto summary page'),
579 ('g s', 'Goto summary page'),
578 ('g c', 'Goto changelog page'),
580 ('g c', 'Goto changelog page'),
579 ('g f', 'Goto files page'),
581 ('g f', 'Goto files page'),
580 ('g F', 'Goto files page with file search activated'),
582 ('g F', 'Goto files page with file search activated'),
581 ('g p', 'Goto pull requests page'),
583 ('g p', 'Goto pull requests page'),
582 ('g o', 'Goto repository settings'),
584 ('g o', 'Goto repository settings'),
583 ('g O', 'Goto repository permissions settings'),
585 ('g O', 'Goto repository permissions settings'),
584 ]
586 ]
585 %>
587 %>
586 %for key, desc in elems:
588 %for key, desc in elems:
587 <tr>
589 <tr>
588 <td class="keys">
590 <td class="keys">
589 <span class="key tag">${key}</span>
591 <span class="key tag">${key}</span>
590 </td>
592 </td>
591 <td>${desc}</td>
593 <td>${desc}</td>
592 </tr>
594 </tr>
593 %endfor
595 %endfor
594 </tbody>
596 </tbody>
595 </table>
597 </table>
596 </div>
598 </div>
597 </div>
599 </div>
598 <div class="modal-footer">
600 <div class="modal-footer">
599 </div>
601 </div>
600 </div><!-- /.modal-content -->
602 </div><!-- /.modal-content -->
601 </div><!-- /.modal-dialog -->
603 </div><!-- /.modal-dialog -->
602 </div><!-- /.modal -->
604 </div><!-- /.modal -->
General Comments 0
You need to be logged in to leave comments. Login now