diff --git a/rhodecode/controllers/files.py b/rhodecode/controllers/files.py --- a/rhodecode/controllers/files.py +++ b/rhodecode/controllers/files.py @@ -149,15 +149,23 @@ class FilesController(BaseController): return render('files/files_annotate.html') def archivefile(self, repo_name, fname): - info = fname.split('.') - revision, fileformat = info[0], '.' + '.'.join(info[1:]) archive_specs = { '.tar.bz2': ('application/x-tar', 'tbz2'), '.tar.gz': ('application/x-tar', 'tgz'), '.zip': ('application/zip', 'zip'), } + + fileformat = None + revision = None + + for ext in archive_specs.keys(): + archive_spec = fname.split(ext) + if len(archive_spec) == 2: + fileformat = archive_spec[1] or ext + revision = archive_spec[0] + if not archive_specs.has_key(fileformat): - return _('Unknown archive type %s') % fileformat + return _('Unknown archive type') repo = ScmModel().get_repo(repo_name) diff --git a/rhodecode/controllers/summary.py b/rhodecode/controllers/summary.py --- a/rhodecode/controllers/summary.py +++ b/rhodecode/controllers/summary.py @@ -142,5 +142,27 @@ class SummaryController(BaseController): c.trending_languages = json.dumps({}) c.no_data = True + c.download_options = self._get_download_links(c.repo_info) + return render('summary/summary.html') + + + def _get_download_links(self, repo): + + download_l = [] + + branches_group = ([], _("Branches")) + tags_group = ([], _("Tags")) + + for name, chs in c.repository_branches.items(): + #chs = chs.split(':')[-1] + branches_group[0].append((chs, name),) + download_l.append(branches_group) + + for name, chs in c.repository_tags.items(): + #chs = chs.split(':')[-1] + tags_group[0].append((chs, name),) + download_l.append(tags_group) + + return download_l diff --git a/rhodecode/templates/summary/summary.html b/rhodecode/templates/summary/summary.html --- a/rhodecode/templates/summary/summary.html +++ b/rhodecode/templates/summary/summary.html @@ -119,9 +119,40 @@