##// END OF EJS Templates
add: change label for adding a repo group inside another one
marcink -
r3688:6cb3efb6 new-ui
parent child Browse files
Show More
@@ -1,962 +1,963 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-60x60.png')}" alt="RhodeCode"/></a>
12 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
13 </div>
13 </div>
14 % if c.rhodecode_name:
14 % if c.rhodecode_name:
15 <div class="branding">
15 <div class="branding">
16 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
16 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
17 </div>
17 </div>
18 % endif
18 % endif
19 </div>
19 </div>
20 <!-- MENU BAR NAV -->
20 <!-- MENU BAR NAV -->
21 ${self.menu_bar_nav()}
21 ${self.menu_bar_nav()}
22 <!-- END MENU BAR NAV -->
22 <!-- END MENU BAR NAV -->
23 </div>
23 </div>
24 </div>
24 </div>
25 ${self.menu_bar_subnav()}
25 ${self.menu_bar_subnav()}
26 <!-- END HEADER -->
26 <!-- END HEADER -->
27
27
28 <!-- CONTENT -->
28 <!-- CONTENT -->
29 <div id="content" class="wrapper">
29 <div id="content" class="wrapper">
30
30
31 <rhodecode-toast id="notifications"></rhodecode-toast>
31 <rhodecode-toast id="notifications"></rhodecode-toast>
32
32
33 <div class="main">
33 <div class="main">
34 ${next.main()}
34 ${next.main()}
35 </div>
35 </div>
36 </div>
36 </div>
37 <!-- END CONTENT -->
37 <!-- END CONTENT -->
38
38
39 </div>
39 </div>
40 <!-- FOOTER -->
40 <!-- FOOTER -->
41 <div id="footer">
41 <div id="footer">
42 <div id="footer-inner" class="title wrapper">
42 <div id="footer-inner" class="title wrapper">
43 <div>
43 <div>
44 <p class="footer-link-right">
44 <p class="footer-link-right">
45 % if c.visual.show_version:
45 % if c.visual.show_version:
46 RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition}
46 RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition}
47 % endif
47 % endif
48 &copy; 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
48 &copy; 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
49 % if c.visual.rhodecode_support_url:
49 % if c.visual.rhodecode_support_url:
50 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
50 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
51 % endif
51 % endif
52 </p>
52 </p>
53 <% sid = 'block' if request.GET.get('showrcid') else 'none' %>
53 <% sid = 'block' if request.GET.get('showrcid') else 'none' %>
54 <p class="server-instance" style="display:${sid}">
54 <p class="server-instance" style="display:${sid}">
55 ## display hidden instance ID if specially defined
55 ## display hidden instance ID if specially defined
56 % if c.rhodecode_instanceid:
56 % if c.rhodecode_instanceid:
57 ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)}
57 ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)}
58 % endif
58 % endif
59 </p>
59 </p>
60 </div>
60 </div>
61 </div>
61 </div>
62 </div>
62 </div>
63
63
64 <!-- END FOOTER -->
64 <!-- END FOOTER -->
65
65
66 ### MAKO DEFS ###
66 ### MAKO DEFS ###
67
67
68 <%def name="menu_bar_subnav()">
68 <%def name="menu_bar_subnav()">
69 </%def>
69 </%def>
70
70
71 <%def name="breadcrumbs(class_='breadcrumbs')">
71 <%def name="breadcrumbs(class_='breadcrumbs')">
72 <div class="${class_}">
72 <div class="${class_}">
73 ${self.breadcrumbs_links()}
73 ${self.breadcrumbs_links()}
74 </div>
74 </div>
75 </%def>
75 </%def>
76
76
77 <%def name="admin_menu(active=None)">
77 <%def name="admin_menu(active=None)">
78 <%
78 <%
79 def is_active(selected):
79 def is_active(selected):
80 if selected == active:
80 if selected == active:
81 return "active"
81 return "active"
82 %>
82 %>
83
83
84 <div id="context-bar">
84 <div id="context-bar">
85 <div class="wrapper">
85 <div class="wrapper">
86 <div class="title">
86 <div class="title">
87 <div class="title-content">
87 <div class="title-content">
88 <div class="title-main">
88 <div class="title-main">
89 % if c.is_super_admin:
89 % if c.is_super_admin:
90 ${_('Super Admin Panel')}
90 ${_('Super Admin Panel')}
91 % else:
91 % else:
92 ${_('Delegated Admin Panel')}
92 ${_('Delegated Admin Panel')}
93 % endif
93 % endif
94 </div>
94 </div>
95 </div>
95 </div>
96 </div>
96 </div>
97
97
98 <ul id="context-pages" class="navigation horizontal-list">
98 <ul id="context-pages" class="navigation horizontal-list">
99
99
100 ## super admin case
100 ## super admin case
101 % if c.is_super_admin:
101 % if c.is_super_admin:
102 <li class="${is_active('audit_logs')}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
102 <li class="${is_active('audit_logs')}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
103 <li class="${is_active('repositories')}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
103 <li class="${is_active('repositories')}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
104 <li class="${is_active('repository_groups')}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
104 <li class="${is_active('repository_groups')}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
105 <li class="${is_active('users')}"><a href="${h.route_path('users')}">${_('Users')}</a></li>
105 <li class="${is_active('users')}"><a href="${h.route_path('users')}">${_('Users')}</a></li>
106 <li class="${is_active('user_groups')}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
106 <li class="${is_active('user_groups')}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
107 <li class="${is_active('permissions')}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
107 <li class="${is_active('permissions')}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
108 <li class="${is_active('authentication')}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
108 <li class="${is_active('authentication')}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
109 <li class="${is_active('integrations')}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
109 <li class="${is_active('integrations')}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
110 <li class="${is_active('defaults')}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
110 <li class="${is_active('defaults')}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
111 <li class="${is_active('settings')}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
111 <li class="${is_active('settings')}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
112
112
113 ## delegated admin
113 ## delegated admin
114 % elif c.is_delegated_admin:
114 % elif c.is_delegated_admin:
115 <%
115 <%
116 repositories=c.auth_user.repositories_admin or c.can_create_repo
116 repositories=c.auth_user.repositories_admin or c.can_create_repo
117 repository_groups=c.auth_user.repository_groups_admin or c.can_create_repo_group
117 repository_groups=c.auth_user.repository_groups_admin or c.can_create_repo_group
118 user_groups=c.auth_user.user_groups_admin or c.can_create_user_group
118 user_groups=c.auth_user.user_groups_admin or c.can_create_user_group
119 %>
119 %>
120
120
121 %if repositories:
121 %if repositories:
122 <li class="${is_active('repositories')} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
122 <li class="${is_active('repositories')} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
123 %endif
123 %endif
124 %if repository_groups:
124 %if repository_groups:
125 <li class="${is_active('repository_groups')} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
125 <li class="${is_active('repository_groups')} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
126 %endif
126 %endif
127 %if user_groups:
127 %if user_groups:
128 <li class="${is_active('user_groups')} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
128 <li class="${is_active('user_groups')} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
129 %endif
129 %endif
130 % endif
130 % endif
131 </ul>
131 </ul>
132
132
133 </div>
133 </div>
134 <div class="clear"></div>
134 <div class="clear"></div>
135 </div>
135 </div>
136 </%def>
136 </%def>
137
137
138 <%def name="dt_info_panel(elements)">
138 <%def name="dt_info_panel(elements)">
139 <dl class="dl-horizontal">
139 <dl class="dl-horizontal">
140 %for dt, dd, title, show_items in elements:
140 %for dt, dd, title, show_items in elements:
141 <dt>${dt}:</dt>
141 <dt>${dt}:</dt>
142 <dd title="${h.tooltip(title)}">
142 <dd title="${h.tooltip(title)}">
143 %if callable(dd):
143 %if callable(dd):
144 ## allow lazy evaluation of elements
144 ## allow lazy evaluation of elements
145 ${dd()}
145 ${dd()}
146 %else:
146 %else:
147 ${dd}
147 ${dd}
148 %endif
148 %endif
149 %if show_items:
149 %if show_items:
150 <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span>
150 <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span>
151 %endif
151 %endif
152 </dd>
152 </dd>
153
153
154 %if show_items:
154 %if show_items:
155 <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none">
155 <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none">
156 %for item in show_items:
156 %for item in show_items:
157 <dt></dt>
157 <dt></dt>
158 <dd>${item}</dd>
158 <dd>${item}</dd>
159 %endfor
159 %endfor
160 </div>
160 </div>
161 %endif
161 %endif
162
162
163 %endfor
163 %endfor
164 </dl>
164 </dl>
165 </%def>
165 </%def>
166
166
167 <%def name="gravatar(email, size=16)">
167 <%def name="gravatar(email, size=16)">
168 <%
168 <%
169 if (size > 16):
169 if (size > 16):
170 gravatar_class = 'gravatar gravatar-large'
170 gravatar_class = 'gravatar gravatar-large'
171 else:
171 else:
172 gravatar_class = 'gravatar'
172 gravatar_class = 'gravatar'
173 %>
173 %>
174 <%doc>
174 <%doc>
175 TODO: johbo: For now we serve double size images to make it smooth
175 TODO: johbo: For now we serve double size images to make it smooth
176 for retina. This is how it worked until now. Should be replaced
176 for retina. This is how it worked until now. Should be replaced
177 with a better solution at some point.
177 with a better solution at some point.
178 </%doc>
178 </%doc>
179 <img class="${gravatar_class}" src="${h.gravatar_url(email, size * 2)}" height="${size}" width="${size}">
179 <img class="${gravatar_class}" src="${h.gravatar_url(email, size * 2)}" height="${size}" width="${size}">
180 </%def>
180 </%def>
181
181
182
182
183 <%def name="gravatar_with_user(contact, size=16, show_disabled=False)">
183 <%def name="gravatar_with_user(contact, size=16, show_disabled=False)">
184 <% email = h.email_or_none(contact) %>
184 <% email = h.email_or_none(contact) %>
185 <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}">
185 <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}">
186 ${self.gravatar(email, size)}
186 ${self.gravatar(email, size)}
187 <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span>
187 <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span>
188 </div>
188 </div>
189 </%def>
189 </%def>
190
190
191
191
192 <%def name="repo_page_title(repo_instance)">
192 <%def name="repo_page_title(repo_instance)">
193 <div class="title-content repo-title">
193 <div class="title-content repo-title">
194
194 <div class="title-main">
195 <div class="title-main">
195 ## SVN/HG/GIT icons
196 ## SVN/HG/GIT icons
196 %if h.is_hg(repo_instance):
197 %if h.is_hg(repo_instance):
197 <i class="icon-hg"></i>
198 <i class="icon-hg"></i>
198 %endif
199 %endif
199 %if h.is_git(repo_instance):
200 %if h.is_git(repo_instance):
200 <i class="icon-git"></i>
201 <i class="icon-git"></i>
201 %endif
202 %endif
202 %if h.is_svn(repo_instance):
203 %if h.is_svn(repo_instance):
203 <i class="icon-svn"></i>
204 <i class="icon-svn"></i>
204 %endif
205 %endif
205
206
206 ## public/private
207 ## public/private
207 %if repo_instance.private:
208 %if repo_instance.private:
208 <i class="icon-repo-private"></i>
209 <i class="icon-repo-private"></i>
209 %else:
210 %else:
210 <i class="icon-repo-public"></i>
211 <i class="icon-repo-public"></i>
211 %endif
212 %endif
212
213
213 ## repo name with group name
214 ## repo name with group name
214 ${h.breadcrumb_repo_link(repo_instance)}
215 ${h.breadcrumb_repo_link(repo_instance)}
215
216
216 ## Context Actions
217 ## Context Actions
217 <div class="pull-right">
218 <div class="pull-right">
218 %if c.rhodecode_user.username != h.DEFAULT_USER:
219 %if c.rhodecode_user.username != h.DEFAULT_USER:
219 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_name, _query=dict(auth_token=c.rhodecode_user.feed_token))}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
220 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_name, _query=dict(auth_token=c.rhodecode_user.feed_token))}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
220
221
221 <a href="#WatchRepo" onclick="toggleFollowingRepo(this, templateContext.repo_id); return false" title="${_('Watch this Repository and actions on it in your personalized journal')}" class="btn btn-sm ${('watching' if c.repository_is_user_following else '')}">
222 <a href="#WatchRepo" onclick="toggleFollowingRepo(this, templateContext.repo_id); return false" title="${_('Watch this Repository and actions on it in your personalized journal')}" class="btn btn-sm ${('watching' if c.repository_is_user_following else '')}">
222 % if c.repository_is_user_following:
223 % if c.repository_is_user_following:
223 <i class="icon-eye-off"></i>${_('Unwatch')}
224 <i class="icon-eye-off"></i>${_('Unwatch')}
224 % else:
225 % else:
225 <i class="icon-eye"></i>${_('Watch')}
226 <i class="icon-eye"></i>${_('Watch')}
226 % endif
227 % endif
227
228
228 </a>
229 </a>
229 %else:
230 %else:
230 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_name)}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
231 <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_name)}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a>
231 %endif
232 %endif
232 </div>
233 </div>
233
234
234 </div>
235 </div>
235
236
236 ## FORKED
237 ## FORKED
237 %if repo_instance.fork:
238 %if repo_instance.fork:
238 <p class="discreet">
239 <p class="discreet">
239 <i class="icon-code-fork"></i> ${_('Fork of')}
240 <i class="icon-code-fork"></i> ${_('Fork of')}
240 ${h.link_to_if(c.has_origin_repo_read_perm,repo_instance.fork.repo_name, h.route_path('repo_summary', repo_name=repo_instance.fork.repo_name))}
241 ${h.link_to_if(c.has_origin_repo_read_perm,repo_instance.fork.repo_name, h.route_path('repo_summary', repo_name=repo_instance.fork.repo_name))}
241 </p>
242 </p>
242 %endif
243 %endif
243
244
244 ## IMPORTED FROM REMOTE
245 ## IMPORTED FROM REMOTE
245 %if repo_instance.clone_uri:
246 %if repo_instance.clone_uri:
246 <p class="discreet">
247 <p class="discreet">
247 <i class="icon-code-fork"></i> ${_('Clone from')}
248 <i class="icon-code-fork"></i> ${_('Clone from')}
248 <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a>
249 <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a>
249 </p>
250 </p>
250 %endif
251 %endif
251
252
252 ## LOCKING STATUS
253 ## LOCKING STATUS
253 %if repo_instance.locked[0]:
254 %if repo_instance.locked[0]:
254 <p class="locking_locked discreet">
255 <p class="locking_locked discreet">
255 <i class="icon-repo-lock"></i>
256 <i class="icon-repo-lock"></i>
256 ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}}
257 ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}}
257 </p>
258 </p>
258 %elif repo_instance.enable_locking:
259 %elif repo_instance.enable_locking:
259 <p class="locking_unlocked discreet">
260 <p class="locking_unlocked discreet">
260 <i class="icon-repo-unlock"></i>
261 <i class="icon-repo-unlock"></i>
261 ${_('Repository not locked. Pull repository to lock it.')}
262 ${_('Repository not locked. Pull repository to lock it.')}
262 </p>
263 </p>
263 %endif
264 %endif
264
265
265 </div>
266 </div>
266 </%def>
267 </%def>
267
268
268 <%def name="repo_menu(active=None)">
269 <%def name="repo_menu(active=None)">
269 <%
270 <%
270 def is_active(selected):
271 def is_active(selected):
271 if selected == active:
272 if selected == active:
272 return "active"
273 return "active"
273 %>
274 %>
274
275
275 <!--- REPO CONTEXT BAR -->
276 <!--- REPO CONTEXT BAR -->
276 <div id="context-bar">
277 <div id="context-bar">
277 <div class="wrapper">
278 <div class="wrapper">
278
279
279 <div class="title">
280 <div class="title">
280 ${self.repo_page_title(c.rhodecode_db_repo)}
281 ${self.repo_page_title(c.rhodecode_db_repo)}
281 </div>
282 </div>
282
283
283 <ul id="context-pages" class="navigation horizontal-list">
284 <ul id="context-pages" class="navigation horizontal-list">
284 <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>
285 <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>
285 <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>
286 <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>
286 <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>
287 <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>
287 <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>
288 <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>
288
289
289 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
290 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
290 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
291 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
291 <li class="${is_active('showpullrequest')}">
292 <li class="${is_active('showpullrequest')}">
292 <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)}">
293 <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)}">
293 <div class="menulabel">
294 <div class="menulabel">
294 %if c.repository_pull_requests == 1:
295 %if c.repository_pull_requests == 1:
295 ${c.repository_pull_requests} ${_('Pull Request')}
296 ${c.repository_pull_requests} ${_('Pull Request')}
296 %else:
297 %else:
297 ${c.repository_pull_requests} ${_('Pull Requests')}
298 ${c.repository_pull_requests} ${_('Pull Requests')}
298 %endif
299 %endif
299 </div>
300 </div>
300 </a>
301 </a>
301 </li>
302 </li>
302 %endif
303 %endif
303
304
304 <li class="${is_active('artifacts')}"><a class="menulink" href="${h.route_path('repo_artifacts_list',repo_name=c.repo_name)}"><div class="menulabel">${_('Artifacts')} (BETA)</div></a></li>
305 <li class="${is_active('artifacts')}"><a class="menulink" href="${h.route_path('repo_artifacts_list',repo_name=c.repo_name)}"><div class="menulabel">${_('Artifacts')} (BETA)</div></a></li>
305
306
306 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
307 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
307 <li class="${is_active('settings')}"><a class="menulink" href="${h.route_path('edit_repo',repo_name=c.repo_name)}"><div class="menulabel">${_('Repository Settings')}</div></a></li>
308 <li class="${is_active('settings')}"><a class="menulink" href="${h.route_path('edit_repo',repo_name=c.repo_name)}"><div class="menulabel">${_('Repository Settings')}</div></a></li>
308 %endif
309 %endif
309
310
310 <li class="${is_active('options')}">
311 <li class="${is_active('options')}">
311 <a class="menulink dropdown">
312 <a class="menulink dropdown">
312 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
313 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
313 </a>
314 </a>
314 <ul class="submenu">
315 <ul class="submenu">
315
316
316 %if c.rhodecode_db_repo.fork:
317 %if c.rhodecode_db_repo.fork:
317 <li>
318 <li>
318 <a title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}"
319 <a title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}"
319 href="${h.route_path('repo_compare',
320 href="${h.route_path('repo_compare',
320 repo_name=c.rhodecode_db_repo.fork.repo_name,
321 repo_name=c.rhodecode_db_repo.fork.repo_name,
321 source_ref_type=c.rhodecode_db_repo.landing_rev[0],
322 source_ref_type=c.rhodecode_db_repo.landing_rev[0],
322 source_ref=c.rhodecode_db_repo.landing_rev[1],
323 source_ref=c.rhodecode_db_repo.landing_rev[1],
323 target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0],
324 target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0],
324 target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1],
325 target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1],
325 _query=dict(merge=1))}"
326 _query=dict(merge=1))}"
326 >
327 >
327 ${_('Compare fork')}
328 ${_('Compare fork')}
328 </a>
329 </a>
329 </li>
330 </li>
330 %endif
331 %endif
331
332
332 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking:
333 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking:
333 %if c.rhodecode_db_repo.locked[0]:
334 %if c.rhodecode_db_repo.locked[0]:
334 <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock')}</a></li>
335 <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock')}</a></li>
335 %else:
336 %else:
336 <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock')}</a></li>
337 <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock')}</a></li>
337 %endif
338 %endif
338 %endif
339 %endif
339 %if c.rhodecode_user.username != h.DEFAULT_USER:
340 %if c.rhodecode_user.username != h.DEFAULT_USER:
340 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
341 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
341 <li><a href="${h.route_path('repo_fork_new',repo_name=c.repo_name)}">${_('Fork')}</a></li>
342 <li><a href="${h.route_path('repo_fork_new',repo_name=c.repo_name)}">${_('Fork')}</a></li>
342 <li><a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li>
343 <li><a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li>
343 %endif
344 %endif
344 %endif
345 %endif
345 </ul>
346 </ul>
346 </li>
347 </li>
347 </ul>
348 </ul>
348 </div>
349 </div>
349 <div class="clear"></div>
350 <div class="clear"></div>
350 </div>
351 </div>
351 % if c.rhodecode_db_repo.archived:
352 % if c.rhodecode_db_repo.archived:
352 <div class="alert alert-warning text-center">
353 <div class="alert alert-warning text-center">
353 <strong>${_('This repository has been archived. It is now read-only.')}</strong>
354 <strong>${_('This repository has been archived. It is now read-only.')}</strong>
354 </div>
355 </div>
355 % endif
356 % endif
356 <!--- REPO END CONTEXT BAR -->
357 <!--- REPO END CONTEXT BAR -->
357
358
358 </%def>
359 </%def>
359
360
360 <%def name="repo_group_page_title(repo_group_instance)">
361 <%def name="repo_group_page_title(repo_group_instance)">
361 <div class="title-content">
362 <div class="title-content">
362 <div class="title-main">
363 <div class="title-main">
363 ## Repository Group icon
364 ## Repository Group icon
364 <i class="icon-repo-group"></i>
365 <i class="icon-repo-group"></i>
365
366
366 ## repo name with group name
367 ## repo name with group name
367 ${h.breadcrumb_repo_group_link(repo_group_instance)}
368 ${h.breadcrumb_repo_group_link(repo_group_instance)}
368 </div>
369 </div>
369
370
370 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
371 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
371 <div class="repo-group-desc discreet">
372 <div class="repo-group-desc discreet">
372 ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)}
373 ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)}
373 </div>
374 </div>
374
375
375 </div>
376 </div>
376 </%def>
377 </%def>
377
378
378 <%def name="repo_group_menu(active=None)">
379 <%def name="repo_group_menu(active=None)">
379 <%
380 <%
380 def is_active(selected):
381 def is_active(selected):
381 if selected == active:
382 if selected == active:
382 return "active"
383 return "active"
383
384
384 gr_name = c.repo_group.group_name if c.repo_group else None
385 gr_name = c.repo_group.group_name if c.repo_group else None
385 # create repositories with write permission on group is set to true
386 # create repositories with write permission on group is set to true
386 create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
387 create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
387 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
388 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
388 group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
389 group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
389
390
390 %>
391 %>
391
392
392 <!--- REPO GROUP CONTEXT BAR -->
393 <!--- REPO GROUP CONTEXT BAR -->
393 <div id="context-bar">
394 <div id="context-bar">
394 <div class="wrapper">
395 <div class="wrapper">
395 <div class="title">
396 <div class="title">
396 ${self.repo_group_page_title(c.repo_group)}
397 ${self.repo_group_page_title(c.repo_group)}
397 </div>
398 </div>
398
399
399 <ul id="context-pages" class="navigation horizontal-list">
400 <ul id="context-pages" class="navigation horizontal-list">
400 <li class="${is_active('home')}"><a class="menulink" href="${h.route_path('repo_group_home', repo_group_name=c.repo_group.group_name)}"><div class="menulabel">${_('Group Home')}</div></a></li>
401 <li class="${is_active('home')}"><a class="menulink" href="${h.route_path('repo_group_home', repo_group_name=c.repo_group.group_name)}"><div class="menulabel">${_('Group Home')}</div></a></li>
401 % if c.is_super_admin or group_admin:
402 % if c.is_super_admin or group_admin:
402 <li class="${is_active('settings')}"><a class="menulink" href="${h.route_path('edit_repo_group',repo_group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}"><div class="menulabel">${_('Group Settings')}</div></a></li>
403 <li class="${is_active('settings')}"><a class="menulink" href="${h.route_path('edit_repo_group',repo_group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}"><div class="menulabel">${_('Group Settings')}</div></a></li>
403 % endif
404 % endif
404
405
405 <li class="${is_active('options')}">
406 <li class="${is_active('options')}">
406 <a class="menulink dropdown">
407 <a class="menulink dropdown">
407 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
408 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
408 </a>
409 </a>
409 <ul class="submenu">
410 <ul class="submenu">
410 %if c.is_super_admin or group_admin or (group_write and create_on_write):
411 %if c.is_super_admin or group_admin or (group_write and create_on_write):
411 <li><a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('Add Repository')}</a></li>
412 <li><a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('Add Repository')}</a></li>
412 %endif
413 %endif
413 %if c.is_super_admin or group_admin:
414 %if c.is_super_admin or group_admin:
414 <li><a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'Add Parent Group')}</a></li>
415 <li><a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'Add Repository Group')}</a></li>
415 %endif
416 %endif
416 </ul>
417 </ul>
417 </li>
418 </li>
418 </ul>
419 </ul>
419 </div>
420 </div>
420 <div class="clear"></div>
421 <div class="clear"></div>
421 </div>
422 </div>
422
423
423 <!--- REPO GROUP CONTEXT BAR -->
424 <!--- REPO GROUP CONTEXT BAR -->
424
425
425 </%def>
426 </%def>
426
427
427
428
428 <%def name="usermenu(active=False)">
429 <%def name="usermenu(active=False)">
429 ## USER MENU
430 ## USER MENU
430 <li id="quick_login_li" class="${'active' if active else ''}">
431 <li id="quick_login_li" class="${'active' if active else ''}">
431 % if c.rhodecode_user.username == h.DEFAULT_USER:
432 % if c.rhodecode_user.username == h.DEFAULT_USER:
432 <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">
433 <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">
433 ${gravatar(c.rhodecode_user.email, 20)}
434 ${gravatar(c.rhodecode_user.email, 20)}
434 <span class="user">
435 <span class="user">
435 <span>${_('Sign in')}</span>
436 <span>${_('Sign in')}</span>
436 </span>
437 </span>
437 </a>
438 </a>
438 % else:
439 % else:
439 ## logged in user
440 ## logged in user
440 <a id="quick_login_link" class="menulink childs">
441 <a id="quick_login_link" class="menulink childs">
441 ${gravatar(c.rhodecode_user.email, 20)}
442 ${gravatar(c.rhodecode_user.email, 20)}
442 <span class="user">
443 <span class="user">
443 <span class="menu_link_user">${c.rhodecode_user.username}</span>
444 <span class="menu_link_user">${c.rhodecode_user.username}</span>
444 <div class="show_more"></div>
445 <div class="show_more"></div>
445 </span>
446 </span>
446 </a>
447 </a>
447 ## subnav with menu for logged in user
448 ## subnav with menu for logged in user
448 <div class="user-menu submenu">
449 <div class="user-menu submenu">
449 <div id="quick_login">
450 <div id="quick_login">
450 %if c.rhodecode_user.username != h.DEFAULT_USER:
451 %if c.rhodecode_user.username != h.DEFAULT_USER:
451 <div class="">
452 <div class="">
452 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
453 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
453 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
454 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
454 <div class="email">${c.rhodecode_user.email}</div>
455 <div class="email">${c.rhodecode_user.email}</div>
455 </div>
456 </div>
456 <div class="">
457 <div class="">
457 <ol class="links">
458 <ol class="links">
458 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
459 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
459 % if c.rhodecode_user.personal_repo_group:
460 % if c.rhodecode_user.personal_repo_group:
460 <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>
461 <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>
461 % endif
462 % endif
462 <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li>
463 <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li>
463 ## bookmark-items
464 ## bookmark-items
464 <li class="bookmark-items">
465 <li class="bookmark-items">
465 ${_('Bookmarks')}
466 ${_('Bookmarks')}
466 <div class="pull-right">
467 <div class="pull-right">
467 <a href="${h.route_path('my_account_bookmarks')}">${_('Manage')}</a>
468 <a href="${h.route_path('my_account_bookmarks')}">${_('Manage')}</a>
468 </div>
469 </div>
469 </li>
470 </li>
470 % if not c.bookmark_items:
471 % if not c.bookmark_items:
471 <li>
472 <li>
472 <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a>
473 <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a>
473 </li>
474 </li>
474 % endif
475 % endif
475 % for item in c.bookmark_items:
476 % for item in c.bookmark_items:
476 <li>
477 <li>
477 % if item.repository:
478 % if item.repository:
478 <div>
479 <div>
479 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
480 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
480 <code>${item.position}</code>
481 <code>${item.position}</code>
481 % if item.repository.repo_type == 'hg':
482 % if item.repository.repo_type == 'hg':
482 <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i>
483 <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i>
483 % elif item.repository.repo_type == 'git':
484 % elif item.repository.repo_type == 'git':
484 <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i>
485 <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i>
485 % elif item.repository.repo_type == 'svn':
486 % elif item.repository.repo_type == 'svn':
486 <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i>
487 <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i>
487 % endif
488 % endif
488 ${(item.title or h.shorter(item.repository.repo_name, 30))}
489 ${(item.title or h.shorter(item.repository.repo_name, 30))}
489 </a>
490 </a>
490 </div>
491 </div>
491 % elif item.repository_group:
492 % elif item.repository_group:
492 <div>
493 <div>
493 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
494 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
494 <code>${item.position}</code>
495 <code>${item.position}</code>
495 <i class="icon-repo-group" title="${_('Repository group')}" style="font-size: 14px"></i>
496 <i class="icon-repo-group" title="${_('Repository group')}" style="font-size: 14px"></i>
496 ${(item.title or h.shorter(item.repository_group.group_name, 30))}
497 ${(item.title or h.shorter(item.repository_group.group_name, 30))}
497 </a>
498 </a>
498 </div>
499 </div>
499 % else:
500 % else:
500 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
501 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
501 <code>${item.position}</code>
502 <code>${item.position}</code>
502 ${item.title}
503 ${item.title}
503 </a>
504 </a>
504 % endif
505 % endif
505 </li>
506 </li>
506 % endfor
507 % endfor
507
508
508 <li class="logout">
509 <li class="logout">
509 ${h.secure_form(h.route_path('logout'), request=request)}
510 ${h.secure_form(h.route_path('logout'), request=request)}
510 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
511 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
511 ${h.end_form()}
512 ${h.end_form()}
512 </li>
513 </li>
513 </ol>
514 </ol>
514 </div>
515 </div>
515 %endif
516 %endif
516 </div>
517 </div>
517 </div>
518 </div>
518 ## unread counter
519 ## unread counter
519 <div class="pill_container">
520 <div class="pill_container">
520 <a class="menu_link_notifications ${'empty' if c.unread_notifications == 0 else ''}" href="${h.route_path('notifications_show_all')}">${c.unread_notifications}</a>
521 <a class="menu_link_notifications ${'empty' if c.unread_notifications == 0 else ''}" href="${h.route_path('notifications_show_all')}">${c.unread_notifications}</a>
521 </div>
522 </div>
522 % endif
523 % endif
523 </li>
524 </li>
524 </%def>
525 </%def>
525
526
526 <%def name="menu_items(active=None)">
527 <%def name="menu_items(active=None)">
527 <%
528 <%
528 def is_active(selected):
529 def is_active(selected):
529 if selected == active:
530 if selected == active:
530 return "active"
531 return "active"
531 return ""
532 return ""
532 %>
533 %>
533
534
534 <ul id="quick" class="main_nav navigation horizontal-list">
535 <ul id="quick" class="main_nav navigation horizontal-list">
535 ## notice box for important system messages
536 ## notice box for important system messages
536 <li style="display: none">
537 <li style="display: none">
537 <a class="notice-box" href="#openNotice" onclick="showNoticeBox(); return false">
538 <a class="notice-box" href="#openNotice" onclick="showNoticeBox(); return false">
538 <div class="menulabel-notice" >
539 <div class="menulabel-notice" >
539 0
540 0
540 </div>
541 </div>
541 </a>
542 </a>
542 </li>
543 </li>
543
544
544 ## Main filter
545 ## Main filter
545 <li>
546 <li>
546 <div class="menulabel main_filter_box">
547 <div class="menulabel main_filter_box">
547 <div class="main_filter_input_box">
548 <div class="main_filter_input_box">
548 <ul class="searchItems">
549 <ul class="searchItems">
549
550
550 % if c.template_context['search_context']['repo_id']:
551 % if c.template_context['search_context']['repo_id']:
551 <li class="searchTag searchTagFilter searchTagHidable" >
552 <li class="searchTag searchTagFilter searchTagHidable" >
552 ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">
553 ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">
553 <span class="tag">
554 <span class="tag">
554 This repo
555 This repo
555 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
556 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
556 </span>
557 </span>
557 ##</a>
558 ##</a>
558 </li>
559 </li>
559 % elif c.template_context['search_context']['repo_group_id']:
560 % elif c.template_context['search_context']['repo_group_id']:
560 <li class="searchTag searchTagFilter searchTagHidable">
561 <li class="searchTag searchTagFilter searchTagHidable">
561 ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">
562 ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">
562 <span class="tag">
563 <span class="tag">
563 This group
564 This group
564 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
565 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
565 </span>
566 </span>
566 ##</a>
567 ##</a>
567 </li>
568 </li>
568 % endif
569 % endif
569
570
570 <li class="searchTagInput">
571 <li class="searchTagInput">
571 <input class="main_filter_input" id="main_filter" size="15" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" />
572 <input class="main_filter_input" id="main_filter" size="15" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" />
572 </li>
573 </li>
573 <li class="searchTag searchTagHelp">
574 <li class="searchTag searchTagHelp">
574 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
575 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
575 </li>
576 </li>
576 </ul>
577 </ul>
577 </div>
578 </div>
578 </div>
579 </div>
579
580
580 <div id="main_filter_help" style="display: none">
581 <div id="main_filter_help" style="display: none">
581 - Use '/' key to quickly access this field.
582 - Use '/' key to quickly access this field.
582
583
583 - Enter a name of repository, or repository group for quick search.
584 - Enter a name of repository, or repository group for quick search.
584
585
585 - Prefix query to allow special search:
586 - Prefix query to allow special search:
586
587
587 user:admin, to search for usernames, always global
588 user:admin, to search for usernames, always global
588
589
589 user_group:devops, to search for user groups, always global
590 user_group:devops, to search for user groups, always global
590
591
591 commit:efced4, to search for commits, scoped to repositories or groups
592 commit:efced4, to search for commits, scoped to repositories or groups
592
593
593 file:models.py, to search for file paths, scoped to repositories or groups
594 file:models.py, to search for file paths, scoped to repositories or groups
594
595
595 % if c.template_context['search_context']['repo_id']:
596 % if c.template_context['search_context']['repo_id']:
596 For advanced full text search visit: <a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">repository search</a>
597 For advanced full text search visit: <a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">repository search</a>
597 % elif c.template_context['search_context']['repo_group_id']:
598 % elif c.template_context['search_context']['repo_group_id']:
598 For advanced full text search visit: <a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">repository group search</a>
599 For advanced full text search visit: <a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">repository group search</a>
599 % else:
600 % else:
600 For advanced full text search visit: <a href="${h.route_path('search')}">global search</a>
601 For advanced full text search visit: <a href="${h.route_path('search')}">global search</a>
601 % endif
602 % endif
602 </div>
603 </div>
603 </li>
604 </li>
604
605
605 ## ROOT MENU
606 ## ROOT MENU
606 <li class="${is_active('home')}">
607 <li class="${is_active('home')}">
607 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
608 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
608 <div class="menulabel">${_('Home')}</div>
609 <div class="menulabel">${_('Home')}</div>
609 </a>
610 </a>
610 </li>
611 </li>
611
612
612 %if c.rhodecode_user.username != h.DEFAULT_USER:
613 %if c.rhodecode_user.username != h.DEFAULT_USER:
613 <li class="${is_active('journal')}">
614 <li class="${is_active('journal')}">
614 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
615 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
615 <div class="menulabel">${_('Journal')}</div>
616 <div class="menulabel">${_('Journal')}</div>
616 </a>
617 </a>
617 </li>
618 </li>
618 %else:
619 %else:
619 <li class="${is_active('journal')}">
620 <li class="${is_active('journal')}">
620 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
621 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
621 <div class="menulabel">${_('Public journal')}</div>
622 <div class="menulabel">${_('Public journal')}</div>
622 </a>
623 </a>
623 </li>
624 </li>
624 %endif
625 %endif
625
626
626 <li class="${is_active('gists')}">
627 <li class="${is_active('gists')}">
627 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
628 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
628 <div class="menulabel">${_('Gists')}</div>
629 <div class="menulabel">${_('Gists')}</div>
629 </a>
630 </a>
630 </li>
631 </li>
631
632
632 % if c.is_super_admin or c.is_delegated_admin:
633 % if c.is_super_admin or c.is_delegated_admin:
633 <li class="${is_active('admin')}">
634 <li class="${is_active('admin')}">
634 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
635 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
635 <div class="menulabel">${_('Admin')} </div>
636 <div class="menulabel">${_('Admin')} </div>
636 </a>
637 </a>
637 </li>
638 </li>
638 % endif
639 % endif
639
640
640 ## render extra user menu
641 ## render extra user menu
641 ${usermenu(active=(active=='my_account'))}
642 ${usermenu(active=(active=='my_account'))}
642
643
643 % if c.debug_style:
644 % if c.debug_style:
644 <li>
645 <li>
645 <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}">
646 <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}">
646 <div class="menulabel">${_('[Style]')}</div>
647 <div class="menulabel">${_('[Style]')}</div>
647 </a>
648 </a>
648 </li>
649 </li>
649 % endif
650 % endif
650 </ul>
651 </ul>
651
652
652 <script type="text/javascript">
653 <script type="text/javascript">
653 var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True";
654 var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True";
654
655
655 var formatRepoResult = function(result, container, query, escapeMarkup) {
656 var formatRepoResult = function(result, container, query, escapeMarkup) {
656 return function(data, escapeMarkup) {
657 return function(data, escapeMarkup) {
657 if (!data.repo_id){
658 if (!data.repo_id){
658 return data.text; // optgroup text Repositories
659 return data.text; // optgroup text Repositories
659 }
660 }
660
661
661 var tmpl = '';
662 var tmpl = '';
662 var repoType = data['repo_type'];
663 var repoType = data['repo_type'];
663 var repoName = data['text'];
664 var repoName = data['text'];
664
665
665 if(data && data.type == 'repo'){
666 if(data && data.type == 'repo'){
666 if(repoType === 'hg'){
667 if(repoType === 'hg'){
667 tmpl += '<i class="icon-hg"></i> ';
668 tmpl += '<i class="icon-hg"></i> ';
668 }
669 }
669 else if(repoType === 'git'){
670 else if(repoType === 'git'){
670 tmpl += '<i class="icon-git"></i> ';
671 tmpl += '<i class="icon-git"></i> ';
671 }
672 }
672 else if(repoType === 'svn'){
673 else if(repoType === 'svn'){
673 tmpl += '<i class="icon-svn"></i> ';
674 tmpl += '<i class="icon-svn"></i> ';
674 }
675 }
675 if(data['private']){
676 if(data['private']){
676 tmpl += '<i class="icon-lock" ></i> ';
677 tmpl += '<i class="icon-lock" ></i> ';
677 }
678 }
678 else if(visualShowPublicIcon){
679 else if(visualShowPublicIcon){
679 tmpl += '<i class="icon-unlock-alt"></i> ';
680 tmpl += '<i class="icon-unlock-alt"></i> ';
680 }
681 }
681 }
682 }
682 tmpl += escapeMarkup(repoName);
683 tmpl += escapeMarkup(repoName);
683 return tmpl;
684 return tmpl;
684
685
685 }(result, escapeMarkup);
686 }(result, escapeMarkup);
686 };
687 };
687
688
688 var formatRepoGroupResult = function(result, container, query, escapeMarkup) {
689 var formatRepoGroupResult = function(result, container, query, escapeMarkup) {
689 return function(data, escapeMarkup) {
690 return function(data, escapeMarkup) {
690 if (!data.repo_group_id){
691 if (!data.repo_group_id){
691 return data.text; // optgroup text Repositories
692 return data.text; // optgroup text Repositories
692 }
693 }
693
694
694 var tmpl = '';
695 var tmpl = '';
695 var repoGroupName = data['text'];
696 var repoGroupName = data['text'];
696
697
697 if(data){
698 if(data){
698
699
699 tmpl += '<i class="icon-repo-group"></i> ';
700 tmpl += '<i class="icon-repo-group"></i> ';
700
701
701 }
702 }
702 tmpl += escapeMarkup(repoGroupName);
703 tmpl += escapeMarkup(repoGroupName);
703 return tmpl;
704 return tmpl;
704
705
705 }(result, escapeMarkup);
706 }(result, escapeMarkup);
706 };
707 };
707
708
708 var escapeRegExChars = function (value) {
709 var escapeRegExChars = function (value) {
709 return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
710 return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
710 };
711 };
711
712
712 var getRepoIcon = function(repo_type) {
713 var getRepoIcon = function(repo_type) {
713 if (repo_type === 'hg') {
714 if (repo_type === 'hg') {
714 return '<i class="icon-hg"></i> ';
715 return '<i class="icon-hg"></i> ';
715 }
716 }
716 else if (repo_type === 'git') {
717 else if (repo_type === 'git') {
717 return '<i class="icon-git"></i> ';
718 return '<i class="icon-git"></i> ';
718 }
719 }
719 else if (repo_type === 'svn') {
720 else if (repo_type === 'svn') {
720 return '<i class="icon-svn"></i> ';
721 return '<i class="icon-svn"></i> ';
721 }
722 }
722 return ''
723 return ''
723 };
724 };
724
725
725 var autocompleteMainFilterFormatResult = function (data, value, org_formatter) {
726 var autocompleteMainFilterFormatResult = function (data, value, org_formatter) {
726
727
727 if (value.split(':').length === 2) {
728 if (value.split(':').length === 2) {
728 value = value.split(':')[1]
729 value = value.split(':')[1]
729 }
730 }
730
731
731 var searchType = data['type'];
732 var searchType = data['type'];
732 var valueDisplay = data['value_display'];
733 var valueDisplay = data['value_display'];
733
734
734 var pattern = '(' + escapeRegExChars(value) + ')';
735 var pattern = '(' + escapeRegExChars(value) + ')';
735
736
736 valueDisplay = Select2.util.escapeMarkup(valueDisplay);
737 valueDisplay = Select2.util.escapeMarkup(valueDisplay);
737
738
738 // highlight match
739 // highlight match
739 if (searchType != 'text') {
740 if (searchType != 'text') {
740 valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
741 valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
741 }
742 }
742
743
743 var icon = '';
744 var icon = '';
744
745
745 if (searchType === 'hint') {
746 if (searchType === 'hint') {
746 icon += '<i class="icon-repo-group"></i> ';
747 icon += '<i class="icon-repo-group"></i> ';
747 }
748 }
748 // full text search
749 // full text search
749 else if (searchType === 'search') {
750 else if (searchType === 'search') {
750 icon += '<i class="icon-more"></i> ';
751 icon += '<i class="icon-more"></i> ';
751 }
752 }
752 // repository
753 // repository
753 else if (searchType === 'repo') {
754 else if (searchType === 'repo') {
754
755
755 var repoIcon = getRepoIcon(data['repo_type']);
756 var repoIcon = getRepoIcon(data['repo_type']);
756 icon += repoIcon;
757 icon += repoIcon;
757
758
758 if (data['private']) {
759 if (data['private']) {
759 icon += '<i class="icon-lock" ></i> ';
760 icon += '<i class="icon-lock" ></i> ';
760 }
761 }
761 else if (visualShowPublicIcon) {
762 else if (visualShowPublicIcon) {
762 icon += '<i class="icon-unlock-alt"></i> ';
763 icon += '<i class="icon-unlock-alt"></i> ';
763 }
764 }
764 }
765 }
765 // repository groups
766 // repository groups
766 else if (searchType === 'repo_group') {
767 else if (searchType === 'repo_group') {
767 icon += '<i class="icon-repo-group"></i> ';
768 icon += '<i class="icon-repo-group"></i> ';
768 }
769 }
769 // user group
770 // user group
770 else if (searchType === 'user_group') {
771 else if (searchType === 'user_group') {
771 icon += '<i class="icon-group"></i> ';
772 icon += '<i class="icon-group"></i> ';
772 }
773 }
773 // user
774 // user
774 else if (searchType === 'user') {
775 else if (searchType === 'user') {
775 icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']);
776 icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']);
776 }
777 }
777 // commit
778 // commit
778 else if (searchType === 'commit') {
779 else if (searchType === 'commit') {
779 var repo_data = data['repo_data'];
780 var repo_data = data['repo_data'];
780 var repoIcon = getRepoIcon(repo_data['repository_type']);
781 var repoIcon = getRepoIcon(repo_data['repository_type']);
781 if (repoIcon) {
782 if (repoIcon) {
782 icon += repoIcon;
783 icon += repoIcon;
783 } else {
784 } else {
784 icon += '<i class="icon-tag"></i>';
785 icon += '<i class="icon-tag"></i>';
785 }
786 }
786 }
787 }
787 // file
788 // file
788 else if (searchType === 'file') {
789 else if (searchType === 'file') {
789 var repo_data = data['repo_data'];
790 var repo_data = data['repo_data'];
790 var repoIcon = getRepoIcon(repo_data['repository_type']);
791 var repoIcon = getRepoIcon(repo_data['repository_type']);
791 if (repoIcon) {
792 if (repoIcon) {
792 icon += repoIcon;
793 icon += repoIcon;
793 } else {
794 } else {
794 icon += '<i class="icon-tag"></i>';
795 icon += '<i class="icon-tag"></i>';
795 }
796 }
796 }
797 }
797 // generic text
798 // generic text
798 else if (searchType === 'text') {
799 else if (searchType === 'text') {
799 icon = '';
800 icon = '';
800 }
801 }
801
802
802 var tmpl = '<div class="ac-container-wrap">{0}{1}</div>';
803 var tmpl = '<div class="ac-container-wrap">{0}{1}</div>';
803 return tmpl.format(icon, valueDisplay);
804 return tmpl.format(icon, valueDisplay);
804 };
805 };
805
806
806 var handleSelect = function(element, suggestion) {
807 var handleSelect = function(element, suggestion) {
807 if (suggestion.type === "hint") {
808 if (suggestion.type === "hint") {
808 // we skip action
809 // we skip action
809 $('#main_filter').focus();
810 $('#main_filter').focus();
810 }
811 }
811 else if (suggestion.type === "text") {
812 else if (suggestion.type === "text") {
812 // we skip action
813 // we skip action
813 $('#main_filter').focus();
814 $('#main_filter').focus();
814
815
815 } else {
816 } else {
816 window.location = suggestion['url'];
817 window.location = suggestion['url'];
817 }
818 }
818 };
819 };
819
820
820 var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) {
821 var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) {
821 if (queryLowerCase.split(':').length === 2) {
822 if (queryLowerCase.split(':').length === 2) {
822 queryLowerCase = queryLowerCase.split(':')[1]
823 queryLowerCase = queryLowerCase.split(':')[1]
823 }
824 }
824 if (suggestion.type === "text") {
825 if (suggestion.type === "text") {
825 // special case we don't want to "skip" display for
826 // special case we don't want to "skip" display for
826 return true
827 return true
827 }
828 }
828 return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1;
829 return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1;
829 };
830 };
830
831
831 var cleanContext = {
832 var cleanContext = {
832 repo_view_type: null,
833 repo_view_type: null,
833
834
834 repo_id: null,
835 repo_id: null,
835 repo_name: "",
836 repo_name: "",
836
837
837 repo_group_id: null,
838 repo_group_id: null,
838 repo_group_name: null
839 repo_group_name: null
839 };
840 };
840 var removeGoToFilter = function () {
841 var removeGoToFilter = function () {
841 $('.searchTagHidable').hide();
842 $('.searchTagHidable').hide();
842 $('#main_filter').autocomplete(
843 $('#main_filter').autocomplete(
843 'setOptions', {params:{search_context: cleanContext}});
844 'setOptions', {params:{search_context: cleanContext}});
844 };
845 };
845
846
846 $('#main_filter').autocomplete({
847 $('#main_filter').autocomplete({
847 serviceUrl: pyroutes.url('goto_switcher_data'),
848 serviceUrl: pyroutes.url('goto_switcher_data'),
848 params: {
849 params: {
849 "search_context": templateContext.search_context
850 "search_context": templateContext.search_context
850 },
851 },
851 minChars:2,
852 minChars:2,
852 maxHeight:400,
853 maxHeight:400,
853 deferRequestBy: 300, //miliseconds
854 deferRequestBy: 300, //miliseconds
854 tabDisabled: true,
855 tabDisabled: true,
855 autoSelectFirst: false,
856 autoSelectFirst: false,
856 formatResult: autocompleteMainFilterFormatResult,
857 formatResult: autocompleteMainFilterFormatResult,
857 lookupFilter: autocompleteMainFilterResult,
858 lookupFilter: autocompleteMainFilterResult,
858 onSelect: function (element, suggestion) {
859 onSelect: function (element, suggestion) {
859 handleSelect(element, suggestion);
860 handleSelect(element, suggestion);
860 return false;
861 return false;
861 },
862 },
862 onSearchError: function (element, query, jqXHR, textStatus, errorThrown) {
863 onSearchError: function (element, query, jqXHR, textStatus, errorThrown) {
863 if (jqXHR !== 'abort') {
864 if (jqXHR !== 'abort') {
864 alert("Error during search.\nError code: {0}".format(textStatus));
865 alert("Error during search.\nError code: {0}".format(textStatus));
865 window.location = '';
866 window.location = '';
866 }
867 }
867 }
868 }
868 });
869 });
869
870
870 showMainFilterBox = function () {
871 showMainFilterBox = function () {
871 $('#main_filter_help').toggle();
872 $('#main_filter_help').toggle();
872 };
873 };
873
874
874 $('#main_filter').on('keydown.autocomplete', function (e) {
875 $('#main_filter').on('keydown.autocomplete', function (e) {
875
876
876 var BACKSPACE = 8;
877 var BACKSPACE = 8;
877 var el = $(e.currentTarget);
878 var el = $(e.currentTarget);
878 if(e.which === BACKSPACE){
879 if(e.which === BACKSPACE){
879 var inputVal = el.val();
880 var inputVal = el.val();
880 if (inputVal === ""){
881 if (inputVal === ""){
881 removeGoToFilter()
882 removeGoToFilter()
882 }
883 }
883 }
884 }
884 });
885 });
885
886
886 </script>
887 </script>
887 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
888 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
888 </%def>
889 </%def>
889
890
890 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
891 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
891 <div class="modal-dialog">
892 <div class="modal-dialog">
892 <div class="modal-content">
893 <div class="modal-content">
893 <div class="modal-header">
894 <div class="modal-header">
894 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
895 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
895 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
896 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
896 </div>
897 </div>
897 <div class="modal-body">
898 <div class="modal-body">
898 <div class="block-left">
899 <div class="block-left">
899 <table class="keyboard-mappings">
900 <table class="keyboard-mappings">
900 <tbody>
901 <tbody>
901 <tr>
902 <tr>
902 <th></th>
903 <th></th>
903 <th>${_('Site-wide shortcuts')}</th>
904 <th>${_('Site-wide shortcuts')}</th>
904 </tr>
905 </tr>
905 <%
906 <%
906 elems = [
907 elems = [
907 ('/', 'Use quick search box'),
908 ('/', 'Use quick search box'),
908 ('g h', 'Goto home page'),
909 ('g h', 'Goto home page'),
909 ('g g', 'Goto my private gists page'),
910 ('g g', 'Goto my private gists page'),
910 ('g G', 'Goto my public gists page'),
911 ('g G', 'Goto my public gists page'),
911 ('g 0-9', 'Goto bookmarked items from 0-9'),
912 ('g 0-9', 'Goto bookmarked items from 0-9'),
912 ('n r', 'New repository page'),
913 ('n r', 'New repository page'),
913 ('n g', 'New gist page'),
914 ('n g', 'New gist page'),
914 ]
915 ]
915 %>
916 %>
916 %for key, desc in elems:
917 %for key, desc in elems:
917 <tr>
918 <tr>
918 <td class="keys">
919 <td class="keys">
919 <span class="key tag">${key}</span>
920 <span class="key tag">${key}</span>
920 </td>
921 </td>
921 <td>${desc}</td>
922 <td>${desc}</td>
922 </tr>
923 </tr>
923 %endfor
924 %endfor
924 </tbody>
925 </tbody>
925 </table>
926 </table>
926 </div>
927 </div>
927 <div class="block-left">
928 <div class="block-left">
928 <table class="keyboard-mappings">
929 <table class="keyboard-mappings">
929 <tbody>
930 <tbody>
930 <tr>
931 <tr>
931 <th></th>
932 <th></th>
932 <th>${_('Repositories')}</th>
933 <th>${_('Repositories')}</th>
933 </tr>
934 </tr>
934 <%
935 <%
935 elems = [
936 elems = [
936 ('g s', 'Goto summary page'),
937 ('g s', 'Goto summary page'),
937 ('g c', 'Goto changelog page'),
938 ('g c', 'Goto changelog page'),
938 ('g f', 'Goto files page'),
939 ('g f', 'Goto files page'),
939 ('g F', 'Goto files page with file search activated'),
940 ('g F', 'Goto files page with file search activated'),
940 ('g p', 'Goto pull requests page'),
941 ('g p', 'Goto pull requests page'),
941 ('g o', 'Goto repository settings'),
942 ('g o', 'Goto repository settings'),
942 ('g O', 'Goto repository permissions settings'),
943 ('g O', 'Goto repository permissions settings'),
943 ]
944 ]
944 %>
945 %>
945 %for key, desc in elems:
946 %for key, desc in elems:
946 <tr>
947 <tr>
947 <td class="keys">
948 <td class="keys">
948 <span class="key tag">${key}</span>
949 <span class="key tag">${key}</span>
949 </td>
950 </td>
950 <td>${desc}</td>
951 <td>${desc}</td>
951 </tr>
952 </tr>
952 %endfor
953 %endfor
953 </tbody>
954 </tbody>
954 </table>
955 </table>
955 </div>
956 </div>
956 </div>
957 </div>
957 <div class="modal-footer">
958 <div class="modal-footer">
958 </div>
959 </div>
959 </div><!-- /.modal-content -->
960 </div><!-- /.modal-content -->
960 </div><!-- /.modal-dialog -->
961 </div><!-- /.modal-dialog -->
961 </div><!-- /.modal -->
962 </div><!-- /.modal -->
962
963
General Comments 0
You need to be logged in to leave comments. Login now