mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -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
|
[$start, $end] = [$end, $start]; // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
$location = $this->repository->getLocation($account);
|
$location = $this->repository->getLocation($account);
|
||||||
|
$attachments = $this->repository->getAttachments($account);
|
||||||
$objectType = config(sprintf('firefly.shortNamesByFullName.%s', $account->accountType->type));
|
$objectType = config(sprintf('firefly.shortNamesByFullName.%s', $account->accountType->type));
|
||||||
$today = new Carbon;
|
$today = new Carbon;
|
||||||
$subTitleIcon = config(sprintf('firefly.subIconsByIdentifier.%s', $account->accountType->type));
|
$subTitleIcon = config(sprintf('firefly.subIconsByIdentifier.%s', $account->accountType->type));
|
||||||
@ -139,6 +140,7 @@ class ShowController extends Controller
|
|||||||
'periods',
|
'periods',
|
||||||
'subTitleIcon',
|
'subTitleIcon',
|
||||||
'groups',
|
'groups',
|
||||||
|
'attachments',
|
||||||
'subTitle',
|
'subTitle',
|
||||||
'start',
|
'start',
|
||||||
'end',
|
'end',
|
||||||
|
@ -311,7 +311,7 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
$query = $this->user->accounts()->with(
|
$query = $this->user->accounts()->with(
|
||||||
['accountmeta' => function (HasMany $query) {
|
['accountmeta' => function (HasMany $query) {
|
||||||
$query->where('name', 'account_role');
|
$query->where('name', 'account_role');
|
||||||
}]
|
}, 'attachments']
|
||||||
);
|
);
|
||||||
if (count($types) > 0) {
|
if (count($types) > 0) {
|
||||||
$query->accountTypeIn($types);
|
$query->accountTypeIn($types);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div class="row">
|
<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">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">
|
<h3 class="box-title">
|
||||||
@ -32,6 +32,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
{% if not showAll and isLiability %}
|
{% if not showAll and isLiability %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -42,6 +42,9 @@
|
|||||||
{% if account.location %}
|
{% if account.location %}
|
||||||
<i class="fa fa-fw fa-map-marker"></i>
|
<i class="fa fa-fw fa-map-marker"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if account.attachments.count > 0 %}
|
||||||
|
<i class="fa fa-fw fa-paperclip"></i>
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
{% if objectType == "asset" %}
|
{% if objectType == "asset" %}
|
||||||
<td class="hidden-sm hidden-xs hidden-md">
|
<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>
|
<h3 class="box-title">{{ 'attachments'|_ }}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body table-responsive no-padding">
|
<div class="box-body table-responsive no-padding">
|
||||||
<table class="table table-hover">
|
{% include 'list.attachments' with {attachments: attachments[journal.transaction_journal_id]} %}
|
||||||
{% 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>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user