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