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

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

it's late! some corrections, code cleaning & filter by size on admin page

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_PATH}{$BATCH_DOWNLOAD_PATH}template/images/progress_box.png',
29    barImage: '{$ROOT_PATH}{$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  jQuery.manageAjax.add("queued", {
47    type: 'GET',
48    url: derivatives.elements[ derivatives.done ]+'&ajaxload=true',
49    dataType: 'json',
50    success: function(data) {
51      derivatives.done++;
52      progress();
53      next_derivative();
54    },
55    error: function(data) {
56      derivatives.done++;
57      progress();
58      next_derivative();
59    }
60  });
61}
62
63progress();
64setTimeout("next_derivative()", 1000);
65{/literal}{/footer_script}
66
67{/if}
68
69
70{* <!-- Menubar & titrePage --> *}
71{if $themeconf.name == "stripped" or $themeconf.parent == "stripped"}
72  {include file=$BATCH_DOWNLOAD_ABS_PATH|@cat:'template/themes/stripped.tpl'}
73  {assign var="clear" value="true"}
74{elseif $themeconf.name == "simple-grey" or $themeconf.parent == "simple"}
75  {include file=$BATCH_DOWNLOAD_ABS_PATH|@cat:'template/themes/simple.tpl'}
76  {assign var="clear" value="true"}
77{else}
78  {include file=$BATCH_DOWNLOAD_ABS_PATH|@cat:'template/themes/default.tpl'}
79{/if}
80
81{if isset($errors) or not empty($infos)}
82{include file='infos_errors.tpl'}
83{/if}
84
85
86{if $set}
87<fieldset>
88  <legend>{'Download info'|@translate}</legend>
89  <h2>{$set.NAME}</h2>
90  {if $set.COMMENT}<blockquote class="comment">{$set.COMMENT}</blockquote>{/if}
91 
92  <ul class="set-infos">
93    <li class="error">{$elements_error}</li>
94    <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>
95    <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>
96    <li><b>{'Estimated size'|@translate}:</b> {$set.TOTAL_SIZE}</li>
97    <li><b>{'Estimated number of archives'|@translate}:</b> {$set.NB_ARCHIVES} <i>({'real number of archives can differ'|@translate})</i></li>
98    <li><b>{'Created on'|@translate}:</b> {$set.DATE_CREATION}</li>
99  </ul>
100</fieldset>
101
102{if $missing_derivatives}
103<fieldset>
104  <legend>{'Preparation'|@translate}</legend>
105 
106  <p>{'Please wait, your download is being prepared. This page will refresh automatically refresh when it is ready.'|@translate}</p>
107 
108  <div id="progressBar"></div>
109 
110  <a href="{$set.U_CANCEL}" class="cancel-down" onClick="return confirm('{'Are you sure?'|@translate}');">{'Cancel this download'|@translate}</a>
111</fieldset>
112
113{elseif $zip_links}
114<fieldset>
115  <legend>{'Download links'|@translate}</legend>
116 
117  <ul class="download-links">
118    {$zip_links}
119    <li class="warning">{'<b>Warning:</b> all files will be deleted within %d hours'|@translate|@sprintf:$archive_timeout}</li>
120  </ul>
121 
122  {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}
123</fieldset>
124{/if}
125{/if}
126
127{if $clear}<div style="clear: both;"></div>
128</div>{/if}
129</div>{* <!-- content --> *}
Note: See TracBrowser for help on using the repository browser.