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