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