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