##// END OF EJS Templates
ui: fixed archived repo page new look.
marcink -
r3744:de115229 new-ui
parent child Browse files
Show More
@@ -1,965 +1,966 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
195 <div class="title-main">
195 <div class="title-main">
196 ## SVN/HG/GIT icons
196 ## SVN/HG/GIT icons
197 %if h.is_hg(repo_instance):
197 %if h.is_hg(repo_instance):
198 <i class="icon-hg"></i>
198 <i class="icon-hg"></i>
199 %endif
199 %endif
200 %if h.is_git(repo_instance):
200 %if h.is_git(repo_instance):
201 <i class="icon-git"></i>
201 <i class="icon-git"></i>
202 %endif
202 %endif
203 %if h.is_svn(repo_instance):
203 %if h.is_svn(repo_instance):
204 <i class="icon-svn"></i>
204 <i class="icon-svn"></i>
205 %endif
205 %endif
206
206
207 ## public/private
207 ## public/private
208 %if repo_instance.private:
208 %if repo_instance.private:
209 <i class="icon-repo-private"></i>
209 <i class="icon-repo-private"></i>
210 %else:
210 %else:
211 <i class="icon-repo-public"></i>
211 <i class="icon-repo-public"></i>
212 %endif
212 %endif
213
213
214 ## repo name with group name
214 ## repo name with group name
215 ${h.breadcrumb_repo_link(repo_instance)}
215 ${h.breadcrumb_repo_link(repo_instance)}
216
216
217 ## Context Actions
217 ## Context Actions
218 <div class="pull-right">
218 <div class="pull-right">
219 %if c.rhodecode_user.username != h.DEFAULT_USER:
219 %if c.rhodecode_user.username != h.DEFAULT_USER:
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 <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>
221
221
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 <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 '')}">
223 % if c.repository_is_user_following:
223 % if c.repository_is_user_following:
224 <i class="icon-eye-off"></i>${_('Unwatch')}
224 <i class="icon-eye-off"></i>${_('Unwatch')}
225 % else:
225 % else:
226 <i class="icon-eye"></i>${_('Watch')}
226 <i class="icon-eye"></i>${_('Watch')}
227 % endif
227 % endif
228
228
229 </a>
229 </a>
230 %else:
230 %else:
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 <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>
232 %endif
232 %endif
233 </div>
233 </div>
234
234
235 </div>
235 </div>
236
236
237 ## FORKED
237 ## FORKED
238 %if repo_instance.fork:
238 %if repo_instance.fork:
239 <p class="discreet">
239 <p class="discreet">
240 <i class="icon-code-fork"></i> ${_('Fork of')}
240 <i class="icon-code-fork"></i> ${_('Fork of')}
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 ${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))}
242 </p>
242 </p>
243 %endif
243 %endif
244
244
245 ## IMPORTED FROM REMOTE
245 ## IMPORTED FROM REMOTE
246 %if repo_instance.clone_uri:
246 %if repo_instance.clone_uri:
247 <p class="discreet">
247 <p class="discreet">
248 <i class="icon-code-fork"></i> ${_('Clone from')}
248 <i class="icon-code-fork"></i> ${_('Clone from')}
249 <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>
250 </p>
250 </p>
251 %endif
251 %endif
252
252
253 ## LOCKING STATUS
253 ## LOCKING STATUS
254 %if repo_instance.locked[0]:
254 %if repo_instance.locked[0]:
255 <p class="locking_locked discreet">
255 <p class="locking_locked discreet">
256 <i class="icon-repo-lock"></i>
256 <i class="icon-repo-lock"></i>
257 ${_('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])}}
258 </p>
258 </p>
259 %elif repo_instance.enable_locking:
259 %elif repo_instance.enable_locking:
260 <p class="locking_unlocked discreet">
260 <p class="locking_unlocked discreet">
261 <i class="icon-repo-unlock"></i>
261 <i class="icon-repo-unlock"></i>
262 ${_('Repository not locked. Pull repository to lock it.')}
262 ${_('Repository not locked. Pull repository to lock it.')}
263 </p>
263 </p>
264 %endif
264 %endif
265
265
266 </div>
266 </div>
267 </%def>
267 </%def>
268
268
269 <%def name="repo_menu(active=None)">
269 <%def name="repo_menu(active=None)">
270 <%
270 <%
271 def is_active(selected):
271 def is_active(selected):
272 if selected == active:
272 if selected == active:
273 return "active"
273 return "active"
274 %>
274 %>
275 % if c.rhodecode_db_repo.archived:
276 <div class="alert alert-warning text-center">
277 <strong>${_('This repository has been archived. It is now read-only.')}</strong>
278 </div>
279 % endif
275
280
276 <!--- REPO CONTEXT BAR -->
281 <!--- REPO CONTEXT BAR -->
277 <div id="context-bar">
282 <div id="context-bar">
278 <div class="wrapper">
283 <div class="wrapper">
279
284
280 <div class="title">
285 <div class="title">
281 ${self.repo_page_title(c.rhodecode_db_repo)}
286 ${self.repo_page_title(c.rhodecode_db_repo)}
282 </div>
287 </div>
283
288
284 <ul id="context-pages" class="navigation horizontal-list">
289 <ul id="context-pages" class="navigation horizontal-list">
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>
290 <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>
286 <li class="${is_active('commits')}"><a class="menulink" href="${h.route_path('repo_commits', repo_name=c.repo_name)}"><div class="menulabel">${_('Commits')}</div></a></li>
291 <li class="${is_active('commits')}"><a class="menulink" href="${h.route_path('repo_commits', repo_name=c.repo_name)}"><div class="menulabel">${_('Commits')}</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>
292 <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>
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>
293 <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>
289
294
290 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
295 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
291 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
296 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
292 <li class="${is_active('showpullrequest')}">
297 <li class="${is_active('showpullrequest')}">
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)}">
298 <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)}">
294 <div class="menulabel">
299 <div class="menulabel">
295 %if c.repository_pull_requests == 1:
300 %if c.repository_pull_requests == 1:
296 ${c.repository_pull_requests} ${_('Pull Request')}
301 ${c.repository_pull_requests} ${_('Pull Request')}
297 %else:
302 %else:
298 ${c.repository_pull_requests} ${_('Pull Requests')}
303 ${c.repository_pull_requests} ${_('Pull Requests')}
299 %endif
304 %endif
300 </div>
305 </div>
301 </a>
306 </a>
302 </li>
307 </li>
303 %endif
308 %endif
304
309
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>
310 <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>
306
311
307 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
312 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
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>
313 <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>
309 %endif
314 %endif
310
315
311 ## determine if we have "any" option available
316 ## determine if we have "any" option available
312 <%
317 <%
313 can_lock = h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking
318 can_lock = h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking
314 has_actions = (c.rhodecode_user.username != h.DEFAULT_USER and c.rhodecode_db_repo.repo_type in ['git','hg'] ) or can_lock
319 has_actions = (c.rhodecode_user.username != h.DEFAULT_USER and c.rhodecode_db_repo.repo_type in ['git','hg'] ) or can_lock
315 %>
320 %>
316 <li class="${is_active('options')}">
321 <li class="${is_active('options')}">
317 % if has_actions:
322 % if has_actions:
318 <a class="menulink dropdown">
323 <a class="menulink dropdown">
319 <div class="menulabel">${_('Options')}<div class="show_more"></div></div>
324 <div class="menulabel">${_('Options')}<div class="show_more"></div></div>
320 </a>
325 </a>
321 <ul class="submenu">
326 <ul class="submenu">
322 <li><a href="${h.route_path('repo_fork_new',repo_name=c.repo_name)}">${_('Fork this repository')}</a></li>
327 <li><a href="${h.route_path('repo_fork_new',repo_name=c.repo_name)}">${_('Fork this repository')}</a></li>
323 <li><a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li>
328 <li><a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li>
324 %if can_lock:
329 %if can_lock:
325 %if c.rhodecode_db_repo.locked[0]:
330 %if c.rhodecode_db_repo.locked[0]:
326 <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock Repository')}</a></li>
331 <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock Repository')}</a></li>
327 %else:
332 %else:
328 <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock Repository')}</a></li>
333 <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock Repository')}</a></li>
329 %endif
334 %endif
330 %endif
335 %endif
331 </ul>
336 </ul>
332 % else:
337 % else:
333 <a class="menulink disabled">
338 <a class="menulink disabled">
334 <div class="menulabel">${_('Options')}<div class="show_more"></div></div>
339 <div class="menulabel">${_('Options')}<div class="show_more"></div></div>
335 </a>
340 </a>
336 % endif
341 % endif
337 </li>
342 </li>
338
343
339 </ul>
344 </ul>
340 </div>
345 </div>
341 <div class="clear"></div>
346 <div class="clear"></div>
342 </div>
347 </div>
343 % if c.rhodecode_db_repo.archived:
348
344 <div class="alert alert-warning text-center">
345 <strong>${_('This repository has been archived. It is now read-only.')}</strong>
346 </div>
347 % endif
348 <!--- REPO END CONTEXT BAR -->
349 <!--- REPO END CONTEXT BAR -->
349
350
350 </%def>
351 </%def>
351
352
352 <%def name="repo_group_page_title(repo_group_instance)">
353 <%def name="repo_group_page_title(repo_group_instance)">
353 <div class="title-content">
354 <div class="title-content">
354 <div class="title-main">
355 <div class="title-main">
355 ## Repository Group icon
356 ## Repository Group icon
356 <i class="icon-repo-group"></i>
357 <i class="icon-repo-group"></i>
357
358
358 ## repo name with group name
359 ## repo name with group name
359 ${h.breadcrumb_repo_group_link(repo_group_instance)}
360 ${h.breadcrumb_repo_group_link(repo_group_instance)}
360 </div>
361 </div>
361
362
362 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
363 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
363 <div class="repo-group-desc discreet">
364 <div class="repo-group-desc discreet">
364 ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)}
365 ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)}
365 </div>
366 </div>
366
367
367 </div>
368 </div>
368 </%def>
369 </%def>
369
370
370 <%def name="repo_group_menu(active=None)">
371 <%def name="repo_group_menu(active=None)">
371 <%
372 <%
372 def is_active(selected):
373 def is_active(selected):
373 if selected == active:
374 if selected == active:
374 return "active"
375 return "active"
375
376
376 gr_name = c.repo_group.group_name if c.repo_group else None
377 gr_name = c.repo_group.group_name if c.repo_group else None
377 # create repositories with write permission on group is set to true
378 # create repositories with write permission on group is set to true
378 create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
379 create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
379 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
380 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
380 group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
381 group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
381
382
382 %>
383 %>
383
384
384 <!--- REPO GROUP CONTEXT BAR -->
385 <!--- REPO GROUP CONTEXT BAR -->
385 <div id="context-bar">
386 <div id="context-bar">
386 <div class="wrapper">
387 <div class="wrapper">
387 <div class="title">
388 <div class="title">
388 ${self.repo_group_page_title(c.repo_group)}
389 ${self.repo_group_page_title(c.repo_group)}
389 </div>
390 </div>
390
391
391 <ul id="context-pages" class="navigation horizontal-list">
392 <ul id="context-pages" class="navigation horizontal-list">
392 <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>
393 <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>
393 % if c.is_super_admin or group_admin:
394 % if c.is_super_admin or group_admin:
394 <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>
395 <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>
395 % endif
396 % endif
396 ## determine if we have "any" option available
397 ## determine if we have "any" option available
397 <%
398 <%
398 can_create_repos = c.is_super_admin or group_admin or (group_write and create_on_write)
399 can_create_repos = c.is_super_admin or group_admin or (group_write and create_on_write)
399 can_create_repo_groups = c.is_super_admin or group_admin
400 can_create_repo_groups = c.is_super_admin or group_admin
400 has_actions = can_create_repos or can_create_repo_groups
401 has_actions = can_create_repos or can_create_repo_groups
401 %>
402 %>
402 <li class="${is_active('options')}">
403 <li class="${is_active('options')}">
403 % if has_actions:
404 % if has_actions:
404 <a class="menulink dropdown">
405 <a class="menulink dropdown">
405 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
406 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
406 </a>
407 </a>
407 <ul class="submenu">
408 <ul class="submenu">
408 %if can_create_repos:
409 %if can_create_repos:
409 <li><a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('Add Repository')}</a></li>
410 <li><a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('Add Repository')}</a></li>
410 %endif
411 %endif
411 %if can_create_repo_groups:
412 %if can_create_repo_groups:
412 <li><a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'Add Repository Group')}</a></li>
413 <li><a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'Add Repository Group')}</a></li>
413 %endif
414 %endif
414 </ul>
415 </ul>
415 % else:
416 % else:
416 <a class="menulink disabled">
417 <a class="menulink disabled">
417 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
418 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
418 </a>
419 </a>
419 % endif
420 % endif
420 </li>
421 </li>
421 </ul>
422 </ul>
422 </div>
423 </div>
423 <div class="clear"></div>
424 <div class="clear"></div>
424 </div>
425 </div>
425
426
426 <!--- REPO GROUP CONTEXT BAR -->
427 <!--- REPO GROUP CONTEXT BAR -->
427
428
428 </%def>
429 </%def>
429
430
430
431
431 <%def name="usermenu(active=False)">
432 <%def name="usermenu(active=False)">
432 ## USER MENU
433 ## USER MENU
433 <li id="quick_login_li" class="${'active' if active else ''}">
434 <li id="quick_login_li" class="${'active' if active else ''}">
434 % if c.rhodecode_user.username == h.DEFAULT_USER:
435 % if c.rhodecode_user.username == h.DEFAULT_USER:
435 <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">
436 <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">
436 ${gravatar(c.rhodecode_user.email, 20)}
437 ${gravatar(c.rhodecode_user.email, 20)}
437 <span class="user">
438 <span class="user">
438 <span>${_('Sign in')}</span>
439 <span>${_('Sign in')}</span>
439 </span>
440 </span>
440 </a>
441 </a>
441 % else:
442 % else:
442 ## logged in user
443 ## logged in user
443 <a id="quick_login_link" class="menulink childs">
444 <a id="quick_login_link" class="menulink childs">
444 ${gravatar(c.rhodecode_user.email, 20)}
445 ${gravatar(c.rhodecode_user.email, 20)}
445 <span class="user">
446 <span class="user">
446 <span class="menu_link_user">${c.rhodecode_user.username}</span>
447 <span class="menu_link_user">${c.rhodecode_user.username}</span>
447 <div class="show_more"></div>
448 <div class="show_more"></div>
448 </span>
449 </span>
449 </a>
450 </a>
450 ## subnav with menu for logged in user
451 ## subnav with menu for logged in user
451 <div class="user-menu submenu">
452 <div class="user-menu submenu">
452 <div id="quick_login">
453 <div id="quick_login">
453 %if c.rhodecode_user.username != h.DEFAULT_USER:
454 %if c.rhodecode_user.username != h.DEFAULT_USER:
454 <div class="">
455 <div class="">
455 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
456 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
456 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
457 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
457 <div class="email">${c.rhodecode_user.email}</div>
458 <div class="email">${c.rhodecode_user.email}</div>
458 </div>
459 </div>
459 <div class="">
460 <div class="">
460 <ol class="links">
461 <ol class="links">
461 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
462 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
462 % if c.rhodecode_user.personal_repo_group:
463 % if c.rhodecode_user.personal_repo_group:
463 <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>
464 <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>
464 % endif
465 % endif
465 <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li>
466 <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li>
466 ## bookmark-items
467 ## bookmark-items
467 <li class="bookmark-items">
468 <li class="bookmark-items">
468 ${_('Bookmarks')}
469 ${_('Bookmarks')}
469 <div class="pull-right">
470 <div class="pull-right">
470 <a href="${h.route_path('my_account_bookmarks')}">${_('Manage')}</a>
471 <a href="${h.route_path('my_account_bookmarks')}">${_('Manage')}</a>
471 </div>
472 </div>
472 </li>
473 </li>
473 % if not c.bookmark_items:
474 % if not c.bookmark_items:
474 <li>
475 <li>
475 <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a>
476 <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a>
476 </li>
477 </li>
477 % endif
478 % endif
478 % for item in c.bookmark_items:
479 % for item in c.bookmark_items:
479 <li>
480 <li>
480 % if item.repository:
481 % if item.repository:
481 <div>
482 <div>
482 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
483 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
483 <code>${item.position}</code>
484 <code>${item.position}</code>
484 % if item.repository.repo_type == 'hg':
485 % if item.repository.repo_type == 'hg':
485 <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i>
486 <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i>
486 % elif item.repository.repo_type == 'git':
487 % elif item.repository.repo_type == 'git':
487 <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i>
488 <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i>
488 % elif item.repository.repo_type == 'svn':
489 % elif item.repository.repo_type == 'svn':
489 <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i>
490 <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i>
490 % endif
491 % endif
491 ${(item.title or h.shorter(item.repository.repo_name, 30))}
492 ${(item.title or h.shorter(item.repository.repo_name, 30))}
492 </a>
493 </a>
493 </div>
494 </div>
494 % elif item.repository_group:
495 % elif item.repository_group:
495 <div>
496 <div>
496 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
497 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
497 <code>${item.position}</code>
498 <code>${item.position}</code>
498 <i class="icon-repo-group" title="${_('Repository group')}" style="font-size: 14px"></i>
499 <i class="icon-repo-group" title="${_('Repository group')}" style="font-size: 14px"></i>
499 ${(item.title or h.shorter(item.repository_group.group_name, 30))}
500 ${(item.title or h.shorter(item.repository_group.group_name, 30))}
500 </a>
501 </a>
501 </div>
502 </div>
502 % else:
503 % else:
503 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
504 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
504 <code>${item.position}</code>
505 <code>${item.position}</code>
505 ${item.title}
506 ${item.title}
506 </a>
507 </a>
507 % endif
508 % endif
508 </li>
509 </li>
509 % endfor
510 % endfor
510
511
511 <li class="logout">
512 <li class="logout">
512 ${h.secure_form(h.route_path('logout'), request=request)}
513 ${h.secure_form(h.route_path('logout'), request=request)}
513 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
514 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
514 ${h.end_form()}
515 ${h.end_form()}
515 </li>
516 </li>
516 </ol>
517 </ol>
517 </div>
518 </div>
518 %endif
519 %endif
519 </div>
520 </div>
520 </div>
521 </div>
521 ## unread counter
522 ## unread counter
522 <div class="pill_container">
523 <div class="pill_container">
523 <a class="menu_link_notifications ${'empty' if c.unread_notifications == 0 else ''}" href="${h.route_path('notifications_show_all')}">${c.unread_notifications}</a>
524 <a class="menu_link_notifications ${'empty' if c.unread_notifications == 0 else ''}" href="${h.route_path('notifications_show_all')}">${c.unread_notifications}</a>
524 </div>
525 </div>
525 % endif
526 % endif
526 </li>
527 </li>
527 </%def>
528 </%def>
528
529
529 <%def name="menu_items(active=None)">
530 <%def name="menu_items(active=None)">
530 <%
531 <%
531 def is_active(selected):
532 def is_active(selected):
532 if selected == active:
533 if selected == active:
533 return "active"
534 return "active"
534 return ""
535 return ""
535 %>
536 %>
536
537
537 <ul id="quick" class="main_nav navigation horizontal-list">
538 <ul id="quick" class="main_nav navigation horizontal-list">
538 ## notice box for important system messages
539 ## notice box for important system messages
539 <li style="display: none">
540 <li style="display: none">
540 <a class="notice-box" href="#openNotice" onclick="showNoticeBox(); return false">
541 <a class="notice-box" href="#openNotice" onclick="showNoticeBox(); return false">
541 <div class="menulabel-notice" >
542 <div class="menulabel-notice" >
542 0
543 0
543 </div>
544 </div>
544 </a>
545 </a>
545 </li>
546 </li>
546
547
547 ## Main filter
548 ## Main filter
548 <li>
549 <li>
549 <div class="menulabel main_filter_box">
550 <div class="menulabel main_filter_box">
550 <div class="main_filter_input_box">
551 <div class="main_filter_input_box">
551 <ul class="searchItems">
552 <ul class="searchItems">
552
553
553 % if c.template_context['search_context']['repo_id']:
554 % if c.template_context['search_context']['repo_id']:
554 <li class="searchTag searchTagFilter searchTagHidable" >
555 <li class="searchTag searchTagFilter searchTagHidable" >
555 ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">
556 ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">
556 <span class="tag">
557 <span class="tag">
557 This repo
558 This repo
558 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
559 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
559 </span>
560 </span>
560 ##</a>
561 ##</a>
561 </li>
562 </li>
562 % elif c.template_context['search_context']['repo_group_id']:
563 % elif c.template_context['search_context']['repo_group_id']:
563 <li class="searchTag searchTagFilter searchTagHidable">
564 <li class="searchTag searchTagFilter searchTagHidable">
564 ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">
565 ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">
565 <span class="tag">
566 <span class="tag">
566 This group
567 This group
567 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
568 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-cancel-circled"></i></a>
568 </span>
569 </span>
569 ##</a>
570 ##</a>
570 </li>
571 </li>
571 % endif
572 % endif
572
573
573 <li class="searchTagInput">
574 <li class="searchTagInput">
574 <input class="main_filter_input" id="main_filter" size="15" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" />
575 <input class="main_filter_input" id="main_filter" size="15" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" />
575 </li>
576 </li>
576 <li class="searchTag searchTagHelp">
577 <li class="searchTag searchTagHelp">
577 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
578 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
578 </li>
579 </li>
579 </ul>
580 </ul>
580 </div>
581 </div>
581 </div>
582 </div>
582
583
583 <div id="main_filter_help" style="display: none">
584 <div id="main_filter_help" style="display: none">
584 - Use '/' key to quickly access this field.
585 - Use '/' key to quickly access this field.
585
586
586 - Enter a name of repository, or repository group for quick search.
587 - Enter a name of repository, or repository group for quick search.
587
588
588 - Prefix query to allow special search:
589 - Prefix query to allow special search:
589
590
590 user:admin, to search for usernames, always global
591 user:admin, to search for usernames, always global
591
592
592 user_group:devops, to search for user groups, always global
593 user_group:devops, to search for user groups, always global
593
594
594 commit:efced4, to search for commits, scoped to repositories or groups
595 commit:efced4, to search for commits, scoped to repositories or groups
595
596
596 file:models.py, to search for file paths, scoped to repositories or groups
597 file:models.py, to search for file paths, scoped to repositories or groups
597
598
598 % if c.template_context['search_context']['repo_id']:
599 % if c.template_context['search_context']['repo_id']:
599 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>
600 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>
600 % elif c.template_context['search_context']['repo_group_id']:
601 % elif c.template_context['search_context']['repo_group_id']:
601 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>
602 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>
602 % else:
603 % else:
603 For advanced full text search visit: <a href="${h.route_path('search')}">global search</a>
604 For advanced full text search visit: <a href="${h.route_path('search')}">global search</a>
604 % endif
605 % endif
605 </div>
606 </div>
606 </li>
607 </li>
607
608
608 ## ROOT MENU
609 ## ROOT MENU
609 <li class="${is_active('home')}">
610 <li class="${is_active('home')}">
610 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
611 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
611 <div class="menulabel">${_('Home')}</div>
612 <div class="menulabel">${_('Home')}</div>
612 </a>
613 </a>
613 </li>
614 </li>
614
615
615 %if c.rhodecode_user.username != h.DEFAULT_USER:
616 %if c.rhodecode_user.username != h.DEFAULT_USER:
616 <li class="${is_active('journal')}">
617 <li class="${is_active('journal')}">
617 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
618 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
618 <div class="menulabel">${_('Journal')}</div>
619 <div class="menulabel">${_('Journal')}</div>
619 </a>
620 </a>
620 </li>
621 </li>
621 %else:
622 %else:
622 <li class="${is_active('journal')}">
623 <li class="${is_active('journal')}">
623 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
624 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
624 <div class="menulabel">${_('Public journal')}</div>
625 <div class="menulabel">${_('Public journal')}</div>
625 </a>
626 </a>
626 </li>
627 </li>
627 %endif
628 %endif
628
629
629 <li class="${is_active('gists')}">
630 <li class="${is_active('gists')}">
630 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
631 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
631 <div class="menulabel">${_('Gists')}</div>
632 <div class="menulabel">${_('Gists')}</div>
632 </a>
633 </a>
633 </li>
634 </li>
634
635
635 % if c.is_super_admin or c.is_delegated_admin:
636 % if c.is_super_admin or c.is_delegated_admin:
636 <li class="${is_active('admin')}">
637 <li class="${is_active('admin')}">
637 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
638 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
638 <div class="menulabel">${_('Admin')} </div>
639 <div class="menulabel">${_('Admin')} </div>
639 </a>
640 </a>
640 </li>
641 </li>
641 % endif
642 % endif
642
643
643 ## render extra user menu
644 ## render extra user menu
644 ${usermenu(active=(active=='my_account'))}
645 ${usermenu(active=(active=='my_account'))}
645
646
646 % if c.debug_style:
647 % if c.debug_style:
647 <li>
648 <li>
648 <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}">
649 <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}">
649 <div class="menulabel">${_('[Style]')}</div>
650 <div class="menulabel">${_('[Style]')}</div>
650 </a>
651 </a>
651 </li>
652 </li>
652 % endif
653 % endif
653 </ul>
654 </ul>
654
655
655 <script type="text/javascript">
656 <script type="text/javascript">
656 var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True";
657 var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True";
657
658
658 var formatRepoResult = function(result, container, query, escapeMarkup) {
659 var formatRepoResult = function(result, container, query, escapeMarkup) {
659 return function(data, escapeMarkup) {
660 return function(data, escapeMarkup) {
660 if (!data.repo_id){
661 if (!data.repo_id){
661 return data.text; // optgroup text Repositories
662 return data.text; // optgroup text Repositories
662 }
663 }
663
664
664 var tmpl = '';
665 var tmpl = '';
665 var repoType = data['repo_type'];
666 var repoType = data['repo_type'];
666 var repoName = data['text'];
667 var repoName = data['text'];
667
668
668 if(data && data.type == 'repo'){
669 if(data && data.type == 'repo'){
669 if(repoType === 'hg'){
670 if(repoType === 'hg'){
670 tmpl += '<i class="icon-hg"></i> ';
671 tmpl += '<i class="icon-hg"></i> ';
671 }
672 }
672 else if(repoType === 'git'){
673 else if(repoType === 'git'){
673 tmpl += '<i class="icon-git"></i> ';
674 tmpl += '<i class="icon-git"></i> ';
674 }
675 }
675 else if(repoType === 'svn'){
676 else if(repoType === 'svn'){
676 tmpl += '<i class="icon-svn"></i> ';
677 tmpl += '<i class="icon-svn"></i> ';
677 }
678 }
678 if(data['private']){
679 if(data['private']){
679 tmpl += '<i class="icon-lock" ></i> ';
680 tmpl += '<i class="icon-lock" ></i> ';
680 }
681 }
681 else if(visualShowPublicIcon){
682 else if(visualShowPublicIcon){
682 tmpl += '<i class="icon-unlock-alt"></i> ';
683 tmpl += '<i class="icon-unlock-alt"></i> ';
683 }
684 }
684 }
685 }
685 tmpl += escapeMarkup(repoName);
686 tmpl += escapeMarkup(repoName);
686 return tmpl;
687 return tmpl;
687
688
688 }(result, escapeMarkup);
689 }(result, escapeMarkup);
689 };
690 };
690
691
691 var formatRepoGroupResult = function(result, container, query, escapeMarkup) {
692 var formatRepoGroupResult = function(result, container, query, escapeMarkup) {
692 return function(data, escapeMarkup) {
693 return function(data, escapeMarkup) {
693 if (!data.repo_group_id){
694 if (!data.repo_group_id){
694 return data.text; // optgroup text Repositories
695 return data.text; // optgroup text Repositories
695 }
696 }
696
697
697 var tmpl = '';
698 var tmpl = '';
698 var repoGroupName = data['text'];
699 var repoGroupName = data['text'];
699
700
700 if(data){
701 if(data){
701
702
702 tmpl += '<i class="icon-repo-group"></i> ';
703 tmpl += '<i class="icon-repo-group"></i> ';
703
704
704 }
705 }
705 tmpl += escapeMarkup(repoGroupName);
706 tmpl += escapeMarkup(repoGroupName);
706 return tmpl;
707 return tmpl;
707
708
708 }(result, escapeMarkup);
709 }(result, escapeMarkup);
709 };
710 };
710
711
711 var escapeRegExChars = function (value) {
712 var escapeRegExChars = function (value) {
712 return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
713 return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
713 };
714 };
714
715
715 var getRepoIcon = function(repo_type) {
716 var getRepoIcon = function(repo_type) {
716 if (repo_type === 'hg') {
717 if (repo_type === 'hg') {
717 return '<i class="icon-hg"></i> ';
718 return '<i class="icon-hg"></i> ';
718 }
719 }
719 else if (repo_type === 'git') {
720 else if (repo_type === 'git') {
720 return '<i class="icon-git"></i> ';
721 return '<i class="icon-git"></i> ';
721 }
722 }
722 else if (repo_type === 'svn') {
723 else if (repo_type === 'svn') {
723 return '<i class="icon-svn"></i> ';
724 return '<i class="icon-svn"></i> ';
724 }
725 }
725 return ''
726 return ''
726 };
727 };
727
728
728 var autocompleteMainFilterFormatResult = function (data, value, org_formatter) {
729 var autocompleteMainFilterFormatResult = function (data, value, org_formatter) {
729
730
730 if (value.split(':').length === 2) {
731 if (value.split(':').length === 2) {
731 value = value.split(':')[1]
732 value = value.split(':')[1]
732 }
733 }
733
734
734 var searchType = data['type'];
735 var searchType = data['type'];
735 var valueDisplay = data['value_display'];
736 var valueDisplay = data['value_display'];
736
737
737 var pattern = '(' + escapeRegExChars(value) + ')';
738 var pattern = '(' + escapeRegExChars(value) + ')';
738
739
739 valueDisplay = Select2.util.escapeMarkup(valueDisplay);
740 valueDisplay = Select2.util.escapeMarkup(valueDisplay);
740
741
741 // highlight match
742 // highlight match
742 if (searchType != 'text') {
743 if (searchType != 'text') {
743 valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
744 valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
744 }
745 }
745
746
746 var icon = '';
747 var icon = '';
747
748
748 if (searchType === 'hint') {
749 if (searchType === 'hint') {
749 icon += '<i class="icon-repo-group"></i> ';
750 icon += '<i class="icon-repo-group"></i> ';
750 }
751 }
751 // full text search
752 // full text search
752 else if (searchType === 'search') {
753 else if (searchType === 'search') {
753 icon += '<i class="icon-more"></i> ';
754 icon += '<i class="icon-more"></i> ';
754 }
755 }
755 // repository
756 // repository
756 else if (searchType === 'repo') {
757 else if (searchType === 'repo') {
757
758
758 var repoIcon = getRepoIcon(data['repo_type']);
759 var repoIcon = getRepoIcon(data['repo_type']);
759 icon += repoIcon;
760 icon += repoIcon;
760
761
761 if (data['private']) {
762 if (data['private']) {
762 icon += '<i class="icon-lock" ></i> ';
763 icon += '<i class="icon-lock" ></i> ';
763 }
764 }
764 else if (visualShowPublicIcon) {
765 else if (visualShowPublicIcon) {
765 icon += '<i class="icon-unlock-alt"></i> ';
766 icon += '<i class="icon-unlock-alt"></i> ';
766 }
767 }
767 }
768 }
768 // repository groups
769 // repository groups
769 else if (searchType === 'repo_group') {
770 else if (searchType === 'repo_group') {
770 icon += '<i class="icon-repo-group"></i> ';
771 icon += '<i class="icon-repo-group"></i> ';
771 }
772 }
772 // user group
773 // user group
773 else if (searchType === 'user_group') {
774 else if (searchType === 'user_group') {
774 icon += '<i class="icon-group"></i> ';
775 icon += '<i class="icon-group"></i> ';
775 }
776 }
776 // user
777 // user
777 else if (searchType === 'user') {
778 else if (searchType === 'user') {
778 icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']);
779 icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']);
779 }
780 }
780 // commit
781 // commit
781 else if (searchType === 'commit') {
782 else if (searchType === 'commit') {
782 var repo_data = data['repo_data'];
783 var repo_data = data['repo_data'];
783 var repoIcon = getRepoIcon(repo_data['repository_type']);
784 var repoIcon = getRepoIcon(repo_data['repository_type']);
784 if (repoIcon) {
785 if (repoIcon) {
785 icon += repoIcon;
786 icon += repoIcon;
786 } else {
787 } else {
787 icon += '<i class="icon-tag"></i>';
788 icon += '<i class="icon-tag"></i>';
788 }
789 }
789 }
790 }
790 // file
791 // file
791 else if (searchType === 'file') {
792 else if (searchType === 'file') {
792 var repo_data = data['repo_data'];
793 var repo_data = data['repo_data'];
793 var repoIcon = getRepoIcon(repo_data['repository_type']);
794 var repoIcon = getRepoIcon(repo_data['repository_type']);
794 if (repoIcon) {
795 if (repoIcon) {
795 icon += repoIcon;
796 icon += repoIcon;
796 } else {
797 } else {
797 icon += '<i class="icon-tag"></i>';
798 icon += '<i class="icon-tag"></i>';
798 }
799 }
799 }
800 }
800 // generic text
801 // generic text
801 else if (searchType === 'text') {
802 else if (searchType === 'text') {
802 icon = '';
803 icon = '';
803 }
804 }
804
805
805 var tmpl = '<div class="ac-container-wrap">{0}{1}</div>';
806 var tmpl = '<div class="ac-container-wrap">{0}{1}</div>';
806 return tmpl.format(icon, valueDisplay);
807 return tmpl.format(icon, valueDisplay);
807 };
808 };
808
809
809 var handleSelect = function(element, suggestion) {
810 var handleSelect = function(element, suggestion) {
810 if (suggestion.type === "hint") {
811 if (suggestion.type === "hint") {
811 // we skip action
812 // we skip action
812 $('#main_filter').focus();
813 $('#main_filter').focus();
813 }
814 }
814 else if (suggestion.type === "text") {
815 else if (suggestion.type === "text") {
815 // we skip action
816 // we skip action
816 $('#main_filter').focus();
817 $('#main_filter').focus();
817
818
818 } else {
819 } else {
819 window.location = suggestion['url'];
820 window.location = suggestion['url'];
820 }
821 }
821 };
822 };
822
823
823 var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) {
824 var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) {
824 if (queryLowerCase.split(':').length === 2) {
825 if (queryLowerCase.split(':').length === 2) {
825 queryLowerCase = queryLowerCase.split(':')[1]
826 queryLowerCase = queryLowerCase.split(':')[1]
826 }
827 }
827 if (suggestion.type === "text") {
828 if (suggestion.type === "text") {
828 // special case we don't want to "skip" display for
829 // special case we don't want to "skip" display for
829 return true
830 return true
830 }
831 }
831 return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1;
832 return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1;
832 };
833 };
833
834
834 var cleanContext = {
835 var cleanContext = {
835 repo_view_type: null,
836 repo_view_type: null,
836
837
837 repo_id: null,
838 repo_id: null,
838 repo_name: "",
839 repo_name: "",
839
840
840 repo_group_id: null,
841 repo_group_id: null,
841 repo_group_name: null
842 repo_group_name: null
842 };
843 };
843 var removeGoToFilter = function () {
844 var removeGoToFilter = function () {
844 $('.searchTagHidable').hide();
845 $('.searchTagHidable').hide();
845 $('#main_filter').autocomplete(
846 $('#main_filter').autocomplete(
846 'setOptions', {params:{search_context: cleanContext}});
847 'setOptions', {params:{search_context: cleanContext}});
847 };
848 };
848
849
849 $('#main_filter').autocomplete({
850 $('#main_filter').autocomplete({
850 serviceUrl: pyroutes.url('goto_switcher_data'),
851 serviceUrl: pyroutes.url('goto_switcher_data'),
851 params: {
852 params: {
852 "search_context": templateContext.search_context
853 "search_context": templateContext.search_context
853 },
854 },
854 minChars:2,
855 minChars:2,
855 maxHeight:400,
856 maxHeight:400,
856 deferRequestBy: 300, //miliseconds
857 deferRequestBy: 300, //miliseconds
857 tabDisabled: true,
858 tabDisabled: true,
858 autoSelectFirst: false,
859 autoSelectFirst: false,
859 formatResult: autocompleteMainFilterFormatResult,
860 formatResult: autocompleteMainFilterFormatResult,
860 lookupFilter: autocompleteMainFilterResult,
861 lookupFilter: autocompleteMainFilterResult,
861 onSelect: function (element, suggestion) {
862 onSelect: function (element, suggestion) {
862 handleSelect(element, suggestion);
863 handleSelect(element, suggestion);
863 return false;
864 return false;
864 },
865 },
865 onSearchError: function (element, query, jqXHR, textStatus, errorThrown) {
866 onSearchError: function (element, query, jqXHR, textStatus, errorThrown) {
866 if (jqXHR !== 'abort') {
867 if (jqXHR !== 'abort') {
867 alert("Error during search.\nError code: {0}".format(textStatus));
868 alert("Error during search.\nError code: {0}".format(textStatus));
868 window.location = '';
869 window.location = '';
869 }
870 }
870 }
871 }
871 });
872 });
872
873
873 showMainFilterBox = function () {
874 showMainFilterBox = function () {
874 $('#main_filter_help').toggle();
875 $('#main_filter_help').toggle();
875 };
876 };
876
877
877 $('#main_filter').on('keydown.autocomplete', function (e) {
878 $('#main_filter').on('keydown.autocomplete', function (e) {
878
879
879 var BACKSPACE = 8;
880 var BACKSPACE = 8;
880 var el = $(e.currentTarget);
881 var el = $(e.currentTarget);
881 if(e.which === BACKSPACE){
882 if(e.which === BACKSPACE){
882 var inputVal = el.val();
883 var inputVal = el.val();
883 if (inputVal === ""){
884 if (inputVal === ""){
884 removeGoToFilter()
885 removeGoToFilter()
885 }
886 }
886 }
887 }
887 });
888 });
888
889
889 </script>
890 </script>
890 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
891 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
891 </%def>
892 </%def>
892
893
893 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
894 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
894 <div class="modal-dialog">
895 <div class="modal-dialog">
895 <div class="modal-content">
896 <div class="modal-content">
896 <div class="modal-header">
897 <div class="modal-header">
897 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
898 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
898 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
899 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
899 </div>
900 </div>
900 <div class="modal-body">
901 <div class="modal-body">
901 <div class="block-left">
902 <div class="block-left">
902 <table class="keyboard-mappings">
903 <table class="keyboard-mappings">
903 <tbody>
904 <tbody>
904 <tr>
905 <tr>
905 <th></th>
906 <th></th>
906 <th>${_('Site-wide shortcuts')}</th>
907 <th>${_('Site-wide shortcuts')}</th>
907 </tr>
908 </tr>
908 <%
909 <%
909 elems = [
910 elems = [
910 ('/', 'Use quick search box'),
911 ('/', 'Use quick search box'),
911 ('g h', 'Goto home page'),
912 ('g h', 'Goto home page'),
912 ('g g', 'Goto my private gists page'),
913 ('g g', 'Goto my private gists page'),
913 ('g G', 'Goto my public gists page'),
914 ('g G', 'Goto my public gists page'),
914 ('g 0-9', 'Goto bookmarked items from 0-9'),
915 ('g 0-9', 'Goto bookmarked items from 0-9'),
915 ('n r', 'New repository page'),
916 ('n r', 'New repository page'),
916 ('n g', 'New gist page'),
917 ('n g', 'New gist page'),
917 ]
918 ]
918 %>
919 %>
919 %for key, desc in elems:
920 %for key, desc in elems:
920 <tr>
921 <tr>
921 <td class="keys">
922 <td class="keys">
922 <span class="key tag">${key}</span>
923 <span class="key tag">${key}</span>
923 </td>
924 </td>
924 <td>${desc}</td>
925 <td>${desc}</td>
925 </tr>
926 </tr>
926 %endfor
927 %endfor
927 </tbody>
928 </tbody>
928 </table>
929 </table>
929 </div>
930 </div>
930 <div class="block-left">
931 <div class="block-left">
931 <table class="keyboard-mappings">
932 <table class="keyboard-mappings">
932 <tbody>
933 <tbody>
933 <tr>
934 <tr>
934 <th></th>
935 <th></th>
935 <th>${_('Repositories')}</th>
936 <th>${_('Repositories')}</th>
936 </tr>
937 </tr>
937 <%
938 <%
938 elems = [
939 elems = [
939 ('g s', 'Goto summary page'),
940 ('g s', 'Goto summary page'),
940 ('g c', 'Goto changelog page'),
941 ('g c', 'Goto changelog page'),
941 ('g f', 'Goto files page'),
942 ('g f', 'Goto files page'),
942 ('g F', 'Goto files page with file search activated'),
943 ('g F', 'Goto files page with file search activated'),
943 ('g p', 'Goto pull requests page'),
944 ('g p', 'Goto pull requests page'),
944 ('g o', 'Goto repository settings'),
945 ('g o', 'Goto repository settings'),
945 ('g O', 'Goto repository permissions settings'),
946 ('g O', 'Goto repository permissions settings'),
946 ]
947 ]
947 %>
948 %>
948 %for key, desc in elems:
949 %for key, desc in elems:
949 <tr>
950 <tr>
950 <td class="keys">
951 <td class="keys">
951 <span class="key tag">${key}</span>
952 <span class="key tag">${key}</span>
952 </td>
953 </td>
953 <td>${desc}</td>
954 <td>${desc}</td>
954 </tr>
955 </tr>
955 %endfor
956 %endfor
956 </tbody>
957 </tbody>
957 </table>
958 </table>
958 </div>
959 </div>
959 </div>
960 </div>
960 <div class="modal-footer">
961 <div class="modal-footer">
961 </div>
962 </div>
962 </div><!-- /.modal-content -->
963 </div><!-- /.modal-content -->
963 </div><!-- /.modal-dialog -->
964 </div><!-- /.modal-dialog -->
964 </div><!-- /.modal -->
965 </div><!-- /.modal -->
965
966
General Comments 0
You need to be logged in to leave comments. Login now