diff --git a/app/Http/Controllers/AttachmentController.php b/app/Http/Controllers/AttachmentController.php index 775df201fe..cbeee4d671 100644 --- a/app/Http/Controllers/AttachmentController.php +++ b/app/Http/Controllers/AttachmentController.php @@ -147,6 +147,24 @@ class AttachmentController extends Controller return view('attachments.edit', compact('attachment', 'subTitleIcon', 'subTitle')); } + /** + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + */ + public function index() + { + $set = $this->repository->get(); + $set = $set->each( + function (Attachment $attachment) { + $attachment->file_exists = $this->repository->exists($attachment); + + return $attachment; + } + ); + + + return view('attachments.index', compact('set')); + } + /** * @param AttachmentFormRequest $request * @param Attachment $attachment diff --git a/resources/views/attachments/index.twig b/resources/views/attachments/index.twig new file mode 100644 index 0000000000..120c2ddb08 --- /dev/null +++ b/resources/views/attachments/index.twig @@ -0,0 +1,64 @@ +{% extends "./layout/default" %} + +{% block breadcrumbs %} + {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }} +{% endblock %} + +{% block content %} +
File name | +Size of file | +Type of file | +Attached to | +Exists? | +|
---|---|---|---|---|---|
+ + | +{{ att.filename }} | +{{ att.size|filesize }} | +{{ att.mime }} | ++ {% if att.attachable_type == 'FireflyIII\\Models\\TransactionJournal' %} + + {{ att.attachable.description }} + + {% endif %} + | ++ {% if att.file_exists %} + + {% else %} + + {% endif %} + | +