Group management code.

This commit is contained in:
James Cole
2020-06-20 10:10:55 +02:00
parent b54ef9f5e5
commit 5b29e78c4b
25 changed files with 737 additions and 14 deletions

View File

@@ -59,4 +59,6 @@ return [
'delete_journal_link' => 'Delete link between transactions',
'telemetry_index' => 'Telemetry',
'telemetry_view' => 'View telemetry',
'edit_object_group' => 'Edit group ":title"',
'delete_object_group' => 'Delete group ":title"',
];

View File

@@ -891,7 +891,7 @@ return [
'list_inactive_rule' => 'inactive rule',
'bill_edit_rules' => 'Firefly III will attempt to edit the rule related to this bill as well. If you\'ve edited this rule yourself however, Firefly III won\'t change anything.|Firefly III will attempt to edit the :count rules related to this bill as well. If you\'ve edited these rules yourself however, Firefly III won\'t change anything.',
'bill_expected_date' => 'Expected :date',
// accounts:
'inactive_account_link' => 'You have :count inactive (archived) account, which you can view on this separate page.|You have :count inactive (archived) accounts, which you can view on this separate page.',
'all_accounts_inactive' => 'These are your inactive accounts.',
@@ -1671,5 +1671,18 @@ return [
'debug_pretty_table' => 'If you copy/paste the box below into a GitHub issue it will generate a table. Please do not surround this text with backticks or quotes.',
'debug_additional_data' => 'You may also share the content of the box below. You can also copy-and-paste this into a new or existing <a href="https://github.com/firefly-iii/firefly-iii/issues">GitHub issue</a>. However, the content of this box may contain private information such as account names, transaction details or email addresses.',
// object groups
'object_groups_menu_bar' => 'Groups',
'object_groups_page_title' => 'Groups',
'object_groups_breadcrumb' => 'Groups',
'object_groups_index' => 'Overview',
'object_groups' => 'Groups',
'object_groups_empty_explain' => 'Some things in Firefly III can be divided into groups. Piggy banks for example, feature a "Group" field in the edit and create screens. When you set this field, you can edit the names and the order of the groups on this page. For more information, check out the help-pages in the top right corner, under the (?)-icon.',
'object_group_title' => 'Title',
'edit_object_group' => 'Edit group ":title"',
'delete_object_group' => 'Edit group ":title"',
'update_object_group' => 'Update group',
'updated_object_group' => 'Succesfully updated group ":title"',
'deleted_object_group' => 'Succesfully deleted group ":title"',
];

View File

@@ -137,6 +137,7 @@ return [
'account_areYouSure' => 'Are you sure you want to delete the account named ":name"?',
'bill_areYouSure' => 'Are you sure you want to delete the bill named ":name"?',
'rule_areYouSure' => 'Are you sure you want to delete the rule titled ":title"?',
'object_group_areYouSure' => 'Are you sure you want to delete the group titled ":title"?',
'ruleGroup_areYouSure' => 'Are you sure you want to delete the rule group titled ":title"?',
'budget_areYouSure' => 'Are you sure you want to delete the budget named ":name"?',
'category_areYouSure' => 'Are you sure you want to delete the category named ":name"?',
@@ -156,6 +157,7 @@ return [
'also_delete_connections' => 'The only transaction linked with this link type will lose this connection.|All :count transactions linked with this link type will lose their connection.',
'also_delete_rules' => 'The only rule connected to this rule group will be deleted as well.|All :count rules connected to this rule group will be deleted as well.',
'also_delete_piggyBanks' => 'The only piggy bank connected to this account will be deleted as well.|All :count piggy bank connected to this account will be deleted as well.',
'not_delete_piggy_banks' => 'The piggy bank connected to this group will not be deleted.|The :count piggy banks connected to this group will not be deleted.',
'bill_keep_transactions' => 'The only transaction connected to this bill will not be deleted.|All :count transactions connected to this bill will be spared deletion.',
'budget_keep_transactions' => 'The only transaction connected to this budget will not be deleted.|All :count transactions connected to this budget will be spared deletion.',
'category_keep_transactions' => 'The only transaction connected to this category will not be deleted.|All :count transactions connected to this category will be spared deletion.',
@@ -163,6 +165,8 @@ return [
'tag_keep_transactions' => 'The only transaction connected to this tag will not be deleted.|All :count transactions connected to this tag will be spared deletion.',
'check_for_updates' => 'Check for updates',
'delete_object_group' => 'Delete group ":title"',
'email' => 'Email address',
'password' => 'Password',
'password_confirmation' => 'Password (again)',

View File

@@ -130,6 +130,7 @@ return [
'amount_zero' => 'The total amount cannot be zero.',
'current_target_amount' => 'The current amount must be less than the target amount.',
'unique_piggy_bank_for_user' => 'The name of the piggy bank must be unique.',
'unique_object_group' => 'The group name must be unique',
'secure_password' => 'This is not a secure password. Please try again. For more information, visit https://bit.ly/FF3-password-security',
'valid_recurrence_rep_type' => 'Invalid repetition type for recurring transactions.',

View File

@@ -15,7 +15,7 @@
{% if objectGroup.piggy_banks|length > 0 %}
<tbody class="piggy-connected-list" {% if objectGroupOrder != 0 %}data-title="{{ objectGroup.object_group_title }}"{% else %}data-title=""{% endif %}>
<tr>
<td colspan="2">{% if objectGroupOrder != 0 %}<i class="fa fa-fw fa-bars group-handle"></i>{% endif %}</td>
<td colspan="2">&nbsp;</td>
<td colspan="8"><small>{{ objectGroup.object_group_title }}</small></td>
</tr>
{% for piggy in objectGroup.piggy_banks %}

View File

@@ -0,0 +1,42 @@
{% extends "./layout/default" %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, objectGroup) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('object-groups.destroy',objectGroup.id) }}" accept-charset="UTF-8" class="form-horizontal">
<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('form.delete_object_group', {'title': objectGroup.title}) }}</h3>
</div>
<div class="box-body">
<p class="text-danger">
{{ trans('form.permDeleteWarning') }}
</p>
<p>
{{ trans('form.object_group_areYouSure', {'title': objectGroup.title}) }}
</p>
{% if piggyBanks > 0 %}
<p>
{{ Lang.choice('form.not_delete_piggy_banks', piggyBanks, {count: piggyBanks}) }}
</p>
{% endif %}
</div>
<div class="box-footer">
<input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn pull-right btn-danger"/>
<a href="{{ URL.previous() }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
</div>
</div>
</div>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1,58 @@
{% extends "./layout/default" %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, objectGroup) }}
{% endblock %}
{% block content %}
{{ Form.model(objectGroup, {'class' : 'form-horizontal','enctype': 'multipart/form-data','id' : 'update','url' : route('object-groups.update',objectGroup.id)}) }}
<input type="hidden" name="id" value="{{ objectGroup.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('title') }}
</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','object group') }}
</div>
<div class="box-footer">
<button type="submit" class="btn btn-success pull-right">
{{ 'update_object_group'|_ }}
</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">
<link href="v1/css/jquery-ui/jquery-ui.theme.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all">
{% endblock %}

