Show More
@@ -271,6 +271,7 b' class FilesController(BaseRepoController' | |||||
271 | fileformat = None |
|
271 | fileformat = None | |
272 | revision = None |
|
272 | revision = None | |
273 | ext = None |
|
273 | ext = None | |
|
274 | subrepos = request.GET.get('subrepos') == 'true' | |||
274 |
|
275 | |||
275 | for a_type, ext_data in ARCHIVE_SPECS.items(): |
|
276 | for a_type, ext_data in ARCHIVE_SPECS.items(): | |
276 | archive_spec = fname.split(ext_data[1]) |
|
277 | archive_spec = fname.split(ext_data[1]) | |
@@ -300,7 +301,7 b' class FilesController(BaseRepoController' | |||||
300 | import tempfile |
|
301 | import tempfile | |
301 | archive = tempfile.mkstemp()[1] |
|
302 | archive = tempfile.mkstemp()[1] | |
302 | t = open(archive, 'wb') |
|
303 | t = open(archive, 'wb') | |
303 | cs.fill_archive(stream=t, kind=fileformat) |
|
304 | cs.fill_archive(stream=t, kind=fileformat, subrepos=subrepos) | |
304 |
|
305 | |||
305 | def get_chunked_archive(archive): |
|
306 | def get_chunked_archive(archive): | |
306 | stream = open(archive, 'rb') |
|
307 | stream = open(archive, 'rb') |
@@ -164,6 +164,9 b'' | |||||
164 | h.url('files_archive_home',repo_name=c.dbrepo.repo_name, |
|
164 | h.url('files_archive_home',repo_name=c.dbrepo.repo_name, | |
165 | fname='tip'+archive['extension']),class_="archive_icon")}</span> |
|
165 | fname='tip'+archive['extension']),class_="archive_icon")}</span> | |
166 | %endfor |
|
166 | %endfor | |
|
167 | <span style="vertical-align: bottom"> | |||
|
168 | <input id="archive_subrepos" type="checkbox" name="subrepos"/> <span class="tooltip" title="${_('Check this to download archive with subrepos')}" >${_('with subrepos')}</span> | |||
|
169 | </span> | |||
167 | %endif |
|
170 | %endif | |
168 | </div> |
|
171 | </div> | |
169 | </div> |
|
172 | </div> | |
@@ -278,27 +281,28 b'' | |||||
278 | 'display','none'); |
|
281 | 'display','none'); | |
279 | }) |
|
282 | }) | |
280 |
|
283 | |||
281 |
|
284 | var tmpl_links = {} | ||
282 | YUE.on('download_options','change',function(e){ |
|
285 | %for cnt,archive in enumerate(c.rhodecode_repo._get_archives()): | |
283 | var new_cs = e.target.options[e.target.selectedIndex]; |
|
286 | tmpl_links['${archive['type']}'] = '${h.link_to(archive['type'], | |
284 | var tmpl_links = {} |
|
287 | h.url('files_archive_home',repo_name=c.dbrepo.repo_name, | |
285 | %for cnt,archive in enumerate(c.rhodecode_repo._get_archives()): |
|
288 | fname='__CS__'+archive['extension'],subrepos='__SUB__'),class_="archive_icon")}'; | |
286 | tmpl_links['${archive['type']}'] = '${h.link_to(archive['type'], |
|
289 | %endfor | |
287 | h.url('files_archive_home',repo_name=c.dbrepo.repo_name, |
|
290 | ||
288 | fname='__CS__'+archive['extension']),class_="archive_icon")}'; |
|
291 | YUE.on(['download_options','archive_subrepos'],'change',function(e){ | |
289 | %endfor |
|
292 | var sm = YUD.get('download_options'); | |
290 |
|
293 | var new_cs = sm.options[sm.selectedIndex]; | ||
291 |
|
294 | |||
292 | for(k in tmpl_links){ |
|
295 | for(k in tmpl_links){ | |
293 | var s = YUD.get(k+'_link') |
|
296 | var s = YUD.get(k+'_link'); | |
294 | title_tmpl = "${_('Download %s as %s') % ('__CS_NAME__','__CS_EXT__')}"; |
|
297 | title_tmpl = "${_('Download %s as %s') % ('__CS_NAME__','__CS_EXT__')}"; | |
295 | s.title = title_tmpl.replace('__CS_NAME__',new_cs.text); |
|
298 | s.title = title_tmpl.replace('__CS_NAME__',new_cs.text); | |
296 | s.title = s.title.replace('__CS_EXT__',k); |
|
299 | s.title = s.title.replace('__CS_EXT__',k); | |
297 |
|
|
300 | var url = tmpl_links[k].replace('__CS__',new_cs.value); | |
|
301 | var subrepos = YUD.get('archive_subrepos').checked | |||
|
302 | url = url.replace('__SUB__',subrepos); | |||
|
303 | s.innerHTML = url | |||
298 | } |
|
304 | } | |
299 |
|
|
305 | }); | |
300 | }) |
|
|||
301 |
|
||||
302 | </script> |
|
306 | </script> | |
303 | </div> |
|
307 | </div> | |
304 |
|
308 |
General Comments 0
You need to be logged in to leave comments.
Login now