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