Removed mass delete wip
[squasher.git] / templates / index.tpl
1 {literal}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5 <title>Squasher</title>
6 <style>
7
8 body{
9 background-color:#E2EBD8;
10 min-width:1000px;
11 font-family:Arial Narrow;
12 font-size:16px;
13 }
14
15 .wrapper{
16 width: 1000px;
17 margin: 10px auto;
18 }
19
20 .container{
21 border:5px solid;
22 border-color:#FFFFFF;
23 color:#FFFFFF;
24 left:50%;
25 background: #FFFFFF;
26 }
27
28 .control{
29 float:right;
30 text-align:right;
31 }
32
33 .menucontainer{
34 background-color:#FFFFFF;
35 }
36
37 .menu{
38 text-align:center;
39 }
40
41 .menuhead{
42 float:left;
43 background-color:#66CC00;
44 color:#003300;
45 margin:1px;
46 border:1px solid;
47 border-color:#66CC00;
48 }
49
50 .menuitem{
51 float:left;
52 background-color:#C7F09E;
53 color:#003300;
54 margin:1px;
55 border:1px solid;
56 border-color:#E2EBD8;
57 }
58
59 .menuitem:hover{
60 background-color:#339900;
61 color:#FFFFFF;
62 }
63
64 .content{
65 float:left;
66 padding-right:5px;
67 }
68
69 .item, .status1, .status2, .status3{
70 position:relative;
71 color:#003300;
72 width:600px;
73 border:2px solid;
74 border-color:#FFFFFF;
75 font-size:12px;
76 }
77
78 .item{
79 background-color:#E2EBD8;
80 }
81 .status1{
82 background-color:#FFCCCC;
83 }
84 .status2{
85 background-color:#FFFFCC;
86 }
87 .status3{
88 background-color:#CCFFCC;
89 }
90
91 .name{
92 float:left;
93 left:1px;
94 top:1px;
95 padding-left:1px;
96 z-index:50;
97 }
98
99 .center{
100 float:left;
101 height:inherit;
102 padding-left:1px;
103 }
104
105 .chunks{
106 float:right;
107 padding-left:2px;
108 padding-right:3px;
109 }
110
111 .size{
112 float:right;
113 padding-left:2px;
114 padding-right:3px;
115 }
116
117 .added{
118 float:left;
119 padding-left:2px;
120 padding-right:3px;
121 }
122
123 .updated{
124 float:left;
125 padding-left:2px;
126 padding-right:3px;
127 }
128
129 .status{
130 float:right;
131 top:1px;
132 padding-right:2px;
133 text-align:right;
134 z-index:10;
135 }
136
137 .stream{
138 float:right;
139 padding-left:1px;
140 padding-right:2px;
141 }
142
143 .download{
144 float:right;
145 padding-left:1px;
146 padding-right:2px;
147 }
148
149 .clear{
150 clear:both;
151 height:1px;
152 font-size: 0;
153 }
154
155 .spacer{
156 clear:both;
157 height:10px;
158 }
159
160 .videoframe{
161 float:left;
162 width:500px;
163 height:400px;
164 padding-left:25px;
165 }
166
167 .banner{
168 background-color:#66CC00;
169 text-align:center;
170 width:100%;
171 height:45px;
172 background:#66CC00 url(img/squash.gif) no-repeat 30px 50%;
173 }
174
175 .titel{
176 background-color:#66CC00;
177 text-align:center;
178 }
179
180 .footer{
181 background-color:#66CC00;
182 text-align:center;
183 background:#66CC00 url(img/gplogobottomright.gif) no-repeat 100%;
184 }
185
186 .bottomimage{
187 background: #FFFFFF url(img/gp1.gif) no-repeat 95% 95%;
188 float:right;
189 width:300px;
190 height:146px;
191 }
192
193 .massdelete{
194 #position:absolute;
195 #bottom:0;
196 float:right;
197 width:300px;
198 #height:146px;
199 }
200
201 .deletebox{
202 #visibility: hidden;
203 }
204
205 .filler{
206 position:relative;
207 float:right;
208 width:300px;
209 #height:500px;
210 }
211
212 a{
213 color:#003300;
214 }
215
216 a:hover{
217 color:#FF6600;
218 }
219
220 </style>
221   <script type="text/javascript" language="JavaScript">
222    function toggle_id(hideshow){
223     if(document.getElementById(hideshow).style.visibility == 'visible') {
224      document.getElementById(hideshow).style.visibility = 'hidden';
225     }else{
226      document.getElementById(hideshow).style.visibility = 'visible';
227     }
228    }
229    function selectAllList() {
230     var aSelect = document.deletetool["h[]"];
231     var aSelectLen = aSelect.length;
232     for(i = 0; i < aSelectLen; i++) {
233      aSelect.options[i].selected = true;
234     }
235    }
236   </script></head>
237 {/literal}
238 <body style="min-width:1000px;">
239 <div class="wrapper">
240 <div class="container">
241
242         <div class="banner">&nbsp;<div class="control">{if $user_level > 99}<a href="?">home</a>&nbsp;|&nbsp;<a href="?tools=access">access</a>&nbsp;|{/if}{if $user_level > 99}&nbsp;<a href="?tools=users">users</a>&nbsp;|&nbsp;<a href="?tools=logs">logs</a>&nbsp;|{/if}&nbsp;<a href="index.php?tools=logout">logout({$user_name})</a>&nbsp;</div></div>
243
244         <div class="spacer"></div>
245
246         <div class="menucontainer">
247
248         <div class="menu">
249         
250         <div class="menuhead">current folder</div>
251         
252         {foreach item=crumb key=cookie from=$base}<div class="menuitem" onClick="location.href='?path={$cookie}'" style="cursor:pointer" >{$crumb}</div>{/foreach}
253         
254         </div>
255         
256         <div class="clear"></div>
257         
258         <div class="menu">
259         
260         <div class="menuhead">subfolders</div>
261         
262         {foreach item=folder key=folderpath from=$subfolders}<div class="menuitem" onClick="location.href='?path={$folderpath}'" style="cursor:pointer" >{$folder}</div>{/foreach}
263         
264         </div>
265         
266         <div class="clear"></div>
267 {*      
268         <div class="menu">
269         
270         {foreach item=dir key=path from=$paths}{if $path!=$currentfolder}<div class="menuitem" onClick="location.href='squasher.php?path={$path}'" style="cursor:pointer" >{$dir}</div>{/if}{/foreach}
271         
272         </div>
273         
274         
275         
276         <div class="clear"></div>*}
277         
278         </div>
279         
280         <div class="spacer"></div>
281
282 <div class="content">
283 {assign var=mass_delete_size value=count($squashed)}
284 {foreach item=item key=id from=$squashed}
285 {if $item.squashed}{*These items are in chunks / uploaded by the squasher tool*}
286
287 {if $item.hidden eq false OR $user_level > 99 }
288                 <div class={if $item.finished==true}"status3"{elseif $item.finished!=true && $item.embedable==true}"status2"{elseif $item.finished!=true && $item.embedable!=true}"status1"{else}"item"{/if}>
289
290                                 <div class="name">{$item.name} {if $user_level > 99}{if $item.hidden}<font color=red>|<a href='?tools=unhide&h={$id}'>publish</a>|</font>{else}<font color=green>|<a href='?tools=hide&h={$id}'>hide</a>|</font>{/if}{if $user_level > 100}<font color=red>|<a href='?tools=delete&h={$id}' onClick="javascript:return confirm('Are you sure you want to permanently delete {$item.name}?')">delete</a>|</font>{/if}{/if}</div>
291
292                                 <div class="status">status: {$item.status}</div>
293
294                 <div class="clear"></div>
295
296                 <div class="added">added: {$item.date}</div>
297                 
298                                 <!--div class="chunks"></div-->
299                                 <div class="size">size:&nbsp;{if $item.size>(1024*1024)}{math equation="((x / 1024) / 1024) * (y / z)" x=$item.size y=$item.chunks_finished z=$item.chunks format="%.2f"}&nbsp;/&nbsp;{math equation="(x / 1024) / 1024" x=$item.size format="%.2f"}mb{elseif $item.size>(1024)}{math equation="(x / 1024) * (y / z)" x=$item.size y=$item.chunks_finished z=$item.chunks format="%.2f"}&nbsp;/&nbsp;{math equation="(x / 1024)" x=$item.size format="%.2f"}kb{else}{math equation="x * (y / z)" x=$item.size y=$item.chunks_finished z=$item.chunks format="%.0f"}&nbsp;/&nbsp;{$item.size}b{/if}({math equation="(y / x) * 100" x=$item.chunks y=$item.chunks_finished format="%.0f"}%)</div>
300
301                 <div class="clear"></div>
302
303                 <div class="updated">last updated: {$item.lastchange}</div>
304
305
306 {if $item.finished==true}
307                                 <div class="download"><a href='?f={$id}'>download</a></div>
308 {/if}
309 {if $item.embedable eq true and $item.finished eq false}
310         {if $item.mime=='video/mpeg'}
311                                 <div class="stream"><a href='?f={$id}'>download ({math equation="(y / x) * 100" x=$item.chunks y=$item.chunks_partial format="%.0f"}%)</a></div>
312         {/if}
313 {/if}
314
315                 <div class="clear"></div>
316                 </div>
317         
318                 <div class="clear"></div>
319 {/if}
320
321 {else}{*These items are plain files / uploaded manually by the user via ftp*}
322
323 {if $item.hidden eq false OR $user_level > 99 }
324                 <div class={if $item.finished==true}"status3"{elseif $item.finished!=true && $item.embedable==true}"status2"{elseif $item.finished!=true && $item.embedable!=true}"status1"{else}"item"{/if}>
325
326                                 <div class="name">{$item.name} {if $user_level > 99}{if $item.hidden}<font color=red>|<a href='?tools=unhide&h={$id}'>publish</a>|</font>{else}<font color=green>|<a href='?tools=hide&h={$id}'>hide</a>|</font>{/if}{if $user_level > 199}<font color=red>|<a href='?tools=delete&h={$id}' onClick="javascript:return confirm('Are you sure you want to permanently delete {$item.name}?')">delete</a>|</font>{/if}{/if}</div>
327
328                                 <div class="status">status: {$item.status}</div>
329
330                 <div class="clear"></div>
331
332                 <div class="added">added: {$item.date}</div>
333
334                                 <div class="size">size:&nbsp;{if $item.size>(1024*1024)}{math equation="(x / 1024) / 1024" x=$item.size format="%.2f"}mb{elseif $item.size>(1024)}{math equation="(x / 1024)" x=$item.size format="%.2f"}kb{else}{$item.size}b{/if}</div>
335
336                 <div class="clear"></div>
337
338                 <div class="updated">last updated: {$item.lastchange}</div>
339
340
341 {if $item.finished==true}
342                                 <div class="download"><a href='?f={$id}'>download</a></div>
343 {/if}
344 {if $item.embedable eq true and $item.finished eq false}
345         {if $item.mime=='video/mpeg'}
346                                 <div class="stream"><a href='?f={$id}'>download (partial)</a></div>
347         {/if}
348 {/if}
349
350
351                 <div class="clear"></div>
352                 </div>
353         
354                 <div class="clear"></div>
355 {/if}
356 {/if}
357 {/foreach}
358
359         </div>
360
361         <div class="filler">
362         <div class="bottomimage"></div>
363 {if $user_level > 100 and $mass_delete_size > 1}
364                 <div class="massdelete"><br>
365 <div class="deletebox" id="deletebox">
366         <form name="deletetool" action="?tools=delete&h=multiple" method="post" onSubmit='return confirm("Are you sure you want to delete the selected files? \nThis page may take a while to reload while the files are removed.");'>
367                 <select multiple="" size="{$mass_delete_size}" id="h" name="h[]" width="300px">
368 {foreach item=item key=id from=$squashed}
369                         <option value="{$id}" title="{$item.name}">{$item.name|truncate:39}</option>
370 {/foreach}
371                 </select>
372                 <input type="button" value="Select All" OnClick="selectAllList();" ><input type="reset" value="Clear"><input type="submit" value="Delete Selected Items">
373         </form>
374 </div>
375 {*<br><input type="button" value=":show deletion tool:" OnClick="toggle_id('deletebox');" >*}
376         </div>
377 {/if}
378         </div>
379         <div class="clear"></div>
380
381         <div class="spacer"></div>
382
383         <div class="footer">&nbsp;</div>
384
385 </div>
386 </div>
387 {if $debug}{debug}{/if}
388 </body>
389 </html>