Routine to delete rules. Should include routine to move rules to other group.

This commit is contained in:
James Cole
2016-01-13 21:44:26 +01:00
parent 06174d6afb
commit 4697fbdeef
10 changed files with 146 additions and 7 deletions

View File

@@ -53,6 +53,8 @@ return [
'created_new_rule_group' => 'New rule group ":title" stored!',
'updated_rule_group' => 'Successfully updated rule group ":title".',
'edit_rule_group' => 'Edit rule group ":title"',
'delete_rule_group' => 'Delete rule group ":title"',
'deleted_rule_group' => 'Deleted rule group ":title"',
'update_rule_group' => 'Update rule group',
'no_rules_in_group' => 'There are no rules in this group',

View File

@@ -76,10 +76,12 @@ return [
'delete_currency' => 'Delete currency ":name"',
'delete_journal' => 'Delete transaction with description ":description"',
'delete_attachment' => 'Delete attachment ":name"',
'delete_rule_group' => 'Delete rule group ":title"',
'attachment_areYouSure' => 'Are you sure you want to delete the attachment named ":name"?',
'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"?',
'ruleGroup_areYouSure' => 'Are you sure you want to delete the rule group titles ":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"?',
'currency_areYouSure' => 'Are you sure you want to delete the currency named ":name"?',
@@ -89,6 +91,7 @@ return [
'permDeleteWarning' => 'Deleting stuff from Firely is permanent and cannot be undone.',
'also_delete_transactions' => 'The only transaction connected to this account will be deleted as well.|All :count transactions connected to this account will be deleted as well.',
'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.',
'bill_keep_transactions' => 'The only transaction connected to this bill will not be deleted.|All :count transactions connected to this bill will spared deletion.',
'budget_keep_transactions' => 'The only transaction connected to this budget will not be deleted.|All :count transactions connected to this budget will spared deletion.',

View File

@@ -0,0 +1,41 @@
{% extends "./layout/default.twig" %}
{% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, ruleGroup) }}
{% endblock %}
{% block content %}
{{ Form.open({'class' : 'form-horizontal','id' : 'destroy','url' : route('rules.rule-group.destroy',ruleGroup.id) }) }}
<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_rule_group', {'title': ruleGroup.title}) }}</h3>
</div>
<div class="box-body">
<p class="text-danger">
{{ trans('form.permDeleteWarning') }}
</p>
<p>
{{ trans('form.ruleGroup_areYouSure', {'title': ruleGroup.title}) }}
</p>
<p class="text-danger">
{% if ruleGroup.rules|length > 0 %}
{{ Lang.choice('form.also_delete_rules', ruleGroup.rules|length, {count: ruleGroup.rules|length}) }}
{% endif %}
</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.close|raw }}
{% endblock %}