]> source.dussan.org Git - nextcloud-server.git/commitdiff
Show a summary as the last filelist entry
authorkondou <kondou@ts.unde.re>
Tue, 2 Jul 2013 02:28:52 +0000 (04:28 +0200)
committerkondou <kondou@ts.unde.re>
Tue, 2 Jul 2013 02:28:52 +0000 (04:28 +0200)
Fix #993

apps/files/css/files.css
apps/files/templates/part.list.php

index 108dcd741c674aae49089da194936795a66067cd..f2ca1065ecad4fc977a0135dfefb0bf85fcfb699 100644 (file)
@@ -159,6 +159,14 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; }
        display:inline;
 }
 
+.summary {
+       opacity: .5;
+}
+
+.summary .info {
+       margin-left: 3em;
+}
+
 #scanning-message{ top:40%; left:40%; position:absolute; display:none; }
 
 div.crumb a{ padding:0.9em 0 0.7em 0; color:#555; }
index 1e94275dcba006540f52af21a2b40b2d5fdc92c4..05fbb892509cb904070a7c64e155d2dad99cf9e6 100644 (file)
@@ -1,6 +1,14 @@
 <input type="hidden" id="disableSharing" data-status="<?php p($_['disableSharing']); ?>">
-
+<?php $totalfiles = 0;
+$totaldirs = 0;
+$totalsize = 0; ?>
 <?php foreach($_['files'] as $file):
+       $totalsize += $file['size'];
+       if ($file['type'] === 'dir') {
+               $totaldirs++;
+       } else {
+               $totalfiles++;
+       }
        $simple_file_size = OCP\simple_file_size($file['size']);
        // the bigger the file, the darker the shade of grey; megabytes*2
        $simple_size_color = intval(160-$file['size']/(1024*1024)*2);
                        </span>
                </td>
        </tr>
-<?php endforeach;
+<?php endforeach; ?>
+       <?php if ($totaldirs !== 0 || $totalfiles !== 0): ?>
+       <tr class="summary">
+               <td><span class="info">
+                       <?php if ($totaldirs !== 0) {
+                               p($totaldirs.' ');
+                               if ($totaldirs === 1) {
+                                       p($l->t('directory'));
+                               } else {
+                                       p($l->t('directories'));
+                               }
+                       }
+                       if ($totaldirs !== 0 && $totalfiles !== 0) {
+                               p(' & ');
+                       }
+                       if ($totalfiles !== 0) {
+                               p($totalfiles.' ');
+                               if ($totalfiles === 1) {
+                                       p($l->t('file'));
+                               } else {
+                                       p($l->t('files'));
+                               }
+                       } ?>
+               </span></td>
+               <td class="filesize">
+               <?php p(OCP\simple_file_size($totalsize)); ?>
+               </td>
+               <td></td>
+       </tr>
+       <?php endif;