Merge branch 'feature/expand-transaction-view' into develop

This commit is contained in:
Sander Dorigo 2014-10-11 09:54:33 +02:00
commit d40645be68
2 changed files with 53 additions and 44 deletions

View File

@ -173,6 +173,7 @@ class Json implements JsonInterface
$to = $entry->transactions[1]->account;
$budget = $entry->budgets()->first();
$category = $entry->categories()->first();
$recurring = $entry->recurringTransaction()->first();
$arr = [
'date' => $entry->date->format('j F Y'),
'description' => [
@ -205,6 +206,11 @@ class Json implements JsonInterface
$arr['components']['category_name'] = $category->name;
$arr['components']['category_url'] = route('categories.show', $category->id);
}
if ($recurring) {
$arr['components']['recurring_id'] = $recurring->id;
$arr['components']['recurring_name'] = e($recurring->name);
$arr['components']['recurring_url'] = route('recurring.show', $recurring->id);
}
$data['data'][] = $arr;

View File

@ -95,6 +95,9 @@ $(document).ready(function () {
if (data.category_id > 0) {
html += '<a href="' + data.category_url + '" title="' + data.category_name + '"><i class="fa fa-bar-chart fa-fw"></i></a> ';
}
if(data.recurring_id > 0) {
html += '<a href="' + data.recurring_url + '" title="' + data.recurring_name + '"><i class="fa fa-rotate-right fa-fw"></i></a> ';
}
return html;
}
},