Move v1 views

This commit is contained in:
James Cole
2022-01-29 14:15:34 +01:00
parent a12fd4a3ae
commit 6da6a68e33
251 changed files with 17989 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, piggyBank) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('piggy-banks.add', piggyBank.id) }}" accept-charset="UTF-8" class="form-horizontal" id="store">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('firefly.add_money_to_piggy', {name: piggyBank.name}) }}</h3>
</div>
<div class="box-body">
{% if maxAmount > 0 %}
<p>
{{ 'max_amount_add'|_ }}: {{ formatAmountByCurrency(currency,maxAmount) }}.
</p>
<div class="input-group">
<div class="input-group-addon">{{ currency.symbol|raw }}</div>
<input step="any" class="form-control" id="amount" autocomplete="off" name="amount" max="{{ maxAmount|round(2) }}"
type="number"/>
</div>
<p>
&nbsp;
</p>
<button type="submit" class="btn btn-success pull-right">
{{ 'add'|_ }}
</button>
{% else %}
<p class="text-danger">{{ 'no_money_for_piggy'|_ }}</p>
{% endif %}
</div>
</div>
</div>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1,37 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span>&times;</span><span class="sr-only">{{ 'close'|_ }}</span>
</button>
<h4 class="modal-title">{{ trans('firefly.add_money_to_piggy_title', {name: piggyBank.name}) }}</h4>
</div>
{% if maxAmount > 0 %}
<form style="display: inline;" id="add" action="{{ route('piggy-banks.add', piggyBank.id) }}" method="POST">
<div class="modal-body">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
<p>
{{ 'max_amount_add'|_ }}: {{ formatAmountByCurrency(currency,maxAmount) }}.
</p>
<div class="input-group">
<div class="input-group-addon">{{ currency.symbol|raw }}</div>
<input step="any" class="form-control" id="amount" autocomplete="off" name="amount" max="{{ maxAmount|round(currency.decimal_places) }}" type="number"/>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ 'close'|_ }}</button>
<button type="submit" class="btn btn-primary">{{ 'add'|_ }}</button>
</div>
</form>
{% else %}
<div class="modal-body">
<p class="text-danger">{{ 'no_money_for_piggy'|_ }}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ 'close'|_ }}</button>
</div>
{% endif %}
</div>
</div>

View File

