mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-25 18:30:55 -06:00
Attachments for accounts are visible #2828
This commit is contained in:
parent
cdf055065f
commit
2a46756838
@ -103,6 +103,7 @@ class ShowController extends Controller
|
||||
[$start, $end] = [$end, $start]; // @codeCoverageIgnore
|
||||
}
|
||||
$location = $this->repository->getLocation($account);
|
||||
$attachments = $this->repository->getAttachments($account);
|
||||
$objectType = config(sprintf('firefly.shortNamesByFullName.%s', $account->accountType->type));
|
||||
$today = new Carbon;
|
||||
$subTitleIcon = config(sprintf('firefly.subIconsByIdentifier.%s', $account->accountType->type));
|
||||
@ -139,6 +140,7 @@ class ShowController extends Controller
|
||||
'periods',
|
||||
'subTitleIcon',
|
||||
'groups',
|
||||
'attachments',
|
||||
'subTitle',
|
||||
'start',
|
||||
'end',
|
||||
|
@ -311,7 +311,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
$query = $this->user->accounts()->with(
|
||||
['accountmeta' => function (HasMany $query) {
|
||||
$query->where('name', 'account_role');
|
||||
}]
|
||||
}, 'attachments']
|
||||
);
|
||||
if (count($types) > 0) {
|
||||
$query->accountTypeIn($types);
|
||||
|
@ -7,7 +7,7 @@
|
||||
{% block content %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="{% if attachments.count == 0 %}col-lg-12 col-md-12 col-sm-12 col-xs-12{% else %}col-lg-8 col-md-6 col-sm-12 col-xs-12{% endif %}">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">
|
||||
@ -32,6 +32,20 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if attachments.count > 0 %}
|
||||
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">
|
||||
{{ 'attachments'|_ }}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="box-body table-responsive no-padding">
|
||||
{% include 'list.attachments' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if not showAll and isLiability %}
|
||||
<div class="row">
|
||||
|
@ -42,6 +42,9 @@
|
||||
{% if account.location %}
|
||||
<i class="fa fa-fw fa-map-marker"></i>
|
||||
{% endif %}
|
||||
{% if account.attachments.count > 0 %}
|
||||
<i class="fa fa-fw fa-paperclip"></i>
|
||||
{% endif %}
|
||||
</td>
|
||||
{% if objectType == "asset" %}
|
||||
<td class="hidden-sm hidden-xs hidden-md">
|
||||
|
47
resources/views/v1/list/attachments.twig
Normal file
47
resources/views/v1/list/attachments.twig
Normal file
@ -0,0 +1,47 @@
|
||||
<table class="table table-hover">
|
||||
{% for attachment in attachments %}
|
||||
<tr>
|
||||
<td style="width:120px;">
|
||||
<div class="btn-group btn-group-xs">
|
||||
<a href="{{ route('attachments.edit', attachment.id) }}" class="btn btn-default"><i
|
||||
class="fa fa-pencil"></i></a>
|
||||
<a href="{{ route('attachments.delete', attachment.id) }}" class="btn btn-danger"><i
|
||||
class="fa fa-trash"></i></a>
|
||||
{% if attachment.file_exists %}
|
||||
<a href="{{ route('attachments.download', attachment.id) }}" class="btn btn-default"><i
|
||||
class="fa fa-download"></i></a>
|
||||
{% endif %}
|
||||
{% if not attachment.file_exists %}
|
||||
<a href="#" class="btn btn-danger"><i class="fa fa-exclamation-triangle"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{% if attachment.file_exists %}
|
||||
<i class="fa {{ attachment.mime|mimeIcon }}"></i>
|
||||
<a href="{{ route('attachments.view', attachment.id) }}" title="{{ attachment.filename }}">
|
||||
{% if attachment.title %}
|
||||
{{ attachment.title }}
|
||||
{% else %}
|
||||
{{ attachment.filename }}
|
||||
{% endif %}
|
||||
</a>
|
||||
({{ attachment.size|filesize }})
|
||||
{% if null != attachment.notes and '' != attachment.notes %}
|
||||
{{ attachment.notes|markdown }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if not attachment.file_exists %}
|
||||
<i class="fa fa-fw fa-exclamation-triangle"></i>
|
||||
{% if attachment.title %}
|
||||
{{ attachment.title }}
|
||||
{% else %}
|
||||
{{ attachment.filename }}
|
||||
{% endif %}
|
||||
<br>
|
||||
<span class="text-danger">{{ 'attachment_not_found'|_ }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
@ -325,53 +325,7 @@
|
||||
<h3 class="box-title">{{ 'attachments'|_ }}</h3>
|
||||
</div>
|
||||
<div class="box-body table-responsive no-padding">
|
||||
<table class="table table-hover">
|
||||
{% for attachment in attachments[journal.transaction_journal_id] %}
|
||||
<tr>
|
||||
<td style="width:120px;">
|
||||
<div class="btn-group btn-group-xs">
|
||||
<a href="{{ route('attachments.edit', attachment.id) }}" class="btn btn-default"><i
|
||||
class="fa fa-pencil"></i></a>
|
||||
<a href="{{ route('attachments.delete', attachment.id) }}" class="btn btn-danger"><i
|
||||
class="fa fa-trash"></i></a>
|
||||
{% if attachment.file_exists %}
|
||||
<a href="{{ route('attachments.download', attachment.id) }}" class="btn btn-default"><i
|
||||
class="fa fa-download"></i></a>
|
||||
{% endif %}
|
||||
{% if not attachment.file_exists %}
|
||||
<a href="#" class="btn btn-danger"><i class="fa fa-exclamation-triangle"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{% if attachment.file_exists %}
|
||||
<i class="fa {{ attachment.mime|mimeIcon }}"></i>
|
||||
<a href="{{ route('attachments.view', attachment.id) }}" title="{{ attachment.filename }}">
|
||||
{% if attachment.title %}
|
||||
{{ attachment.title }}
|
||||
{% else %}
|
||||
{{ attachment.filename }}
|
||||
{% endif %}
|
||||
</a>
|
||||
({{ attachment.size|filesize }})
|
||||
{% if null != attachment.notes and '' != attachment.notes %}
|
||||
{{ attachment.notes|markdown }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if not attachment.file_exists %}
|
||||
<i class="fa fa-fw fa-exclamation-triangle"></i>
|
||||
{% if attachment.title %}
|
||||
{{ attachment.title }}
|
||||
{% else %}
|
||||
{{ attachment.filename }}
|
||||
{% endif %}
|
||||
<br>
|
||||
<span class="text-danger">{{ 'attachment_not_found'|_ }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% include 'list.attachments' with {attachments: attachments[journal.transaction_journal_id]} %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user