Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-3546

Folder listing: showing the size of a folder

    XMLWordPrintable

    Details

      Description

      I think that displaying the number of contained elements in a folder listing is better than displaying nothing

      This is the patch:

       

      diff --git a/src/main/java/org/olat/core/commons/modules/bc/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/core/commons/modules/bc/_i18n/LocalStrings_de.properties
      --- a/src/main/java/org/olat/core/commons/modules/bc/_i18n/LocalStrings_de.properties
      +++ b/src/main/java/org/olat/core/commons/modules/bc/_i18n/LocalStrings_de.properties
      @@ -86,6 +86,7 @@
       mf.cancel=Abbrechen
       mf.comment=Beschreibung
       mf.edit=Metadaten bearbeiten
      +mf.elements=Element(e)
       mf.error.filename.empty=Der Name des Objektes darf nicht leer sein.
       mf.error.filename.exists=Es gibt bereits ein Objekt mit diesem Namen.
       mf.error.filename.invalidchars=Der Name des Objekts enth\u00E4lt ung\u00FCltige Zeichen.
      diff --git a/src/main/java/org/olat/core/commons/modules/bc/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/core/commons/modules/bc/_i18n/LocalStrings_en.properties
      --- a/src/main/java/org/olat/core/commons/modules/bc/_i18n/LocalStrings_en.properties
      +++ b/src/main/java/org/olat/core/commons/modules/bc/_i18n/LocalStrings_en.properties
      @@ -86,6 +86,7 @@
       mf.cancel=Cancel
       mf.comment=Description
       mf.edit=Edit metadata
      +mf.elements=element(s)
       mf.error.filename.empty=You have to enter a name for this object.
       mf.error.filename.exists=An object with this name already exists.
       mf.error.filename.invalidchars=Name of object contains invalid characters.
      diff --git a/src/main/java/org/olat/core/commons/modules/bc/components/ListRenderer.java b/src/main/java/org/olat/core/commons/modules/bc/components/ListRenderer.java
      --- a/src/main/java/org/olat/core/commons/modules/bc/components/ListRenderer.java
      +++ b/src/main/java/org/olat/core/commons/modules/bc/components/ListRenderer.java
      @@ -357,6 +357,11 @@
       			sb.append(Formatter.formatBytes(leaf.getSize()));
       			sb.append("</span>");
       		}
      +		else if (child instanceof VFSContainer) {
      +			sb.append("<span class='text-muted small'>");
      +			sb.append(((VFSContainer) child).getItems().size());
      +			sb.append(" "+translator.translate("mf.elements")+"</span>");
      +		}
       		sb.append("</td><td>");
       		
       		// last modified
      

        Attachments

          Activity

            People

            • Assignee:
              srosse Stéphane Rossé
              Reporter:
              stephan Stephan Clemenz
              Tester:
              Mandy Menzel
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m