mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-12 04:38:06 +00:00
New code by @vissert that allows category edit (see #282)
Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
@@ -192,7 +192,7 @@ class MassController extends Controller
|
|||||||
$destAccountName = $request->get('destination_account_name')[$journal->id] ?? '';
|
$destAccountName = $request->get('destination_account_name')[$journal->id] ?? '';
|
||||||
|
|
||||||
$budgetId = $journal->budgets->first() ? $journal->budgets->first()->id : 0;
|
$budgetId = $journal->budgets->first() ? $journal->budgets->first()->id : 0;
|
||||||
$category = $journal->categories->first() ? $journal->categories->first()->name : '';
|
$category = $request->get('category')[$journal->id];
|
||||||
$tags = $journal->tags->pluck('tag')->toArray();
|
$tags = $journal->tags->pluck('tag')->toArray();
|
||||||
|
|
||||||
// build data array
|
// build data array
|
||||||
|
|||||||
@@ -81,9 +81,13 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// also for multi input:
|
// also for multi input:
|
||||||
if ($('input[name="category[]"]').length > 0) {
|
if ($('input[name^="category["]').length > 0) {
|
||||||
$.getJSON('json/categories').done(function (data) {
|
$.getJSON('json/categories').done(function (data) {
|
||||||
$('input[name="category[]"]').typeahead({source: data});
|
$('input[name^="category["]').typeahead({source: data});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -20,12 +20,14 @@
|
|||||||
</p>
|
</p>
|
||||||
<table class="table table-striped table-condensed">
|
<table class="table table-striped table-condensed">
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width: 5%;"> </th>
|
<tr>
|
||||||
<th style="width: 20%;">{{ trans('list.description') }}</th>
|
<th class=""> </th>
|
||||||
<th style="width: 15%;">{{ trans('list.amount') }}</th>
|
<th class="col-lg-4 col-md-4 col-sm-4">{{ trans('list.description') }}</th>
|
||||||
<th style="width: 20%;">{{ trans('list.date') }}</th>
|
<th class="col-lg-1 col-md-1 col-sm-1">{{ trans('list.amount') }}</th>
|
||||||
<th style="width: 20%;">{{ trans('list.from') }}</th>
|
<th class="col-lg-1 col-md-1 col-sm-1">{{ trans('list.date') }}</th>
|
||||||
<th style="width: 20%;">{{ trans('list.to') }}</th>
|
<th class="col-lg-2 col-md-2 col-sm-2">{{ trans('list.from') }}</th>
|
||||||
|
<th class="col-lg-2 col-md-2 col-sm-2">{{ trans('list.to') }}</th>
|
||||||
|
<th class="col-lg-2 col-md-2 col-sm-2">{{ trans('list.category') }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for journal in journals %}
|
{% for journal in journals %}
|
||||||
{% if journal.transaction_count == 2 %}
|
{% if journal.transaction_count == 2 %}
|
||||||
@@ -76,7 +78,10 @@
|
|||||||
|
|
||||||
{{ Form.input('text', 'destination_account_name['~journal.id~']', journal.destination_account_name, {'class': 'form-control', 'placeholder': trans('form.expense_account')}) }}
|
{{ Form.input('text', 'destination_account_name['~journal.id~']', journal.destination_account_name, {'class': 'form-control', 'placeholder': trans('form.expense_account')}) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<!-- category -->
|
||||||
|
<td>
|
||||||
|
{{ Form.input('text', 'category['~journal.id~']', journal.categories[0].name, {'class': 'form-control', 'placeholder': trans('form.category')}) }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user