From 2ff93935435294b2fd25f6925b29023aaf4f97bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Thu, 27 Sep 2018 13:01:42 +0200 Subject: [PATCH 1/2] MOBILE-2612 assign: Show size and time on file submissions --- src/addon/mod/assign/providers/assign.ts | 13 +++---------- .../component/addon-mod-assign-submission-file.html | 12 +++++++----- src/components/file/core-file.html | 4 +++- src/components/file/file.scss | 9 ++++++--- src/components/file/file.ts | 12 +++++++++++- 5 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/addon/mod/assign/providers/assign.ts b/src/addon/mod/assign/providers/assign.ts index fbaec2622..a1e3a329a 100644 --- a/src/addon/mod/assign/providers/assign.ts +++ b/src/addon/mod/assign/providers/assign.ts @@ -322,19 +322,12 @@ export class AddonModAssignProvider { } filearea.files.forEach((file) => { - let filename; - - if (file.filename) { - filename = file.filename; - } else { + if (!file.filename) { // We don't have filename, extract it from the path. - filename = file.filepath[0] == '/' ? file.filepath.substr(1) : file.filepath; + file.filename = file.filepath[0] == '/' ? file.filepath.substr(1) : file.filepath; } - files.push({ - filename: filename, - fileurl: file.fileurl - }); + files.push(file); }); }); } diff --git a/src/addon/mod/assign/submission/file/component/addon-mod-assign-submission-file.html b/src/addon/mod/assign/submission/file/component/addon-mod-assign-submission-file.html index 5264ff0bc..779bff313 100644 --- a/src/addon/mod/assign/submission/file/component/addon-mod-assign-submission-file.html +++ b/src/addon/mod/assign/submission/file/component/addon-mod-assign-submission-file.html @@ -1,12 +1,14 @@

{{plugin.name}}

-
- - +
+ + + - - + + +
diff --git a/src/components/file/core-file.html b/src/components/file/core-file.html index 509ae3aca..b8d89f5a2 100644 --- a/src/components/file/core-file.html +++ b/src/components/file/core-file.html @@ -1,6 +1,8 @@ -

{{fileName}}

+

{{fileName}}

+

{{ fileSizeReadable }}

+

{{ timemodified * 1000 | coreFormatDate:"dfmediumdate" }}