@@ -0,0 +1,75 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('piggy-banks.store') }}" accept-charset="UTF-8" class="form-horizontal" id="store" enctype="multipart/form-data">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<input type="hidden" name="repeats" value="0"/>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.text('name') }}
{{ AccountForm.assetAccountList('account_id', null, {label: 'saveOnAccount'|_ }) }}
{{ ExpandedForm.amountNoCurrency('targetamount') }}
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.date('targetdate') }}
{{ ExpandedForm.textarea('notes', null, {helpText: trans('firefly.field_supports_markdown')} ) }}
{{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }}
{{ ExpandedForm.objectGroup() }}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
{# panel for options #}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'options'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.optionsList('create','piggy bank') }}
</div>
<div class="box-footer">
<button type="submit" class="btn btn-success pull-right">
{{ 'store_piggy_bank'|_ }}
</button>
</div>
</div>
</div>
</div>
</form>
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="v1/js/lib/modernizr-custom.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/jquery-ui.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/piggy-banks/create.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{# auto complete for object groups #}
<script type="text/javascript" src="v1/js/lib/typeahead/typeahead.bundle.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/object-groups/create-edit.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}
{% block styles %}
<link href="v1/css/jquery-ui/jquery-ui.structure.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all" nonce="{{ JS_NONCE }}">
<link href="v1/css/jquery-ui/jquery-ui.theme.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all" nonce="{{ JS_NONCE }}">
{% endblock %}

View File

@@ -0,0 +1,35 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, piggyBank) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('piggy-banks.destroy',piggyBank.id) }}" accept-charset="UTF-8" class="form-horizontal" id="destroy">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-6 col-lg-offset-3 col-md-12 col-sm-12">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('firefly.delete_piggy_bank', {'name': piggyBank.name}) }}</h3>
</div>
<div class="box-body">
<p class="text-danger">
{{ trans('form.permDeleteWarning') }}
</p>
<p>
{{ trans('form.piggyBank_areYouSure', {'name': piggyBank.name}) }}
</p>
</div>
<div class="box-footer">
<input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn btn-danger pull-right"/>
<a href="{{ URL.previous() }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
</div>
</div>
</div>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1,77 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, piggyBank) }}
{% endblock %}
{% block content %}
{{ Form.model(piggyBank, {'class' : 'form-horizontal','enctype': 'multipart/form-data','id' : 'update','url' : route('piggy-banks.update',piggyBank.id)}) }}
<input type="hidden" name="repeats" value="0"/>
<input type="hidden" name="id" value="{{ piggyBank.id }}"/>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.text('name') }}
{{ AccountForm.assetAccountList('account_id', null, {label: 'saveOnAccount'|_ }) }}
{{ ExpandedForm.amountNoCurrency('targetamount') }}
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.date('startdate') }}
{{ ExpandedForm.date('targetdate') }}
{{ ExpandedForm.textarea('notes', null, {helpText: trans('firefly.field_supports_markdown')}) }}
{{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }}
{{ ExpandedForm.objectGroup() }}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
{# panel for options #}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'options'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.optionsList('update','piggy bank') }}
</div>
<div class="box-footer">
<button type="submit" class="btn btn-success pull-right">
{{ 'update_piggy_button'|_ }}
</button>
</div>
</div>
</div>
</div>
</form>
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="v1/js/lib/modernizr-custom.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/jquery-ui.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/piggy-banks/create.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{# auto complete for object groups #}
<script type="text/javascript" src="v1/js/lib/typeahead/typeahead.bundle.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/object-groups/create-edit.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}
{% block styles %}
<link href="v1/css/jquery-ui/jquery-ui.structure.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all" nonce="{{ JS_NONCE }}">
<link href="v1/css/jquery-ui/jquery-ui.theme.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all" nonce="{{ JS_NONCE }}">
{% endblock %}

View File

@@ -0,0 +1,80 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
{% endblock %}
{% block content %}
{% if piggyBanks|length == 0 %}
{% include 'partials.empty' with {objectType: 'default', type: 'piggies',route: route('piggy-banks.create')} %}
{% else %}
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'piggyBanks'|_ }}</h3>
</div>
<div class="box-body no-padding">
<div style="padding:8px;">
<a class="btn btn-success" href="{{ route('piggy-banks.create') }}"><span class="fa fa-plus fa-fw"></span> {{ 'create_new_piggy_bank'|_ }}</a>
</div>
{% include 'list/piggy-banks' %}
</div>
<div class="box-footer">
<a class="btn btn-success" href="{{ route('piggy-banks.create') }}"><span class="fa fa-plus fa-fw"></span> {{ 'create_new_piggy_bank'|_ }}</a>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'account_status'|_ }}</h3>
</div>
<div class="box-body no-padding">
<table class="table table-responsive table-hover" id="accountStatus">
<thead>
<tr>
<th>{{ 'account'|_ }}</th>
<th style="text-align:right;" class="hidden-sm hidden-xs">{{ 'balance'|_ }}</th>
<th style="text-align:right;">{{ 'left_for_piggy_banks'|_ }}</th>
<th style="text-align:right;" class="hidden-sm hidden-xs">{{ 'sum_of_piggy_banks'|_ }}</th>
<th style="text-align:right;" class="hidden-sm hidden-xs">{{ 'saved_so_far'|_ }}</th>
<th style="text-align:right;" class="hidden-sm hidden-xs">{{ 'left_to_save'|_ }}</th>
</tr>
</thead>
<tbody>
{% for id,info in accounts %}
<tr>
<td><a href="{{ route('accounts.show',id) }}" title="{{ info.name }}">{{ info.name }}</a></td>
<td style="text-align:right;" class="hidden-sm hidden-xs">
{{ formatAmountBySymbol(info.current_balance,info.currency_symbol,info.currency_decimal_places) }}
</td>
<td style="text-align:right;">
{{ formatAmountBySymbol(info.left,info.currency_symbol,info.currency_decimal_places) }}
</td>
<td style="text-align:right;" class="hidden-sm hidden-xs">
{{ formatAmountBySymbol(info.target,info.currency_symbol,info.currency_decimal_places) }}
</td>
<td style="text-align:right;" class="hidden-sm hidden-xs">
{{ formatAmountBySymbol(info.saved,info.currency_symbol,info.currency_decimal_places) }}
</td>
<td style="text-align:right;" class="hidden-sm hidden-xs">
{{ formatAmountBySymbol(info.to_save,info.currency_symbol,info.currency_decimal_places) }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}
{% block scripts %}
<script src="v1/js/lib/jquery-ui.min.js?v={{ FF_VERSION }}" type="text/javascript" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/piggy-banks/index.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}

View File

