##// END OF EJS Templates
implemented repo switcher list as dynamically loaded by xhr requestt....
marcink -
r1158:f63cc1cb beta
parent child Browse files
Show More
@@ -0,0 +1,15
1 ## -*- coding: utf-8 -*-
2 %for repo in c.repos_list:
3
4 %if repo['dbrepo']['private']:
5 <li>
6 <img src="${h.url("/images/icons/lock.png")}" alt="${_('Private repository')}" class="repo_switcher_type"/>
7 ${h.link_to(repo['name'].name,h.url('summary_home',repo_name=repo['name']),class_="%s" % repo['dbrepo']['repo_type'])}
8 </li>
9 %else:
10 <li>
11 <img src="${h.url("/images/icons/lock_open.png")}" alt="${_('Public repository')}" class="repo_switcher_type" />
12 ${h.link_to(repo['name'],h.url('summary_home',repo_name=repo['name']),class_="%s" % repo['dbrepo']['repo_type'])}
13 </li>
14 %endif
15 %endfor No newline at end of file
@@ -1,238 +1,239
1 1 """
2 2 Routes configuration
3 3
4 4 The more specific and detailed routes should be defined first so they
5 5 may take precedent over the more generic routes. For more information
6 6 refer to the routes manual at http://routes.groovie.org/docs/
7 7 """
8 8 from __future__ import with_statement
9 9 from routes import Mapper
10 10 from rhodecode.lib.utils import check_repo_fast as cr
11 11
12 12 def make_map(config):
13 13 """Create, configure and return the routes Mapper"""
14 14 routes_map = Mapper(directory=config['pylons.paths']['controllers'],
15 15 always_scan=config['debug'])
16 16 routes_map.minimization = False
17 17 routes_map.explicit = False
18 18
19 19 def check_repo(environ, match_dict):
20 20 """
21 21 check for valid repository for proper 404 handling
22 22
23 23 :param environ:
24 24 :param match_dict:
25 25 """
26 26 repo_name = match_dict.get('repo_name')
27 27 return not cr(repo_name, config['base_path'])
28 28
29 29 # The ErrorController route (handles 404/500 error pages); it should
30 30 # likely stay at the top, ensuring it can always be resolved
31 31 routes_map.connect('/error/{action}', controller='error')
32 32 routes_map.connect('/error/{action}/{id}', controller='error')
33 33
34 34 #==========================================================================
35 35 # CUSTOM ROUTES HERE
36 36 #==========================================================================
37 37
38 38 #MAIN PAGE
39 39 routes_map.connect('home', '/', controller='home', action='index')
40 routes_map.connect('repo_switcher', '/repos', controller='home', action='repo_switcher')
40 41 routes_map.connect('bugtracker', "http://bitbucket.org/marcinkuzminski/rhodecode/issues", _static=True)
41 42 routes_map.connect('gpl_license', "http://www.gnu.org/licenses/gpl.html", _static=True)
42 43 routes_map.connect('rhodecode_official', "http://rhodecode.org", _static=True)
43 44
44 45 #ADMIN REPOSITORY REST ROUTES
45 46 with routes_map.submapper(path_prefix='/_admin', controller='admin/repos') as m:
46 47 m.connect("repos", "/repos",
47 48 action="create", conditions=dict(method=["POST"]))
48 49 m.connect("repos", "/repos",
49 50 action="index", conditions=dict(method=["GET"]))
50 51 m.connect("formatted_repos", "/repos.{format}",
51 52 action="index",
52 53 conditions=dict(method=["GET"]))
53 54 m.connect("new_repo", "/repos/new",
54 55 action="new", conditions=dict(method=["GET"]))
55 56 m.connect("formatted_new_repo", "/repos/new.{format}",
56 57 action="new", conditions=dict(method=["GET"]))
57 58 m.connect("/repos/{repo_name:.*}",
58 59 action="update", conditions=dict(method=["PUT"],
59 60 function=check_repo))
60 61 m.connect("/repos/{repo_name:.*}",
61 62 action="delete", conditions=dict(method=["DELETE"],
62 63 function=check_repo))
63 64 m.connect("edit_repo", "/repos/{repo_name:.*}/edit",
64 65 action="edit", conditions=dict(method=["GET"],
65 66 function=check_repo))
66 67 m.connect("formatted_edit_repo", "/repos/{repo_name:.*}.{format}/edit",
67 68 action="edit", conditions=dict(method=["GET"],
68 69 function=check_repo))
69 70 m.connect("repo", "/repos/{repo_name:.*}",
70 71 action="show", conditions=dict(method=["GET"],
71 72 function=check_repo))
72 73 m.connect("formatted_repo", "/repos/{repo_name:.*}.{format}",
73 74 action="show", conditions=dict(method=["GET"],
74 75 function=check_repo))
75 76 #ajax delete repo perm user
76 77 m.connect('delete_repo_user', "/repos_delete_user/{repo_name:.*}",
77 78 action="delete_perm_user", conditions=dict(method=["DELETE"],
78 79 function=check_repo))
79 80 #ajax delete repo perm users_group
80 81 m.connect('delete_repo_users_group', "/repos_delete_users_group/{repo_name:.*}",
81 82 action="delete_perm_users_group", conditions=dict(method=["DELETE"],
82 83 function=check_repo))
83 84
84 85 #settings actions
85 86 m.connect('repo_stats', "/repos_stats/{repo_name:.*}",
86 87 action="repo_stats", conditions=dict(method=["DELETE"],
87 88 function=check_repo))
88 89 m.connect('repo_cache', "/repos_cache/{repo_name:.*}",
89 90 action="repo_cache", conditions=dict(method=["DELETE"],
90 91 function=check_repo))
91 92 m.connect('repo_public_journal', "/repos_public_journal/{repo_name:.*}",
92 93 action="repo_public_journal", conditions=dict(method=["PUT"],
93 94 function=check_repo))
94 95 m.connect('repo_pull', "/repo_pull/{repo_name:.*}",
95 96 action="repo_pull", conditions=dict(method=["PUT"],
96 97 function=check_repo))
97 98
98 99
99 100 #ADMIN USER REST ROUTES
100 101 routes_map.resource('user', 'users', controller='admin/users', path_prefix='/_admin')
101 102
102 103 #ADMIN USER REST ROUTES
103 104 routes_map.resource('users_group', 'users_groups', controller='admin/users_groups', path_prefix='/_admin')
104 105
105 106 #ADMIN GROUP REST ROUTES
106 107 routes_map.resource('group', 'groups', controller='admin/groups', path_prefix='/_admin')
107 108
108 109 #ADMIN PERMISSIONS REST ROUTES
109 110 routes_map.resource('permission', 'permissions', controller='admin/permissions', path_prefix='/_admin')
110 111
111 112 ##ADMIN LDAP SETTINGS
112 113 routes_map.connect('ldap_settings', '/_admin/ldap', controller='admin/ldap_settings',
113 114 action='ldap_settings', conditions=dict(method=["POST"]))
114 115 routes_map.connect('ldap_home', '/_admin/ldap', controller='admin/ldap_settings',)
115 116
116 117
117 118 #ADMIN SETTINGS REST ROUTES
118 119 with routes_map.submapper(path_prefix='/_admin', controller='admin/settings') as m:
119 120 m.connect("admin_settings", "/settings",
120 121 action="create", conditions=dict(method=["POST"]))
121 122 m.connect("admin_settings", "/settings",
122 123 action="index", conditions=dict(method=["GET"]))
123 124 m.connect("formatted_admin_settings", "/settings.{format}",
124 125 action="index", conditions=dict(method=["GET"]))
125 126 m.connect("admin_new_setting", "/settings/new",
126 127 action="new", conditions=dict(method=["GET"]))
127 128 m.connect("formatted_admin_new_setting", "/settings/new.{format}",
128 129 action="new", conditions=dict(method=["GET"]))
129 130 m.connect("/settings/{setting_id}",
130 131 action="update", conditions=dict(method=["PUT"]))
131 132 m.connect("/settings/{setting_id}",
132 133 action="delete", conditions=dict(method=["DELETE"]))
133 134 m.connect("admin_edit_setting", "/settings/{setting_id}/edit",
134 135 action="edit", conditions=dict(method=["GET"]))
135 136 m.connect("formatted_admin_edit_setting", "/settings/{setting_id}.{format}/edit",
136 137 action="edit", conditions=dict(method=["GET"]))
137 138 m.connect("admin_setting", "/settings/{setting_id}",
138 139 action="show", conditions=dict(method=["GET"]))
139 140 m.connect("formatted_admin_setting", "/settings/{setting_id}.{format}",
140 141 action="show", conditions=dict(method=["GET"]))
141 142 m.connect("admin_settings_my_account", "/my_account",
142 143 action="my_account", conditions=dict(method=["GET"]))
143 144 m.connect("admin_settings_my_account_update", "/my_account_update",
144 145 action="my_account_update", conditions=dict(method=["PUT"]))
145 146 m.connect("admin_settings_create_repository", "/create_repository",
146 147 action="create_repository", conditions=dict(method=["GET"]))
147 148
148 149 #ADMIN MAIN PAGES
149 150 with routes_map.submapper(path_prefix='/_admin', controller='admin/admin') as m:
150 151 m.connect('admin_home', '', action='index')#main page
151 152 m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9\. _-]*}',
152 153 action='add_repo')
153 154
154 155
155 156 #USER JOURNAL
156 157 routes_map.connect('journal', '/_admin/journal', controller='journal',)
157 158 routes_map.connect('public_journal', '/_admin/public_journal', controller='journal', action="public_journal")
158 159 routes_map.connect('public_journal_rss', '/_admin/public_journal_rss', controller='journal', action="public_journal_rss")
159 160 routes_map.connect('public_journal_atom', '/_admin/public_journal_atom', controller='journal', action="public_journal_atom")
160 161
161 162 routes_map.connect('toggle_following', '/_admin/toggle_following', controller='journal',
162 163 action='toggle_following', conditions=dict(method=["POST"]))
163 164
164 165
165 166 #SEARCH
166 167 routes_map.connect('search', '/_admin/search', controller='search',)
167 168 routes_map.connect('search_repo', '/_admin/search/{search_repo:.*}', controller='search')
168 169
169 170 #LOGIN/LOGOUT/REGISTER/SIGN IN
170 171 routes_map.connect('login_home', '/_admin/login', controller='login')
171 172 routes_map.connect('logout_home', '/_admin/logout', controller='login', action='logout')
172 173 routes_map.connect('register', '/_admin/register', controller='login', action='register')
173 174 routes_map.connect('reset_password', '/_admin/password_reset', controller='login', action='password_reset')
174 175
175 176 #FEEDS
176 177 routes_map.connect('rss_feed_home', '/{repo_name:.*}/feed/rss',
177 178 controller='feed', action='rss',
178 179 conditions=dict(function=check_repo))
179 180 routes_map.connect('atom_feed_home', '/{repo_name:.*}/feed/atom',
180 181 controller='feed', action='atom',
181 182 conditions=dict(function=check_repo))
182 183
183 184
184 185 #REPOSITORY ROUTES
185 186 routes_map.connect('changeset_home', '/{repo_name:.*}/changeset/{revision}',
186 187 controller='changeset', revision='tip',
187 188 conditions=dict(function=check_repo))
188 189 routes_map.connect('raw_changeset_home', '/{repo_name:.*}/raw-changeset/{revision}',
189 190 controller='changeset', action='raw_changeset', revision='tip',
190 191 conditions=dict(function=check_repo))
191 192 routes_map.connect('summary_home', '/{repo_name:.*}',
192 193 controller='summary', conditions=dict(function=check_repo))
193 194 routes_map.connect('summary_home', '/{repo_name:.*}/summary',
194 195 controller='summary', conditions=dict(function=check_repo))
195 196 routes_map.connect('shortlog_home', '/{repo_name:.*}/shortlog',
196 197 controller='shortlog', conditions=dict(function=check_repo))
197 198 routes_map.connect('branches_home', '/{repo_name:.*}/branches',
198 199 controller='branches', conditions=dict(function=check_repo))
199 200 routes_map.connect('tags_home', '/{repo_name:.*}/tags',
200 201 controller='tags', conditions=dict(function=check_repo))
201 202 routes_map.connect('changelog_home', '/{repo_name:.*}/changelog',
202 203 controller='changelog', conditions=dict(function=check_repo))
203 204 routes_map.connect('files_home', '/{repo_name:.*}/files/{revision}/{f_path:.*}',
204 205 controller='files', revision='tip', f_path='',
205 206 conditions=dict(function=check_repo))
206 207 routes_map.connect('files_diff_home', '/{repo_name:.*}/diff/{f_path:.*}',
207 208 controller='files', action='diff', revision='tip', f_path='',
208 209 conditions=dict(function=check_repo))
209 210 routes_map.connect('files_rawfile_home', '/{repo_name:.*}/rawfile/{revision}/{f_path:.*}',
210 211 controller='files', action='rawfile', revision='tip', f_path='',
211 212 conditions=dict(function=check_repo))
212 213 routes_map.connect('files_raw_home', '/{repo_name:.*}/raw/{revision}/{f_path:.*}',
213 214 controller='files', action='raw', revision='tip', f_path='',
214 215 conditions=dict(function=check_repo))
215 216 routes_map.connect('files_annotate_home', '/{repo_name:.*}/annotate/{revision}/{f_path:.*}',
216 217 controller='files', action='annotate', revision='tip', f_path='',
217 218 conditions=dict(function=check_repo))
218 219 routes_map.connect('files_archive_home', '/{repo_name:.*}/archive/{fname}',
219 220 controller='files', action='archivefile',
220 221 conditions=dict(function=check_repo))
221 222 routes_map.connect('repo_settings_delete', '/{repo_name:.*}/settings',
222 223 controller='settings', action="delete",
223 224 conditions=dict(method=["DELETE"], function=check_repo))
224 225 routes_map.connect('repo_settings_update', '/{repo_name:.*}/settings',
225 226 controller='settings', action="update",
226 227 conditions=dict(method=["PUT"], function=check_repo))
227 228 routes_map.connect('repo_settings_home', '/{repo_name:.*}/settings',
228 229 controller='settings', action='index',
229 230 conditions=dict(function=check_repo))
230 231
231 232 routes_map.connect('repo_fork_create_home', '/{repo_name:.*}/fork',
232 233 controller='settings', action='fork_create',
233 234 conditions=dict(function=check_repo, method=["POST"]))
234 235 routes_map.connect('repo_fork_home', '/{repo_name:.*}/fork',
235 236 controller='settings', action='fork',
236 237 conditions=dict(function=check_repo))
237 238
238 239 return routes_map
@@ -1,65 +1,75
1 1 # -*- coding: utf-8 -*-
2 2 """
3 3 rhodecode.controllers.home
4 4 ~~~~~~~~~~~~~~~~~~~~~~~~~~
5 5
6 6 Home controller for Rhodecode
7 7
8 8 :created_on: Feb 18, 2010
9 9 :author: marcink
10 10 :copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com>
11 11 :license: GPLv3, see COPYING for more details.
12 12 """
13 13 # This program is free software; you can redistribute it and/or
14 14 # modify it under the terms of the GNU General Public License
15 15 # as published by the Free Software Foundation; version 2
16 16 # of the License or (at your opinion) any later version of the license.
17 17 #
18 18 # This program is distributed in the hope that it will be useful,
19 19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 21 # GNU General Public License for more details.
22 22 #
23 23 # You should have received a copy of the GNU General Public License
24 24 # along with this program; if not, write to the Free Software
25 25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
26 26 # MA 02110-1301, USA.
27 27
28 28 import logging
29 29 from operator import itemgetter
30 30
31 31 from pylons import tmpl_context as c, request
32 from paste.httpexceptions import HTTPBadRequest
32 33
33 34 from rhodecode.lib.auth import LoginRequired
34 35 from rhodecode.lib.base import BaseController, render
35 36
37
36 38 log = logging.getLogger(__name__)
37 39
38 40 class HomeController(BaseController):
39 41
40 42 @LoginRequired()
41 43 def __before__(self):
42 44 super(HomeController, self).__before__()
43 45
44 46 def index(self):
45 47 sortables = ['name', 'description', 'last_change', 'tip', 'owner']
46 48 current_sort = request.GET.get('sort', 'name')
47 49 current_sort_slug = current_sort.replace('-', '')
48 50
49 51 if current_sort_slug not in sortables:
50 52 c.sort_by = 'name'
51 53 current_sort_slug = c.sort_by
52 54 else:
53 55 c.sort_by = current_sort
54 56 c.sort_slug = current_sort_slug
55 57
56 58 sort_key = current_sort_slug + '_sort'
57 59
58 60 if c.sort_by.startswith('-'):
59 61 c.repos_list = sorted(c.cached_repo_list, key=itemgetter(sort_key),
60 62 reverse=True)
61 63 else:
62 64 c.repos_list = sorted(c.cached_repo_list, key=itemgetter(sort_key),
63 65 reverse=False)
64 66
65 67 return render('/index.html')
68
69 def repo_switcher(self):
70 if request.is_xhr:
71 c.repos_list = sorted(c.cached_repo_list,
72 key=itemgetter('name_sort'), reverse=False)
73 return render('/repo_switcher_list.html')
74 else:
75 return HTTPBadRequest()
@@ -1,303 +1,315
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="root.html"/>
3 3
4 4 <!-- HEADER -->
5 5 <div id="header">
6 6 <!-- user -->
7 7 <ul id="logged-user">
8 8 <li class="first">
9 9 <div class="gravatar">
10 10 <img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,20)}" />
11 11 </div>
12 12 <div class="account">
13 13 %if c.rhodecode_user.username == 'default':
14 14 <a href="${h.url('public_journal')}">${_('Public journal')}</a>
15 15 %else:
16 16 ${h.link_to(c.rhodecode_user.username,h.url('admin_settings_my_account'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
17 17 %endif
18 18 </div>
19 19 </li>
20 20 <li>
21 21 <a href="${h.url('home')}">${_('Home')}</a>
22 22 </li>
23 23 %if c.rhodecode_user.username != 'default':
24 24 <li>
25 25 <a href="${h.url('journal')}">${_('Journal')}</a>
26 26 ##(${c.unread_journal}
27 27 </li>
28 28 %endif
29 29 %if c.rhodecode_user.username == 'default':
30 30 <li class="last highlight">${h.link_to(u'Login',h.url('login_home'))}</li>
31 31 %else:
32 32 <li class="last highlight">${h.link_to(u'Log Out',h.url('logout_home'))}</li>
33 33 %endif
34 34 </ul>
35 35 <!-- end user -->
36 36 <div id="header-inner" class="title top-left-rounded-corner top-right-rounded-corner">
37 37 <div id="logo">
38 38 <h1><a href="${h.url('home')}">${c.rhodecode_name}</a></h1>
39 39 </div>
40 40 <!-- MENU -->
41 41 ${self.page_nav()}
42 42 <!-- END MENU -->
43 43 ${self.body()}
44 44 </div>
45 45 </div>
46 46 <!-- END HEADER -->
47 47
48 48 <!-- CONTENT -->
49 49 <div id="content">
50 50 <div class="flash_msg">
51 51 <% messages = h.flash.pop_messages() %>
52 52 % if messages:
53 53 <ul id="flash-messages">
54 54 % for message in messages:
55 55 <li class="${message.category}_msg">${message}</li>
56 56 % endfor
57 57 </ul>
58 58 % endif
59 59 </div>
60 60 <div id="main">
61 61 ${next.main()}
62 62 </div>
63 63 </div>
64 64 <!-- END CONTENT -->
65 65
66 66 <!-- FOOTER -->
67 67 <div id="footer">
68 68 <div id="footer-inner" class="title bottom-left-rounded-corner bottom-right-rounded-corner">
69 69 <div>
70 70 <p class="footer-link">
71 71 <a href="${h.url('bugtracker')}">${_('Submit a bug')}</a>
72 72 </p>
73 73 <p class="footer-link">
74 74 <a href="${h.url('gpl_license')}">${_('GPL license')}</a>
75 75 </p>
76 76 <p class="footer-link-right">
77 77 <a href="${h.url('rhodecode_official')}">RhodeCode</a>
78 78 ${c.rhodecode_version} &copy; 2010-${h.datetime.today().year} by Marcin Kuzminski
79 79 </p>
80 80 </div>
81 81 </div>
82 82 <script type="text/javascript">
83 83 function tooltip_activate(){
84 84 ${h.tooltip.activate()}
85 85 }
86 86 tooltip_activate();
87 87 </script>
88 88 </div>
89 89 <!-- END FOOTER -->
90 90
91 91 ### MAKO DEFS ###
92 92 <%def name="page_nav()">
93 93 ${self.menu()}
94 94 </%def>
95 95
96 96 <%def name="breadcrumbs()">
97 97 <div class="breadcrumbs">
98 98 ${self.breadcrumbs_links()}
99 99 </div>
100 100 </%def>
101 101
102 102
103 103 <%def name="menu(current=None)">
104 104 <%
105 105 def is_current(selected):
106 106 if selected == current:
107 107 return h.literal('class="current"')
108 108 %>
109 109 %if current not in ['home','admin']:
110 110 ##REGULAR MENU
111 111 <ul id="quick">
112 112 <!-- repo switcher -->
113 113 <li>
114 114 <a id="repo_switcher" title="${_('Switch repository')}" href="#">
115 115 <span class="icon">
116 116 <img src="${h.url("/images/icons/database.png")}" alt="${_('Products')}" />
117 117 </span>
118 118 <span>&darr;</span>
119 119 </a>
120 <ul class="repo_switcher">
121 %for repo in c.cached_repo_list:
122
123 %if repo['dbrepo']['private']:
124 <li><img src="${h.url("/images/icons/lock.png")}" alt="${_('Private repository')}" class="repo_switcher_type"/>${h.link_to(repo['repo'].name,h.url('summary_home',repo_name=repo['repo'].name),class_="%s" % repo['dbrepo']['repo_type'])}</li>
125 %else:
126 <li><img src="${h.url("/images/icons/lock_open.png")}" alt="${_('Public repository')}" class="repo_switcher_type" />${h.link_to(repo['repo'].name,h.url('summary_home',repo_name=repo['repo'].name),class_="%s" % repo['dbrepo']['repo_type'])}</li>
127 %endif
128 %endfor
129 </ul>
120 <ul id="repo_switcher_list" class="repo_switcher">
121 <li>
122 <a href="#">${_('loading...')}</a>
123 </li>
124 </ul>
125 <script type="text/javascript">
126 YUE.on('repo_switcher','mouseover',function(){
127 var loaded = YUD.hasClass('repo_switcher','loaded');
128 if(!loaded){
129 YUD.addClass('repo_switcher','loaded');
130 YAHOO.util.Connect.asyncRequest('GET',"${h.url('repo_switcher')}",{
131 success:function(o){
132 YUD.get('repo_switcher_list').innerHTML = o.responseText;
133 },
134 failure:function(o){
135 YUD.removeClass('repo_switcher','loaded');
136 }
137 },null);
138 }
139 return false;
140 });
141 </script>
130 142 </li>
131 143
132 144 <li ${is_current('summary')}>
133 145 <a title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}">
134 146 <span class="icon">
135 147 <img src="${h.url("/images/icons/clipboard_16.png")}" alt="${_('Summary')}" />
136 148 </span>
137 149 <span>${_('Summary')}</span>
138 150 </a>
139 151 </li>
140 152 ##<li ${is_current('shortlog')}>
141 153 ## <a title="${_('Shortlog')}" href="${h.url('shortlog_home',repo_name=c.repo_name)}">
142 154 ## <span class="icon">
143 155 ## <img src="${h.url("/images/icons/application_view_list.png")}" alt="${_('Shortlog')}" />
144 156 ## </span>
145 157 ## <span>${_('Shortlog')}</span>
146 158 ## </a>
147 159 ##</li>
148 160 <li ${is_current('changelog')}>
149 161 <a title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=c.repo_name)}">
150 162 <span class="icon">
151 163 <img src="${h.url("/images/icons/time.png")}" alt="${_('Changelog')}" />
152 164 </span>
153 165 <span>${_('Changelog')}</span>
154 166 </a>
155 167 </li>
156 168
157 169 <li ${is_current('switch_to')}>
158 170 <a title="${_('Switch to')}" href="#">
159 171 <span class="icon">
160 172 <img src="${h.url("/images/icons/arrow_switch.png")}" alt="${_('Switch to')}" />
161 173 </span>
162 174 <span>${_('Switch to')}</span>
163 175 </a>
164 176 <ul>
165 177 <li>
166 178 ${h.link_to('%s (%s)' % (_('branches'),len(c.rhodecode_repo.branches.values()),),h.url('branches_home',repo_name=c.repo_name),class_='branches childs')}
167 179 <ul>
168 180 %if c.rhodecode_repo.branches.values():
169 181 %for cnt,branch in enumerate(c.rhodecode_repo.branches.items()):
170 182 <li>${h.link_to('%s - %s' % (branch[0],h.short_id(branch[1])),h.url('files_home',repo_name=c.repo_name,revision=branch[1]))}</li>
171 183 %endfor
172 184 %else:
173 185 <li>${h.link_to(_('There are no branches yet'),'#')}</li>
174 186 %endif
175 187 </ul>
176 188 </li>
177 189 <li>
178 190 ${h.link_to('%s (%s)' % (_('tags'),len(c.rhodecode_repo.tags.values()),),h.url('tags_home',repo_name=c.repo_name),class_='tags childs')}
179 191 <ul>
180 192 %if c.rhodecode_repo.tags.values():
181 193 %for cnt,tag in enumerate(c.rhodecode_repo.tags.items()):
182 194 <li>${h.link_to('%s - %s' % (tag[0],h.short_id(tag[1])),h.url('files_home',repo_name=c.repo_name,revision=tag[1]))}</li>
183 195 %endfor
184 196 %else:
185 197 <li>${h.link_to(_('There are no tags yet'),'#')}</li>
186 198 %endif
187 199 </ul>
188 200 </li>
189 201 </ul>
190 202 </li>
191 203 <li ${is_current('files')}>
192 204 <a title="${_('Files')}" href="${h.url('files_home',repo_name=c.repo_name)}">
193 205 <span class="icon">
194 206 <img src="${h.url("/images/icons/file.png")}" alt="${_('Files')}" />
195 207 </span>
196 208 <span>${_('Files')}</span>
197 209 </a>
198 210 </li>
199 211
200 212 <li ${is_current('options')}>
201 213 <a title="${_('Options')}" href="#">
202 214 <span class="icon">
203 215 <img src="${h.url("/images/icons/table_gear.png")}" alt="${_('Admin')}" />
204 216 </span>
205 217 <span>${_('Options')}</span>
206 218 </a>
207 219 <ul>
208 220 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
209 221 %if h.HasPermissionAll('hg.admin')('access settings on repository'):
210 222 <li>${h.link_to(_('settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li>
211 223 %else:
212 224 <li>${h.link_to(_('settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li>
213 225 %endif
214 226 %endif
215 227 <li>${h.link_to(_('fork'),h.url('repo_fork_home',repo_name=c.repo_name),class_='fork')}</li>
216 228 <li>${h.link_to(_('search'),h.url('search_repo',search_repo=c.repo_name),class_='search')}</li>
217 229
218 230 %if h.HasPermissionAll('hg.admin')('access admin main page'):
219 231 <li>
220 232 ${h.link_to(_('admin'),h.url('admin_home'),class_='admin')}
221 233 <%def name="admin_menu()">
222 234 <ul>
223 235 <li>${h.link_to(_('journal'),h.url('admin_home'),class_='journal')}</li>
224 236 <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li>
225 237 <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li>
226 238 <li>${h.link_to(_('users groups'),h.url('users_groups'),class_='groups')}</li>
227 239 <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li>
228 240 <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li>
229 241 <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li>
230 242 </ul>
231 243 </%def>
232 244
233 245 ${admin_menu()}
234 246 </li>
235 247 %endif
236 248
237 249 </ul>
238 250 </li>
239 251
240 252 <li>
241 253 <a title="${_('Followers')}" href="#">
242 254 <span class="icon_short">
243 255 <img src="${h.url("/images/icons/heart.png")}" alt="${_('Followers')}" />
244 256 </span>
245 257 <span id="current_followers_count" class="short">${c.repository_followers}</span>
246 258 </a>
247 259 </li>
248 260 <li>
249 261 <a title="${_('Forks')}" href="#">
250 262 <span class="icon_short">
251 263 <img src="${h.url("/images/icons/arrow_divide.png")}" alt="${_('Forks')}" />
252 264 </span>
253 265 <span class="short">${c.repository_forks}</span>
254 266 </a>
255 267 </li>
256 268
257 269
258 270
259 271 </ul>
260 272 %else:
261 273 ##ROOT MENU
262 274 <ul id="quick">
263 275 <li>
264 276 <a title="${_('Home')}" href="${h.url('home')}">
265 277 <span class="icon">
266 278 <img src="${h.url("/images/icons/home_16.png")}" alt="${_('Home')}" />
267 279 </span>
268 280 <span>${_('Home')}</span>
269 281 </a>
270 282 </li>
271 283 %if c.rhodecode_user.username != 'default':
272 284 <li>
273 285 <a title="${_('Journal')}" href="${h.url('journal')}">
274 286 <span class="icon">
275 287 <img src="${h.url("/images/icons/book.png")}" alt="${_('Journal')}" />
276 288 </span>
277 289 <span>${_('Journal')}</span>
278 290 </a>
279 291 </li>
280 292 %endif
281 293 <li>
282 294 <a title="${_('Search')}" href="${h.url('search')}">
283 295 <span class="icon">
284 296 <img src="${h.url("/images/icons/search_16.png")}" alt="${_('Search')}" />
285 297 </span>
286 298 <span>${_('Search')}</span>
287 299 </a>
288 300 </li>
289 301
290 302 %if h.HasPermissionAll('hg.admin')('access admin main page'):
291 303 <li ${is_current('admin')}>
292 304 <a title="${_('Admin')}" href="${h.url('admin_home')}">
293 305 <span class="icon">
294 306 <img src="${h.url("/images/icons/cog_edit.png")}" alt="${_('Admin')}" />
295 307 </span>
296 308 <span>${_('Admin')}</span>
297 309 </a>
298 310 ${admin_menu()}
299 311 </li>
300 312 %endif
301 313 </ul>
302 314 %endif
303 315 </%def> No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now