source: extensions/BatchDownloader/template/init_zip.tpl @ 24282

Last change on this file since 24282 was 23360, checked in by mistic100, 11 years ago

the fix for url was really bad

File size: 4.1 KB
Line 
1{combine_css path=$BATCH_DOWNLOAD_PATH|@cat:"template/style.css"}
2
3{if $set.U_DOWNLOAD}
4{footer_script}
5setTimeout("document.location.href = '{$set.U_DOWNLOAD}';", 1000);
6{/footer_script}
7{/if}
8
9{if $missing_derivatives}
10{combine_script id='jquery.progressBar' load='footer' path='themes/default/js/plugins/jquery.progressbar.min.js'}
11{combine_script id='jquery.ajaxmanager' load='footer' path='themes/default/js/plugins/jquery.ajaxmanager.js'}
12
13{footer_script}
14var derivatives = {ldelim}
15  elements: ["{'","'|@implode:$missing_derivatives}"],
16  done: 0,
17  total: {$missing_derivatives|@count},
18 
19  finished: function() {ldelim}
20    return derivatives.done == derivatives.total;
21  }
22};
23
24function progress() {ldelim}
25  jQuery('#progressBar').progressBar(derivatives.done/derivatives.total*100, {ldelim}
26    width: 300,
27    height: 24,
28    boxImage: '{$ROOT_URL}{$BATCH_DOWNLOAD_PATH}template/images/progress_box.png',
29    barImage: '{$ROOT_URL}{$BATCH_DOWNLOAD_PATH}template/images/progress_bar.png'
30  });
31}
32
33{literal}
34var queuedManager = jQuery.manageAjax.create('queued', {
35  queue: true, 
36  cacheResponse: false,
37  maxRequests: 1
38});
39
40function next_derivative() {
41  if (derivatives.finished()) {
42    setTimeout("location.reload(true)", 1000);
43    return;
44  }
45 
46  queuedManager.add({
47    type: 'GET',
48    url: derivatives.elements[ derivatives.done ],
49    dataType: 'json',
50    data: { ajaxload: 'true' },
51    success: function() {
52      derivatives.done++;
53      progress();
54      next_derivative();
55    },
56    error: function() {
57      derivatives.done++;
58      progress();
59      next_derivative();
60    }
61  });
62}
63
64progress();
65setTimeout("next_derivative()", 1000);
66{/literal}{/footer_script}
67
68{/if}
69
70
71{* <!-- Menubar & titrePage --> *}
72{if $themeconf.name == "stripped" or $themeconf.parent == "stripped"}
73  {include file=$BATCH_DOWNLOAD_ABS_PATH|@cat:'template/themes/stripped.tpl'}
74  {assign var="clear" value="true"}
75{elseif $themeconf.name == "simple-grey" or $themeconf.parent == "simple"}
76  {include file=$BATCH_DOWNLOAD_ABS_PATH|@cat:'template/themes/simple.tpl'}
77  {assign var="clear" value="true"}
78{else}
79  {include file=$BATCH_DOWNLOAD_ABS_PATH|@cat:'template/themes/default.tpl'}
80{/if}
81
82{if isset($errors) or not empty($infos)}
83{include file='infos_errors.tpl'}
84{/if}
85
86
87{if $set}
88<fieldset>
89  <legend>{'Download info'|@translate}</legend>
90  <h2>{$set.NAME}</h2>
91  {if $set.COMMENT}<blockquote class="comment">{$set.COMMENT}</blockquote>{/if}
92 
93  <ul class="set-infos">
94    <li class="error">{$elements_error}</li>
95    <li><b>{'%d photos'|@translate|@sprintf:$set.NB_IMAGES}</b>{if $set.U_EDIT_SET}, <a href="{$set.U_EDIT_SET}" rel="nofollow">{'Edit the set'|@translate}</a>{/if}</li>
96    <li><b>{'Photo sizes'|@translate}:</b> {if $set.SIZE=='original'}{'Original'|@translate}{else}{$set.SIZE|@translate}{/if} {if $set.SIZE_INFO}<span class="downloadSizeDetails">({$set.SIZE_INFO})</span>{/if}</li>
97    <li><b>{'Estimated size'|@translate}:</b> {$set.TOTAL_SIZE}</li>
98    <li><b>{'Estimated number of archives'|@translate}:</b> {$set.NB_ARCHIVES} <i>({'real number of archives can differ'|@translate})</i></li>
99    <li><b>{'Created on'|@translate}:</b> {$set.DATE_CREATION}</li>
100  </ul>
101</fieldset>
102
103{if $missing_derivatives}
104<fieldset>
105  <legend>{'Preparation'|@translate}</legend>
106 
107  <p>{'Please wait, your download is being prepared. This page will automatically refresh when it is ready.'|@translate}</p>
108 
109  <div id="progressBar"></div>
110 
111  <a href="{$set.U_CANCEL}" class="cancel-down" onClick="return confirm('{'Are you sure?'|@translate}');">{'Cancel this download'|@translate}</a>
112</fieldset>
113
114{elseif $zip_links}
115<fieldset>
116  <legend>{'Download links'|@translate}</legend>
117 
118  <ul class="download-links">
119    {$zip_links}
120    <li class="warning">{'<b>Warning:</b> all files will be deleted within %d hours'|@translate|@sprintf:$archive_timeout}</li>
121  </ul>
122 
123  {if $set.U_CANCEL}<a href="{$set.U_CANCEL}" class="cancel-down" onClick="return confirm('{'Are you sure?'|@translate}');">{'Cancel this download'|@translate}</a>{/if}
124</fieldset>
125{/if}
126{/if}
127
128{if $clear}<div style="clear: both;"></div>
129</div>{/if}
130</div>{* <!-- content --> *}
Note: See TracBrowser for help on using the repository browser.