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