@@ -0,0 +1,40 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, piggyBank) }}
{% endblock %}
{% block content %}
<form id="remove" class="form-horizontal" action="{{ route('piggy-banks.remove', piggyBank.id) }}" method="POST">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('firefly.remove_money_from_piggy_title', {name: piggyBank.name}) }}</h3>
</div>
<div class="box-body">
<p>
{{ 'max_amount_remove'|_ }}: {{ formatAmountByCurrency(currency, repetition.currentamount) }}.
</p>
<div class="input-group">
<div class="input-group-addon">{{ currency.symbol|raw }}</div>
<input step="any" class="form-control" id="amount" autocomplete="off" name="amount" max="{{ repetition.currentamount }}"
type="number"/>
</div>
<p>
&nbsp;
</p>
<button type="submit" class="btn btn-success pull-right">
{{ 'remove'|_ }}
</button>
</div>
</div>
</div>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1,30 @@
<div class="modal-dialog">
<div class="modal-content">
<form style="display: inline;" id="remove" action="{{ route('piggy-banks.remove', piggyBank.id) }}" method="POST">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span>&times;</span><span class="sr-only">{{ 'close'|_ }}</span>
</button>
<h4 class="modal-title">{{ trans('firefly.remove_money_from_piggy_title', {name: piggyBank.name}) }}</h4>
</div>
<div class="modal-body">
<p>
{{ 'max_amount_remove'|_ }}: {{ formatAmountByCurrency(currency, repetition.currentamount) }}.
</p>
<div class="input-group">
<div class="input-group-addon">{{ currency.symbol|raw }}</div>
<input step="any" class="form-control" id="amount" autocomplete="off" name="amount" max="{{ repetition.currentamount }}"
type="number">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ 'close'|_ }}</button>
<button type="submit" class="btn btn-primary">{{ 'remove'|_ }}</button>
</div>
</form>
</div>
</div>

View File

@@ -0,0 +1,146 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, piggyBank) }}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-8 col-md-8 col-sm-6">
<div class="box" id="piggyChart">
<div class="box-header with-border">
<h3 class="box-title">{{ 'events'|_ }}</h3>
</div>
<div class="box-body">
<canvas id="piggy-bank-history" style="width:100%;height:400px;" height="400" width="100%"></canvas>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'details'|_ }}</h3>
<div class="box-tools pull-right">
<div class="btn-group">
<button class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown"><span class="fa fa-ellipsis-v"></span></button>
<ul class="dropdown-menu" role="menu">
<li><a href="{{ route('piggy-banks.edit', piggy.id) }}"><span class="fa fa-pencil fa-fw"></span> {{ 'edit'|_ }}</a></li>
<li><a href="{{ route('piggy-banks.delete', piggy.id) }}"><span class="fa fa-trash fa-fw"></span> {{ 'delete'|_ }}</a></li>
</ul>
</div>
</div>
</div>
<div class="box-body no-padding">
<table class="table table-responsive table-hover" id="piggyDetails">
<tr>
<td style="width:40%;">{{ 'account'|_ }}</td>
<td><a href="{{ route('accounts.show', piggyBank.account_id) }}">{{ piggyBank.account.name }}</a></td>
</tr>
{% if piggy.object_group_title %}
<tr>
<td style="width:40%;">{{ 'object_group'|_ }}</td>
<td>{{ piggy.object_group_title }}</a></td>
</tr>
{% endif %}
<tr>
<td>{{ 'target_amount'|_ }}</td>
<td>
{{ formatAmountBySymbol(piggy.target_amount, piggy.currency_symbol, piggy.currency_decimal_places) }}
</td>
</tr>
<tr>
<td>{{ 'saved_so_far'|_ }}</td>
<td>
{{ formatAmountBySymbol(piggy.current_amount, piggy.currency_symbol, piggy.currency_decimal_places) }}
</td>
</tr>
<tr>
<td>{{ 'left_to_save'|_ }}</td>
<td>
{{ formatAmountBySymbol(piggy.left_to_save, piggy.currency_symbol, piggy.currency_decimal_places) }}
</td>
</tr>
<tr>
<td>{{ 'start_date'|_ }}</td>
<td>
{% if piggyBank.startdate %}
{{ piggyBank.startdate.formatLocalized(monthAndDayFormat) }}
{% else %}
<em>{{ 'no_start_date'|_ }}</em>
{% endif %}
</td>
</tr>
<tr>
<td>{{ 'target_date'|_ }}</td>
<td>
{% if piggyBank.targetdate %}
{{ piggyBank.targetdate.formatLocalized(monthAndDayFormat) }}
{% else %}
<em>{{ 'no_target_date'|_ }}</em>
{% endif %}
</td>
</tr>
{% if piggyBank.targetdate %}
<tr>
<td>{{ 'suggested_amount'|_ }}</td>
<td>
{{ formatAmountBySymbol(piggy.save_per_month, piggy.currency_symbol, piggy.currency_decimal_places) }}
</td>
</tr>
{% endif %}
</table>
</div>
</div>
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'transactions'|_ }}</h3>
</div>
<div class="box-body no-padding" id="piggyEvents">
{% include 'list/piggy-bank-events' %}
</div>
</div>
</div>
</div>
<div class="row">
{% if piggy.notes %}
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('form.notes') }}</h3>
</div>
<div class="box-body markdown">{{ piggy.notes|default('')|markdown }}
</div>
</div>
</div>
{% endif %}
{% 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 no-padding">
{% include 'list.attachments' %}
</div>
</div>
</div>
{% endif %}
</div>
{% endblock %}
{% block scripts %}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var piggyBankID = {{ piggyBank.id }};
</script>
<script type="text/javascript" src="v1/js/lib/Chart.bundle.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/charts.defaults.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/charts.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/piggy-banks/show.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}