Show More
@@ -0,0 +1,52 b'' | |||||
|
1 | import logging | |||
|
2 | ||||
|
3 | from pylons import request, response, session, tmpl_context as c, url | |||
|
4 | from pylons.controllers.util import abort, redirect | |||
|
5 | ||||
|
6 | from rhodecode.lib.base import BaseController, render | |||
|
7 | ||||
|
8 | log = logging.getLogger(__name__) | |||
|
9 | ||||
|
10 | class ReposGroupsController(BaseController): | |||
|
11 | """REST Controller styled on the Atom Publishing Protocol""" | |||
|
12 | # To properly map this controller, ensure your config/routing.py | |||
|
13 | # file has a resource setup: | |||
|
14 | # map.resource('repos_group', 'repos_groups') | |||
|
15 | ||||
|
16 | def index(self, format='html'): | |||
|
17 | """GET /repos_groups: All items in the collection""" | |||
|
18 | # url('repos_groups') | |||
|
19 | ||||
|
20 | def create(self): | |||
|
21 | """POST /repos_groups: Create a new item""" | |||
|
22 | # url('repos_groups') | |||
|
23 | ||||
|
24 | def new(self, format='html'): | |||
|
25 | """GET /repos_groups/new: Form to create a new item""" | |||
|
26 | # url('new_repos_group') | |||
|
27 | ||||
|
28 | def update(self, id): | |||
|
29 | """PUT /repos_groups/id: Update an existing item""" | |||
|
30 | # Forms posted to this method should contain a hidden field: | |||
|
31 | # <input type="hidden" name="_method" value="PUT" /> | |||
|
32 | # Or using helpers: | |||
|
33 | # h.form(url('repos_group', id=ID), | |||
|
34 | # method='put') | |||
|
35 | # url('repos_group', id=ID) | |||
|
36 | ||||
|
37 | def delete(self, id): | |||
|
38 | """DELETE /repos_groups/id: Delete an existing item""" | |||
|
39 | # Forms posted to this method should contain a hidden field: | |||
|
40 | # <input type="hidden" name="_method" value="DELETE" /> | |||
|
41 | # Or using helpers: | |||
|
42 | # h.form(url('repos_group', id=ID), | |||
|
43 | # method='delete') | |||
|
44 | # url('repos_group', id=ID) | |||
|
45 | ||||
|
46 | def show(self, id, format='html'): | |||
|
47 | """GET /repos_groups/id: Show a specific item""" | |||
|
48 | # url('repos_group', id=ID) | |||
|
49 | ||||
|
50 | def edit(self, id, format='html'): | |||
|
51 | """GET /repos_groups/id/edit: Form to edit an existing item""" | |||
|
52 | # url('edit_repos_group', id=ID) |
@@ -0,0 +1,43 b'' | |||||
|
1 | from rhodecode.tests import * | |||
|
2 | ||||
|
3 | class TestReposGroupsController(TestController): | |||
|
4 | ||||
|
5 | def test_index(self): | |||
|
6 | response = self.app.get(url('repos_groups')) | |||
|
7 | # Test response... | |||
|
8 | ||||
|
9 | def test_index_as_xml(self): | |||
|
10 | response = self.app.get(url('formatted_repos_groups', format='xml')) | |||
|
11 | ||||
|
12 | def test_create(self): | |||
|
13 | response = self.app.post(url('repos_groups')) | |||
|
14 | ||||
|
15 | def test_new(self): | |||
|
16 | response = self.app.get(url('new_repos_group')) | |||
|
17 | ||||
|
18 | def test_new_as_xml(self): | |||
|
19 | response = self.app.get(url('formatted_new_repos_group', format='xml')) | |||
|
20 | ||||
|
21 | def test_update(self): | |||
|
22 | response = self.app.put(url('repos_group', id=1)) | |||
|
23 | ||||
|
24 | def test_update_browser_fakeout(self): | |||
|
25 | response = self.app.post(url('repos_group', id=1), params=dict(_method='put')) | |||
|
26 | ||||
|
27 | def test_delete(self): | |||
|
28 | response = self.app.delete(url('repos_group', id=1)) | |||
|
29 | ||||
|
30 | def test_delete_browser_fakeout(self): | |||
|
31 | response = self.app.post(url('repos_group', id=1), params=dict(_method='delete')) | |||
|
32 | ||||
|
33 | def test_show(self): | |||
|
34 | response = self.app.get(url('repos_group', id=1)) | |||
|
35 | ||||
|
36 | def test_show_as_xml(self): | |||
|
37 | response = self.app.get(url('formatted_repos_group', id=1, format='xml')) | |||
|
38 | ||||
|
39 | def test_edit(self): | |||
|
40 | response = self.app.get(url('edit_repos_group', id=1)) | |||
|
41 | ||||
|
42 | def test_edit_as_xml(self): | |||
|
43 | response = self.app.get(url('formatted_edit_repos_group', id=1, format='xml')) |
@@ -96,11 +96,13 b' def make_map(config):' | |||||
96 | action="repo_pull", conditions=dict(method=["PUT"], |
|
96 | action="repo_pull", conditions=dict(method=["PUT"], | |
97 | function=check_repo)) |
|
97 | function=check_repo)) | |
98 |
|
98 | |||
|
99 | #ADMIN REPOS GROUP REST ROUTES | |||
|
100 | routes_map.resource('repos_group', 'repos_groups', controller='admin/repos_groups', path_prefix='/_admin') | |||
99 |
|
101 | |||
100 | #ADMIN USER REST ROUTES |
|
102 | #ADMIN USER REST ROUTES | |
101 | routes_map.resource('user', 'users', controller='admin/users', path_prefix='/_admin') |
|
103 | routes_map.resource('user', 'users', controller='admin/users', path_prefix='/_admin') | |
102 |
|
104 | |||
103 | #ADMIN USER REST ROUTES |
|
105 | #ADMIN USERS REST ROUTES | |
104 | routes_map.resource('users_group', 'users_groups', controller='admin/users_groups', path_prefix='/_admin') |
|
106 | routes_map.resource('users_group', 'users_groups', controller='admin/users_groups', path_prefix='/_admin') | |
105 |
|
107 | |||
106 | #ADMIN GROUP REST ROUTES |
|
108 | #ADMIN GROUP REST ROUTES |
@@ -35,7 +35,8 b' from vcs.exceptions import ChangesetErro' | |||||
35 | from pylons import tmpl_context as c, request, url |
|
35 | from pylons import tmpl_context as c, request, url | |
36 | from pylons.i18n.translation import _ |
|
36 | from pylons.i18n.translation import _ | |
37 |
|
37 | |||
38 | from rhodecode.model.db import Statistics |
|
38 | from rhodecode.model.db import Statistics, Repository | |
|
39 | from rhodecode.model.repo import RepoModel | |||
39 |
|
40 | |||
40 | from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator |
|
41 | from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator | |
41 | from rhodecode.lib.base import BaseRepoController, render |
|
42 | from rhodecode.lib.base import BaseRepoController, render | |
@@ -60,19 +61,20 b' class SummaryController(BaseRepoControll' | |||||
60 | def __before__(self): |
|
61 | def __before__(self): | |
61 | super(SummaryController, self).__before__() |
|
62 | super(SummaryController, self).__before__() | |
62 |
|
63 | |||
63 | def index(self): |
|
64 | def index(self, repo_name): | |
64 | c.repo, dbrepo = self.scm_model.get(c.repo_name) |
|
|||
65 | c.dbrepo = dbrepo |
|
|||
66 |
|
65 | |||
67 | c.following = self.scm_model.is_following_repo(c.repo_name, |
|
66 | e = request.environ | |
|
67 | c.dbrepo = dbrepo = Repository.by_repo_name(repo_name) | |||
|
68 | ||||
|
69 | c.following = self.scm_model.is_following_repo(repo_name, | |||
68 | self.rhodecode_user.user_id) |
|
70 | self.rhodecode_user.user_id) | |
69 | def url_generator(**kw): |
|
71 | def url_generator(**kw): | |
70 |
return url('shortlog_home', repo_name= |
|
72 | return url('shortlog_home', repo_name=repo_name, **kw) | |
71 |
|
73 | |||
72 | c.repo_changesets = RepoPage(c.repo, page=1, items_per_page=10, |
|
74 | c.repo_changesets = RepoPage(c.rhodecode_repo, page=1, items_per_page=10, | |
73 | url=url_generator) |
|
75 | url=url_generator) | |
74 |
|
76 | |||
75 | e = request.environ |
|
77 | ||
76 |
|
78 | |||
77 | if self.rhodecode_user.username == 'default': |
|
79 | if self.rhodecode_user.username == 'default': | |
78 | #for default(anonymous) user we don't need to pass credentials |
|
80 | #for default(anonymous) user we don't need to pass credentials | |
@@ -88,19 +90,19 b' class SummaryController(BaseRepoControll' | |||||
88 | 'password':password, |
|
90 | 'password':password, | |
89 | 'host':e.get('HTTP_HOST'), |
|
91 | 'host':e.get('HTTP_HOST'), | |
90 | 'prefix':e.get('SCRIPT_NAME'), |
|
92 | 'prefix':e.get('SCRIPT_NAME'), | |
91 |
'repo_name': |
|
93 | 'repo_name':repo_name, } | |
92 | c.clone_repo_url = uri |
|
94 | c.clone_repo_url = uri | |
93 | c.repo_tags = OrderedDict() |
|
95 | c.repo_tags = OrderedDict() | |
94 | for name, hash in c.repo.tags.items()[:10]: |
|
96 | for name, hash in c.rhodecode_repo.tags.items()[:10]: | |
95 | try: |
|
97 | try: | |
96 | c.repo_tags[name] = c.repo.get_changeset(hash) |
|
98 | c.repo_tags[name] = c.rhodecode_repo.get_changeset(hash) | |
97 | except ChangesetError: |
|
99 | except ChangesetError: | |
98 | c.repo_tags[name] = EmptyChangeset(hash) |
|
100 | c.repo_tags[name] = EmptyChangeset(hash) | |
99 |
|
101 | |||
100 | c.repo_branches = OrderedDict() |
|
102 | c.repo_branches = OrderedDict() | |
101 | for name, hash in c.repo.branches.items()[:10]: |
|
103 | for name, hash in c.rhodecode_repo.branches.items()[:10]: | |
102 | try: |
|
104 | try: | |
103 | c.repo_branches[name] = c.repo.get_changeset(hash) |
|
105 | c.repo_branches[name] = c.rhodecode_repo.get_changeset(hash) | |
104 | except ChangesetError: |
|
106 | except ChangesetError: | |
105 | c.repo_branches[name] = EmptyChangeset(hash) |
|
107 | c.repo_branches[name] = EmptyChangeset(hash) | |
106 |
|
108 | |||
@@ -114,7 +116,7 b' class SummaryController(BaseRepoControll' | |||||
114 |
|
116 | |||
115 | if dbrepo.enable_statistics: |
|
117 | if dbrepo.enable_statistics: | |
116 | c.no_data_msg = _('No data loaded yet') |
|
118 | c.no_data_msg = _('No data loaded yet') | |
117 | run_task(get_commits_stats, c.repo.name, ts_min_y, ts_max_y) |
|
119 | run_task(get_commits_stats, c.dbrepo.repo_name, ts_min_y, ts_max_y) | |
118 | else: |
|
120 | else: | |
119 | c.no_data_msg = _('Statistics are disabled for this repository') |
|
121 | c.no_data_msg = _('Statistics are disabled for this repository') | |
120 | c.ts_min = ts_min_m |
|
122 | c.ts_min = ts_min_m | |
@@ -143,7 +145,7 b' class SummaryController(BaseRepoControll' | |||||
143 |
|
145 | |||
144 | c.enable_downloads = dbrepo.enable_downloads |
|
146 | c.enable_downloads = dbrepo.enable_downloads | |
145 | if c.enable_downloads: |
|
147 | if c.enable_downloads: | |
146 | c.download_options = self._get_download_links(c.repo) |
|
148 | c.download_options = self._get_download_links(c.rhodecode_repo) | |
147 |
|
149 | |||
148 | return render('summary/summary.html') |
|
150 | return render('summary/summary.html') | |
149 |
|
151 |
@@ -293,7 +293,7 b' def pygmentize(filenode, **kwargs):' | |||||
293 | return literal(code_highlight(filenode.content, |
|
293 | return literal(code_highlight(filenode.content, | |
294 | filenode.lexer, CodeHtmlFormatter(**kwargs))) |
|
294 | filenode.lexer, CodeHtmlFormatter(**kwargs))) | |
295 |
|
295 | |||
296 | def pygmentize_annotation(filenode, **kwargs): |
|
296 | def pygmentize_annotation(repo_name, filenode, **kwargs): | |
297 | """pygmentize function for annotation |
|
297 | """pygmentize function for annotation | |
298 |
|
298 | |||
299 | :param filenode: |
|
299 | :param filenode: | |
@@ -326,7 +326,8 b' def pygmentize_annotation(filenode, **kw' | |||||
326 | col = color_dict[cs] = cgenerator.next() |
|
326 | col = color_dict[cs] = cgenerator.next() | |
327 | return "color: rgb(%s)! important;" % (', '.join(col)) |
|
327 | return "color: rgb(%s)! important;" % (', '.join(col)) | |
328 |
|
328 | |||
329 |
def url_func( |
|
329 | def url_func(repo_name): | |
|
330 | def _url_func(changeset): | |||
330 | tooltip_html = "<div style='font-size:0.8em'><b>Author:</b>" + \ |
|
331 | tooltip_html = "<div style='font-size:0.8em'><b>Author:</b>" + \ | |
331 | " %s<br/><b>Date:</b> %s</b><br/><b>Message:</b> %s<br/></div>" |
|
332 | " %s<br/><b>Date:</b> %s</b><br/><b>Message:</b> %s<br/></div>" | |
332 |
|
333 | |||
@@ -337,7 +338,7 b' def pygmentize_annotation(filenode, **kw' | |||||
337 | short_id(changeset.raw_id)) |
|
338 | short_id(changeset.raw_id)) | |
338 | uri = link_to( |
|
339 | uri = link_to( | |
339 | lnk_format, |
|
340 | lnk_format, | |
340 |
url('changeset_home', repo_name= |
|
341 | url('changeset_home', repo_name=repo_name, | |
341 | revision=changeset.raw_id), |
|
342 | revision=changeset.raw_id), | |
342 | style=get_color_string(changeset.raw_id), |
|
343 | style=get_color_string(changeset.raw_id), | |
343 | class_='tooltip', |
|
344 | class_='tooltip', | |
@@ -346,7 +347,9 b' def pygmentize_annotation(filenode, **kw' | |||||
346 |
|
347 | |||
347 | uri += '\n' |
|
348 | uri += '\n' | |
348 | return uri |
|
349 | return uri | |
349 | return literal(annotate_highlight(filenode, url_func, **kwargs)) |
|
350 | return _url_func | |
|
351 | ||||
|
352 | return literal(annotate_highlight(filenode, url_func(repo_name), **kwargs)) | |||
350 |
|
353 | |||
351 | def get_changeset_safe(repo, rev): |
|
354 | def get_changeset_safe(repo, rev): | |
352 | from vcs.backends.base import BaseRepository |
|
355 | from vcs.backends.base import BaseRepository | |
@@ -690,7 +693,7 b' def repo_link(groups_and_repos):' | |||||
690 | return repo_name |
|
693 | return repo_name | |
691 | else: |
|
694 | else: | |
692 | def make_link(group): |
|
695 | def make_link(group): | |
693 |
return link_to(group.group_name, url(' |
|
696 | return link_to(group.group_name, url('repos_group', id=group.group_id)) | |
694 | return literal(' » '.join(map(make_link, groups)) + \ |
|
697 | return literal(' » '.join(map(make_link, groups)) + \ | |
695 | " » " + repo_name) |
|
698 | " » " + repo_name) | |
696 |
|
699 |
@@ -91,7 +91,7 b' class WhooshIndexingDaemon(object):' | |||||
91 | filtered_repo_paths = {} |
|
91 | filtered_repo_paths = {} | |
92 | for repo_name, repo in self.repo_paths.items(): |
|
92 | for repo_name, repo in self.repo_paths.items(): | |
93 | if repo_name in repo_list: |
|
93 | if repo_name in repo_list: | |
94 |
filtered_repo_paths[repo |
|
94 | filtered_repo_paths[repo_name] = repo | |
95 |
|
95 | |||
96 | self.repo_paths = filtered_repo_paths |
|
96 | self.repo_paths = filtered_repo_paths | |
97 |
|
97 | |||
@@ -130,7 +130,7 b' class WhooshIndexingDaemon(object):' | |||||
130 | def get_node_mtime(self, node): |
|
130 | def get_node_mtime(self, node): | |
131 | return mktime(node.last_changeset.date.timetuple()) |
|
131 | return mktime(node.last_changeset.date.timetuple()) | |
132 |
|
132 | |||
133 | def add_doc(self, writer, path, repo): |
|
133 | def add_doc(self, writer, path, repo, repo_name): | |
134 | """Adding doc to writer this function itself fetches data from |
|
134 | """Adding doc to writer this function itself fetches data from | |
135 | the instance of vcs backend""" |
|
135 | the instance of vcs backend""" | |
136 | node = self.get_node(repo, path) |
|
136 | node = self.get_node(repo, path) | |
@@ -152,7 +152,7 b' class WhooshIndexingDaemon(object):' | |||||
152 | u_content = u'' |
|
152 | u_content = u'' | |
153 |
|
153 | |||
154 | writer.add_document(owner=unicode(repo.contact), |
|
154 | writer.add_document(owner=unicode(repo.contact), | |
155 |
repository=safe_unicode(repo |
|
155 | repository=safe_unicode(repo_name), | |
156 | path=safe_unicode(path), |
|
156 | path=safe_unicode(path), | |
157 | content=u_content, |
|
157 | content=u_content, | |
158 | modtime=self.get_node_mtime(node), |
|
158 | modtime=self.get_node_mtime(node), | |
@@ -170,11 +170,11 b' class WhooshIndexingDaemon(object):' | |||||
170 | idx = create_in(self.index_location, SCHEMA, indexname=IDX_NAME) |
|
170 | idx = create_in(self.index_location, SCHEMA, indexname=IDX_NAME) | |
171 | writer = idx.writer() |
|
171 | writer = idx.writer() | |
172 |
|
172 | |||
173 |
for repo in self.repo_paths. |
|
173 | for repo_name, repo in self.repo_paths.items(): | |
174 | log.debug('building index @ %s' % repo.path) |
|
174 | log.debug('building index @ %s' % repo.path) | |
175 |
|
175 | |||
176 | for idx_path in self.get_paths(repo): |
|
176 | for idx_path in self.get_paths(repo): | |
177 | self.add_doc(writer, idx_path, repo) |
|
177 | self.add_doc(writer, idx_path, repo, repo_name) | |
178 |
|
178 | |||
179 | log.debug('>> COMMITING CHANGES <<') |
|
179 | log.debug('>> COMMITING CHANGES <<') | |
180 | writer.commit(merge=True) |
|
180 | writer.commit(merge=True) | |
@@ -221,12 +221,12 b' class WhooshIndexingDaemon(object):' | |||||
221 | # Loop over the files in the filesystem |
|
221 | # Loop over the files in the filesystem | |
222 | # Assume we have a function that gathers the filenames of the |
|
222 | # Assume we have a function that gathers the filenames of the | |
223 | # documents to be indexed |
|
223 | # documents to be indexed | |
224 |
for repo in self.repo_paths. |
|
224 | for repo_name, repo in self.repo_paths.items(): | |
225 | for path in self.get_paths(repo): |
|
225 | for path in self.get_paths(repo): | |
226 | if path in to_index or path not in indexed_paths: |
|
226 | if path in to_index or path not in indexed_paths: | |
227 | # This is either a file that's changed, or a new file |
|
227 | # This is either a file that's changed, or a new file | |
228 | # that wasn't indexed before. So index it! |
|
228 | # that wasn't indexed before. So index it! | |
229 | self.add_doc(writer, path, repo) |
|
229 | self.add_doc(writer, path, repo, repo_name) | |
230 | log.debug('re indexing %s' % path) |
|
230 | log.debug('re indexing %s' % path) | |
231 |
|
231 | |||
232 | log.debug('>> COMMITING CHANGES <<') |
|
232 | log.debug('>> COMMITING CHANGES <<') |
@@ -136,7 +136,7 b'' | |||||
136 | <img class="icon" alt="${_('public')}" src="${h.url("/images/icons/lock_open.png")}"/> |
|
136 | <img class="icon" alt="${_('public')}" src="${h.url("/images/icons/lock_open.png")}"/> | |
137 | %endif |
|
137 | %endif | |
138 |
|
138 | |||
139 |
${h.link_to(repo[' |
|
139 | ${h.link_to(repo['name'], h.url('summary_home',repo_name=repo['name']),class_="repo_name")} | |
140 | %if repo['dbrepo_fork']: |
|
140 | %if repo['dbrepo_fork']: | |
141 | <a href="${h.url('summary_home',repo_name=repo['dbrepo_fork']['repo_name'])}"> |
|
141 | <a href="${h.url('summary_home',repo_name=repo['dbrepo_fork']['repo_name'])}"> | |
142 | <img class="icon" alt="${_('public')}" |
|
142 | <img class="icon" alt="${_('public')}" | |
@@ -145,10 +145,10 b'' | |||||
145 | %endif |
|
145 | %endif | |
146 | </td> |
|
146 | </td> | |
147 | <td><span class="tooltip" title="${repo['repo'].last_change}">${("r%s:%s") % (h.get_changeset_safe(repo['repo'],'tip').revision,h.short_id(h.get_changeset_safe(repo['repo'],'tip').raw_id))}</span></td> |
|
147 | <td><span class="tooltip" title="${repo['repo'].last_change}">${("r%s:%s") % (h.get_changeset_safe(repo['repo'],'tip').revision,h.short_id(h.get_changeset_safe(repo['repo'],'tip').raw_id))}</span></td> | |
148 |
<td><a href="${h.url('repo_settings_home',repo_name=repo[' |
|
148 | <td><a href="${h.url('repo_settings_home',repo_name=repo['name'])}" title="${_('edit')}"><img class="icon" alt="${_('private')}" src="${h.url("/images/icons/application_form_edit.png")}"/></a></td> | |
149 | <td> |
|
149 | <td> | |
150 |
${h.form(url('repo_settings_delete', repo_name=repo[' |
|
150 | ${h.form(url('repo_settings_delete', repo_name=repo['name']),method='delete')} | |
151 |
${h.submit('remove_%s' % repo[' |
|
151 | ${h.submit('remove_%s' % repo['name'],'',class_="delete_icon action_button",onclick="return confirm('Confirm to delete this repository');")} | |
152 | ${h.end_form()} |
|
152 | ${h.end_form()} | |
153 | </td> |
|
153 | </td> | |
154 | </tr> |
|
154 | </tr> |
@@ -67,7 +67,7 b'' | |||||
67 | ${_('Binary file')} |
|
67 | ${_('Binary file')} | |
68 | %else: |
|
68 | %else: | |
69 | % if c.file.size < c.cut_off_limit: |
|
69 | % if c.file.size < c.cut_off_limit: | |
70 | ${h.pygmentize_annotation(c.file,linenos=True,anchorlinenos=True,lineanchors='S',cssclass="code-highlight")} |
|
70 | ${h.pygmentize_annotation(c.repo_name,c.file,linenos=True,anchorlinenos=True,lineanchors='S',cssclass="code-highlight")} | |
71 | %else: |
|
71 | %else: | |
72 | ${_('File is to big to display')} ${h.link_to(_('show as raw'), |
|
72 | ${_('File is to big to display')} ${h.link_to(_('show as raw'), | |
73 | h.url('files_raw_home',repo_name=c.repo_name,revision=c.cs.revision,f_path=c.f_path))} |
|
73 | h.url('files_raw_home',repo_name=c.repo_name,revision=c.cs.revision,f_path=c.f_path))} |
@@ -4,7 +4,7 b'' | |||||
4 | %if repo['dbrepo']['private']: |
|
4 | %if repo['dbrepo']['private']: | |
5 | <li> |
|
5 | <li> | |
6 | <img src="${h.url("/images/icons/lock.png")}" alt="${_('Private repository')}" class="repo_switcher_type"/> |
|
6 | <img src="${h.url("/images/icons/lock.png")}" alt="${_('Private repository')}" class="repo_switcher_type"/> | |
7 |
${h.link_to(repo['name'] |
|
7 | ${h.link_to(repo['name'],h.url('summary_home',repo_name=repo['name']),class_="%s" % repo['dbrepo']['repo_type'])} | |
8 | </li> |
|
8 | </li> | |
9 | %else: |
|
9 | %else: | |
10 | <li> |
|
10 | <li> |
@@ -7,7 +7,7 b'' | |||||
7 | <%def name="breadcrumbs_links()"> |
|
7 | <%def name="breadcrumbs_links()"> | |
8 | ${h.link_to(u'Home',h.url('/'))} |
|
8 | ${h.link_to(u'Home',h.url('/'))} | |
9 | » |
|
9 | » | |
10 | ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))} |
|
10 | ${h.link_to(c.dbrepo.just_name,h.url('summary_home',repo_name=c.repo_name))} | |
11 | » |
|
11 | » | |
12 | ${_('summary')} |
|
12 | ${_('summary')} | |
13 | </%def> |
|
13 | </%def> | |
@@ -31,6 +31,17 b'' | |||||
31 | <label>${_('Name')}:</label> |
|
31 | <label>${_('Name')}:</label> | |
32 | </div> |
|
32 | </div> | |
33 | <div class="input-short"> |
|
33 | <div class="input-short"> | |
|
34 | %if c.rhodecode_user.username != 'default': | |||
|
35 | %if c.following: | |||
|
36 | <span id="follow_toggle" class="following" title="${_('Stop following this repository')}" | |||
|
37 | onclick="javascript:toggleFollowingRepo(this,${c.dbrepo.repo_id},'${str(h.get_token())}')"> | |||
|
38 | </span> | |||
|
39 | %else: | |||
|
40 | <span id="follow_toggle" class="follow" title="${_('Start following this repository')}" | |||
|
41 | onclick="javascript:toggleFollowingRepo(this,${c.dbrepo.repo_id},'${str(h.get_token())}')"> | |||
|
42 | </span> | |||
|
43 | %endif | |||
|
44 | %endif: | |||
34 | %if c.dbrepo.repo_type =='hg': |
|
45 | %if c.dbrepo.repo_type =='hg': | |
35 | <img style="margin-bottom:2px" class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url("/images/icons/hgicon.png")}"/> |
|
46 | <img style="margin-bottom:2px" class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url("/images/icons/hgicon.png")}"/> | |
36 | %endif |
|
47 | %endif | |
@@ -43,19 +54,8 b'' | |||||
43 | %else: |
|
54 | %else: | |
44 | <img style="margin-bottom:2px" class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url("/images/icons/lock_open.png")}"/> |
|
55 | <img style="margin-bottom:2px" class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url("/images/icons/lock_open.png")}"/> | |
45 | %endif |
|
56 | %endif | |
46 |
<span style="font-size: 1.6em;font-weight: bold;vertical-align: baseline;">${ |
|
57 | <span style="font-size: 1.6em;font-weight: bold;vertical-align: baseline;">${h.repo_link(c.dbrepo.groups_and_repo)}</span> | |
47 | %if c.rhodecode_user.username != 'default': |
|
58 | ||
48 | %if c.following: |
|
|||
49 | <span id="follow_toggle" class="following" title="${_('Stop following this repository')}" |
|
|||
50 | onclick="javascript:toggleFollowingRepo(this,${c.dbrepo.repo_id},'${str(h.get_token())}')"> |
|
|||
51 | </span> |
|
|||
52 | %else: |
|
|||
53 | <span id="follow_toggle" class="follow" title="${_('Start following this repository')}" |
|
|||
54 | onclick="javascript:toggleFollowingRepo(this,${c.dbrepo.repo_id},'${str(h.get_token())}')"> |
|
|||
55 | </span> |
|
|||
56 | %endif |
|
|||
57 | %endif: |
|
|||
58 | <br/> |
|
|||
59 | %if c.dbrepo.fork: |
|
59 | %if c.dbrepo.fork: | |
60 | <span style="margin-top:5px"> |
|
60 | <span style="margin-top:5px"> | |
61 | <a href="${h.url('summary_home',repo_name=c.dbrepo.fork.repo_name)}"> |
|
61 | <a href="${h.url('summary_home',repo_name=c.dbrepo.fork.repo_name)}"> | |
@@ -109,8 +109,11 b'' | |||||
109 | <label>${_('Last change')}:</label> |
|
109 | <label>${_('Last change')}:</label> | |
110 | </div> |
|
110 | </div> | |
111 | <div class="input-short"> |
|
111 | <div class="input-short"> | |
112 | ${h.age(c.repo.last_change)} - ${c.repo.last_change} |
|
112 | <b>${'r%s:%s' % (h.get_changeset_safe(c.rhodecode_repo,'tip').revision, | |
113 |
|
|
113 | h.get_changeset_safe(c.rhodecode_repo,'tip').short_id)}</b> - | |
|
114 | <span class="tooltip" title="${c.rhodecode_repo.last_change}"> | |||
|
115 | ${h.age(c.rhodecode_repo.last_change)}</span><br/> | |||
|
116 | ${_('by')} ${h.get_changeset_safe(c.rhodecode_repo,'tip').author} | |||
114 |
|
117 | |||
115 | </div> |
|
118 | </div> | |
116 | </div> |
|
119 | </div> | |
@@ -138,7 +141,7 b'' | |||||
138 | <label>${_('Download')}:</label> |
|
141 | <label>${_('Download')}:</label> | |
139 | </div> |
|
142 | </div> | |
140 | <div class="input-short"> |
|
143 | <div class="input-short"> | |
141 | %if len(c.repo.revisions) == 0: |
|
144 | %if len(c.rhodecode_repo.revisions) == 0: | |
142 | ${_('There are no downloads yet')} |
|
145 | ${_('There are no downloads yet')} | |
143 | %elif c.enable_downloads is False: |
|
146 | %elif c.enable_downloads is False: | |
144 | ${_('Downloads are disabled for this repository')} |
|
147 | ${_('Downloads are disabled for this repository')} | |
@@ -146,14 +149,14 b'' | |||||
146 | [${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name))}] |
|
149 | [${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name))}] | |
147 | %endif |
|
150 | %endif | |
148 | %else: |
|
151 | %else: | |
149 | ${h.select('download_options',c.repo.get_changeset().raw_id,c.download_options)} |
|
152 | ${h.select('download_options',c.rhodecode_repo.get_changeset().raw_id,c.download_options)} | |
150 | %for cnt,archive in enumerate(c.repo._get_archives()): |
|
153 | %for cnt,archive in enumerate(c.rhodecode_repo._get_archives()): | |
151 | %if cnt >=1: |
|
154 | %if cnt >=1: | |
152 | | |
|
155 | | | |
153 | %endif |
|
156 | %endif | |
154 | <span class="tooltip" title="${_('Download %s as %s') %('tip',archive['type'])}" |
|
157 | <span class="tooltip" title="${_('Download %s as %s') %('tip',archive['type'])}" | |
155 | id="${archive['type']+'_link'}">${h.link_to(archive['type'], |
|
158 | id="${archive['type']+'_link'}">${h.link_to(archive['type'], | |
156 | h.url('files_archive_home',repo_name=c.repo.name, |
|
159 | h.url('files_archive_home',repo_name=c.dbrepo.repo_name, | |
157 | fname='tip'+archive['extension']),class_="archive_icon")}</span> |
|
160 | fname='tip'+archive['extension']),class_="archive_icon")}</span> | |
158 | %endfor |
|
161 | %endfor | |
159 | %endif |
|
162 | %endif | |
@@ -166,11 +169,11 b'' | |||||
166 | </div> |
|
169 | </div> | |
167 | <div class="input-short"> |
|
170 | <div class="input-short"> | |
168 | %if c.rhodecode_user.username != 'default': |
|
171 | %if c.rhodecode_user.username != 'default': | |
169 | ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.repo.name,api_key=c.rhodecode_user.api_key),class_='rss_icon')} |
|
172 | ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.dbrepo.repo_name,api_key=c.rhodecode_user.api_key),class_='rss_icon')} | |
170 | ${h.link_to(_('Atom'),h.url('atom_feed_home',repo_name=c.repo.name,api_key=c.rhodecode_user.api_key),class_='atom_icon')} |
|
173 | ${h.link_to(_('Atom'),h.url('atom_feed_home',repo_name=c.dbrepo.repo_name,api_key=c.rhodecode_user.api_key),class_='atom_icon')} | |
171 | %else: |
|
174 | %else: | |
172 | ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.repo.name),class_='rss_icon')} |
|
175 | ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.dbrepo.repo_name),class_='rss_icon')} | |
173 | ${h.link_to(_('Atom'),h.url('atom_feed_home',repo_name=c.repo.name),class_='atom_icon')} |
|
176 | ${h.link_to(_('Atom'),h.url('atom_feed_home',repo_name=c.dbrepo.repo_name),class_='atom_icon')} | |
174 | %endif |
|
177 | %endif | |
175 | </div> |
|
178 | </div> | |
176 | </div> |
|
179 | </div> | |
@@ -265,9 +268,9 b'' | |||||
265 | YUE.on('download_options','change',function(e){ |
|
268 | YUE.on('download_options','change',function(e){ | |
266 | var new_cs = e.target.options[e.target.selectedIndex]; |
|
269 | var new_cs = e.target.options[e.target.selectedIndex]; | |
267 | var tmpl_links = {} |
|
270 | var tmpl_links = {} | |
268 | %for cnt,archive in enumerate(c.repo._get_archives()): |
|
271 | %for cnt,archive in enumerate(c.rhodecode_repo._get_archives()): | |
269 | tmpl_links['${archive['type']}'] = '${h.link_to(archive['type'], |
|
272 | tmpl_links['${archive['type']}'] = '${h.link_to(archive['type'], | |
270 | h.url('files_archive_home',repo_name=c.repo.name, |
|
273 | h.url('files_archive_home',repo_name=c.dbrepo.repo_name, | |
271 | fname='__CS__'+archive['extension']),class_="archive_icon")}'; |
|
274 | fname='__CS__'+archive['extension']),class_="archive_icon")}'; | |
272 | %endfor |
|
275 | %endfor | |
273 |
|
276 |
General Comments 0
You need to be logged in to leave comments.
Login now