Introduced bulk edit endpoint for bulk edit of categories and tags

This commit is contained in:
Victor Mosin
2017-12-30 09:21:28 +01:00
committed by Victor Mosin
parent b65e1e022e
commit 805456d032
14 changed files with 328 additions and 3 deletions

View File

@@ -713,6 +713,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?',
'reconcile_selected' => 'Ausgleichen',
'mass_delete_journals' => 'Löschen Sie eine Reihe von Überweisungen',
'mass_edit_journals' => 'Bearbeiten Sie eine Reihe von Überweisungen',
'mass_edit_bulk_journals' => 'Bulk-Bearbeitung',
'cannot_edit_other_fields' => 'You cannot mass-edit other fields than the ones here, because there is no room to show them. Please follow the link and edit them by one-by-one, if you need to edit these fields.',
'no_budget' => '(kein Budget)',
'no_budget_squared' => '(kein Budget)',
@@ -724,6 +725,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?',
'opt_group_savingAsset' => 'Sparkonten',
'opt_group_sharedAsset' => 'Shared asset accounts',
'opt_group_ccAsset' => 'Kreditkarten',
'mass_edit_bulk' => 'Bulk-Bearbeitung',
// new user:
'welcome' => 'Willkommen bei Firefly!',

View File

@@ -89,6 +89,7 @@ return [
'budget_count' => 'Anzahl Budgets',
'rule_and_groups_count' => 'Anzahl Regeln und Regelgruppen',
'tags_count' => 'Anzahl Tags',
'tags' => 'Tags',
'inward' => 'Inward description',
'outward' => 'Outward description',
'number_of_transactions' => 'Anzahl der Zahlungsvorgänge',

View File

@@ -728,6 +728,7 @@ return [
'reconcile_selected' => 'Reconcile',
'mass_delete_journals' => 'Delete a number of transactions',
'mass_edit_journals' => 'Edit a number of transactions',
'mass_edit_bulk_journals' => 'Bulk edit',
'cannot_edit_other_fields' => 'You cannot mass-edit other fields than the ones here, because there is no room to show them. Please follow the link and edit them by one-by-one, if you need to edit these fields.',
'no_budget' => 'none',
'no_budget_squared' => '(no budget)',
@@ -739,6 +740,7 @@ return [
'opt_group_savingAsset' => 'Savings accounts',
'opt_group_sharedAsset' => 'Shared asset accounts',
'opt_group_ccAsset' => 'Credit cards',
'mass_edit_bulk' => 'Bulk edit',
// new user:
'welcome' => 'Welcome to Firefly!',

View File

@@ -89,6 +89,7 @@ return [
'budget_count' => 'Number of budgets',
'rule_and_groups_count' => 'Number of rules and rule groups',
'tags_count' => 'Number of tags',
'tags' => 'Tags',
'inward' => 'Inward description',
'outward' => 'Outward description',
'number_of_transactions' => 'Number of transactions',

View File

@@ -36,6 +36,7 @@
<div class="col-lg-8 col-md-12 col-sm-12 col-xs-12">
<div class="mass_button_options btn-group btn-group" style="display:none;">
<a href="#" class="btn btn-default mass_edit"><i class="fa fa-fw fa-pencil"></i> <span>{{ 'edit'|_ }}</span></a>
<a href="#" class="btn btn-default mass_edit_bulk"><span>{{ 'mass_edit_bulk'|_ }}</span></a>
{#<a href="#" class="btn btn-default mass_reconcile"><i class="fa fa-fw fa-check"></i> <span>{{ 'reconcile_selected'|_ }} (<i class="fa fa-spinner fa-spin"></i>)</span></a>#}
<a href="#" class="btn btn-danger mass_delete"><i class="fa fa-fw fa-trash"></i> <span>{{ 'delete'|_ }}</span></a>
</div>
@@ -64,5 +65,6 @@
</div>
<script type="text/javascript">
var edit_selected_txt = "{{ trans('firefly.edit')|escape('js') }}";
var edit_bulk_selected_txt = "{{ trans('firefly.mass_edit_bulk')|escape('js') }}";
var delete_selected_txt = "{{ trans('firefly.delete')|escape('js') }}";
</script>

View File

@@ -0,0 +1,65 @@
{% extends "./layout/default" %}
{% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, journals) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('transactions.mass.update-bulk') }}" accept-charset="UTF-8" class="form-horizontal" id="destroy">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
{% for journal in journals %}
{% if journal.transaction_count == 2 %}
<input type="hidden" name="journals[]" value="{{ journal.id }}"/>
{% endif %}
{% endfor %}
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mass_edit_bulk_journals'|_ }}</h3>
</div>
<div class="box-body">
<p>
{{ 'cannot_edit_other_fields'|_ }}
</p>
<table class="table table-striped table-condensed">
<tr>
<th class="col-lg-2 col-md-2 col-sm-2">{{ trans('list.category') }}</th>
<th class="col-lg-2 col-md-2 col-sm-2">{{ trans('list.tags') }}</th>
</tr>
<tr>
{# category #}
<td>
<input class="form-control input-sm" placeholder="" name="category" type="text" value="">
</td>
{# tags #}
<td>
<input class="form-control input-sm" placeholder="" name="tags" type="text" value="">
</td>
</tr>
</table>
</div>
<div class="box-footer">
{% if journals.count > 0 %}
<input type="submit" name="submit" value="{{ trans('form.update_all_journals') }}" class="btn btn-success pull-right"/>
{% endif %}
<a href="{{ route('index') }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
</div>
</div>
</div>
</div>
</form>
{% endblock %}
{% block scripts %}
<script type="text/javascript">
var what = "";
</script>
<script type="text/javascript" src="js/lib/bootstrap3-typeahead.min.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="js/lib/bootstrap-tagsinput.min.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="js/ff/transactions/mass/edit-bulk.js?v={{ FF_VERSION }}"></script>
{% endblock %}
{% block styles %}
<link href="css/bootstrap-tagsinput.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all">
{% endblock %}

View File

@@ -19,7 +19,6 @@
{{ 'cannot_edit_other_fields'|_ }}
</p>
<table class="table table-striped table-condensed">
<tr>
<tr>
<th class="">&nbsp;</th>
<th class="col-lg-2 col-md-2 col-sm-2">{{ trans('list.description') }}</th>