View File

@@ -0,0 +1,74 @@
{% extends "./layout/default" %}
{% block breadcrumbs %}
{{ Breadcrumbs.render }}
{% endblock %}
{% block content %}
<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">{{ 'object_groups'|_ }}</h3>
</div>
{% if objectGroups|length == 0 %}
<div class="box-body">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<p>
{{ 'object_groups_empty_explain'|_ }}
</p>
</div>
</div>
</div>
{% endif %}
{% if objectGroups|length > 0 %}
<div class="box-body no-padding">
<table class="table table-condensed" id="sortable">
<thead>
<tr>
<th>&nbsp;</th>
<th>
{{ 'object_group_title'|_ }}
</th>
<th>
&nbsp;
</th>
</tr>
</thead>
<tbody>
{% for objectGroup in objectGroups %}
<tr class="group-sortable" data-id="{{ objectGroup.id }}" data-name="{{ objectGroup.title|escape('html') }}" data-order="{{ objectGroup.order }}">
<td><i class="fa fa-fw fa-bars group-handle"></i></td>
<td>
<strong>{{ objectGroup.title }}</strong><br />
{% for piggyBank in objectGroup.piggyBanks %}
- {{ 'piggy_bank'|_ }}: <a href="{{ route('piggy-banks.show', [piggyBank.id]) }}">{{ piggyBank.name }}</a><br>
{% endfor %}
</td>
<td>
<div class="btn-group btn-group-sm">
<a class="btn btn-default" href="{{ route('object-groups.edit', [objectGroup.id]) }}">
<i class="fa fa-pencil"></i>
</a>
<a class="btn btn-danger" href="{{ route('object-groups.delete', [objectGroup.id]) }}">
<i class="fa fa-trash"></i>
</a>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
</div>
</div>
{% 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/object-groups/index.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}
{% block styles %}
{% endblock %}

View File

@@ -148,6 +148,12 @@
<span>{{ 'tags'|_ }}</span>
</a>
</li>
<li class="{{ activeRoutePartial('object-groups') }}">
<a href="{{ route('object-groups.index') }}">
<i class="fa fa-angle-right fa-fw"></i>
<span>{{ 'object_groups_menu_bar'|_ }}</span>
</a>
</li>
</ul>
</li>