From 7b3982898040f7e6b01002610b31e83bd925f280 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 28 Apr 2018 06:53:37 +0200 Subject: [PATCH] Improve attachment list. --- app/Http/Controllers/AttachmentController.php | 2 +- resources/views/attachments/index.twig | 36 ++++++++++--------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/app/Http/Controllers/AttachmentController.php b/app/Http/Controllers/AttachmentController.php index cbeee4d671..d698f4d732 100644 --- a/app/Http/Controllers/AttachmentController.php +++ b/app/Http/Controllers/AttachmentController.php @@ -152,7 +152,7 @@ class AttachmentController extends Controller */ public function index() { - $set = $this->repository->get(); + $set = $this->repository->get()->reverse(); $set = $set->each( function (Attachment $attachment) { $attachment->file_exists = $this->repository->exists($attachment); diff --git a/resources/views/attachments/index.twig b/resources/views/attachments/index.twig index 24b687c94b..8d9730ff2e 100644 --- a/resources/views/attachments/index.twig +++ b/resources/views/attachments/index.twig @@ -10,45 +10,47 @@

- List of all attachments + {{ 'list_all_attachments'|_ }}

- +
- - - - - + + + + + {% for att in set %} - - - - - + + -
File nameSize of fileType of fileAttached toExists?{{ trans('list.file_name') }}{{ trans('list.file_size') }}{{ trans('list.file_type') }}{{ trans('list.attached_to') }}{{ trans('list.file_exists') }}
+
+ - {{ att.filename }} + {{ att.filename }} {{ att.size|filesize }}{{ att.mime }} + {{ att.size|filesize }}{{ att.mime }} {% if att.attachable_type == 'FireflyIII\\Models\\TransactionJournal' %} {{ att.attachable.description }} + {% else %} + {{ att.attachable_type }} {% endif %} + {% if att.file_exists %} {% else %} @@ -64,9 +66,11 @@ {% endblock %} +{% block scripts %} + +{% endblock %} {% block styles %} + {% endblock %} -{% block scripts %} -{% endblock %}