mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Basic tutorial for new users.
This commit is contained in:
parent
12743217a2
commit
193a1b0325
@ -53,6 +53,11 @@ class HomeController extends Controller
|
||||
|
||||
$types = Config::get('firefly.accountTypesByIdentifier.asset');
|
||||
$count = $repository->countAccounts($types);
|
||||
|
||||
if($count == 0) {
|
||||
return Redirect::route('new-user.index');
|
||||
}
|
||||
|
||||
$title = 'Firefly';
|
||||
$subTitle = trans('firefly.welcomeBack');
|
||||
$mainTitleIcon = 'fa-fire';
|
||||
|
119
app/Http/Controllers/NewUserController.php
Normal file
119
app/Http/Controllers/NewUserController.php
Normal file
@ -0,0 +1,119 @@
|
||||
<?php namespace FireflyIII\Http\Controllers;
|
||||
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use Config;
|
||||
use FireflyIII\Http\Requests\NewUserFormRequest;
|
||||
use FireflyIII\Models\AccountMeta;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use Redirect;
|
||||
use Session;
|
||||
use View;
|
||||
|
||||
/**
|
||||
* Class NewUserController
|
||||
*
|
||||
* @package FireflyIII\Http\Controllers
|
||||
*/
|
||||
class NewUserController extends Controller
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @param AccountRepositoryInterface $repository
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function index(AccountRepositoryInterface $repository)
|
||||
{
|
||||
View::share('title', 'Welcome to Firefly!');
|
||||
View::share('mainTitleIcon', 'fa-fire');
|
||||
|
||||
|
||||
$types = Config::get('firefly.accountTypesByIdentifier.asset');
|
||||
$count = $repository->countAccounts($types);
|
||||
|
||||
if ($count > 0) {
|
||||
return Redirect::route('index');
|
||||
|
||||
}
|
||||
|
||||
return view('new-user.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param NewUserFormRequest $request
|
||||
* @param AccountRepositoryInterface $repository
|
||||
*/
|
||||
public function submit(NewUserFormRequest $request, AccountRepositoryInterface $repository)
|
||||
{
|
||||
|
||||
// create normal asset account:
|
||||
$assetAccount = [
|
||||
'name' => $request->get('bank_name'),
|
||||
'accountType' => 'asset',
|
||||
'virtualBalance' => 0,
|
||||
'active' => true,
|
||||
'user' => Auth::user()->id,
|
||||
'accountRole' => 'defaultAsset',
|
||||
'openingBalance' => floatval($request->input('bank_balance')),
|
||||
'openingBalanceDate' => new Carbon,
|
||||
'openingBalanceCurrency' => intval($request->input('balance_currency_id')),
|
||||
];
|
||||
|
||||
$repository->store($assetAccount);
|
||||
|
||||
// create savings account
|
||||
if (strlen($request->get('savings_balance') > 0)) {
|
||||
$savingsAccount = [
|
||||
'name' => $request->get('bank_name') . ' savings account',
|
||||
'accountType' => 'asset',
|
||||
'virtualBalance' => 0,
|
||||
'active' => true,
|
||||
'user' => Auth::user()->id,
|
||||
'accountRole' => 'savingAsset',
|
||||
'openingBalance' => floatval($request->input('savings_balance')),
|
||||
'openingBalanceDate' => new Carbon,
|
||||
'openingBalanceCurrency' => intval($request->input('balance_currency_id')),
|
||||
];
|
||||
$repository->store($savingsAccount);
|
||||
}
|
||||
|
||||
|
||||
// create credit card.
|
||||
if (strlen($request->get('credit_card_limit') > 0)) {
|
||||
$creditAccount = [
|
||||
'name' => 'Credit card',
|
||||
'accountType' => 'asset',
|
||||
'virtualBalance' => floatval($request->get('credit_card_limit')),
|
||||
'active' => true,
|
||||
'user' => Auth::user()->id,
|
||||
'accountRole' => 'ccAsset',
|
||||
'openingBalance' => null,
|
||||
'openingBalanceDate' => null,
|
||||
'openingBalanceCurrency' => intval($request->input('balance_currency_id')),
|
||||
];
|
||||
$creditCard = $repository->store($creditAccount);
|
||||
|
||||
// store meta for CC:
|
||||
AccountMeta::create(
|
||||
[
|
||||
'name' => 'ccType',
|
||||
'data' => 'monthlyFull',
|
||||
'account_id' => $creditCard->id,
|
||||
]
|
||||
);
|
||||
AccountMeta::create(
|
||||
[
|
||||
'name' => 'ccMonthlyPaymentDate',
|
||||
'data' => Carbon::now()->year.'-01-01',
|
||||
'account_id' => $creditCard->id,
|
||||
]
|
||||
);
|
||||
|
||||
}
|
||||
Session::flash('success', 'New account(s) created!');
|
||||
|
||||
return Redirect::route('home');
|
||||
}
|
||||
}
|
37
app/Http/Requests/NewUserFormRequest.php
Normal file
37
app/Http/Requests/NewUserFormRequest.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace FireflyIII\Http\Requests;
|
||||
|
||||
use Auth;
|
||||
|
||||
/**
|
||||
* Class NewUserFormRequest
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @package FireflyIII\Http\Requests
|
||||
*/
|
||||
class NewUserFormRequest extends Request
|
||||
{
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
// Only allow logged in users
|
||||
return Auth::check();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'bank_name' => 'required|between:1,200',
|
||||
'bank_balance' => 'required|numeric',
|
||||
'savings_balance' => 'numeric',
|
||||
'credit_card_limit' => 'numeric',
|
||||
'balance_currency_id' => 'exists:transaction_currencies,id',
|
||||
];
|
||||
}
|
||||
}
|
@ -15,13 +15,13 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
// models
|
||||
Route::bind(
|
||||
'account',
|
||||
function($value) {
|
||||
function ($value) {
|
||||
if (Auth::check()) {
|
||||
$object = Account::leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')
|
||||
->where('account_types.editable', 1)
|
||||
->where('accounts.id', $value)
|
||||
->where('user_id', Auth::user()->id)
|
||||
->first(['accounts.*']);
|
||||
->where('account_types.editable', 1)
|
||||
->where('accounts.id', $value)
|
||||
->where('user_id', Auth::user()->id)
|
||||
->first(['accounts.*']);
|
||||
if ($object) {
|
||||
return $object;
|
||||
}
|
||||
@ -31,7 +31,7 @@ Route::bind(
|
||||
);
|
||||
|
||||
Route::bind(
|
||||
'tj', function($value) {
|
||||
'tj', function ($value) {
|
||||
if (Auth::check()) {
|
||||
$object = TransactionJournal::where('id', $value)->where('user_id', Auth::user()->id)->first();
|
||||
if ($object) {
|
||||
@ -44,7 +44,7 @@ Route::bind(
|
||||
);
|
||||
|
||||
Route::bind(
|
||||
'currency', function($value) {
|
||||
'currency', function ($value) {
|
||||
if (Auth::check()) {
|
||||
$object = TransactionCurrency::find($value);
|
||||
if ($object) {
|
||||
@ -56,7 +56,7 @@ Route::bind(
|
||||
);
|
||||
|
||||
Route::bind(
|
||||
'bill', function($value) {
|
||||
'bill', function ($value) {
|
||||
if (Auth::check()) {
|
||||
$object = Bill::where('id', $value)->where('user_id', Auth::user()->id)->first();
|
||||
if ($object) {
|
||||
@ -69,7 +69,7 @@ Route::bind(
|
||||
);
|
||||
|
||||
Route::bind(
|
||||
'budget', function($value) {
|
||||
'budget', function ($value) {
|
||||
if (Auth::check()) {
|
||||
$object = Budget::where('id', $value)->where('user_id', Auth::user()->id)->first();
|
||||
if ($object) {
|
||||
@ -82,7 +82,7 @@ Route::bind(
|
||||
);
|
||||
|
||||
Route::bind(
|
||||
'reminder', function($value) {
|
||||
'reminder', function ($value) {
|
||||
if (Auth::check()) {
|
||||
$object = Reminder::where('id', $value)->where('user_id', Auth::user()->id)->first();
|
||||
if ($object) {
|
||||
@ -95,13 +95,13 @@ Route::bind(
|
||||
);
|
||||
|
||||
Route::bind(
|
||||
'limitrepetition', function($value) {
|
||||
'limitrepetition', function ($value) {
|
||||
if (Auth::check()) {
|
||||
$object = LimitRepetition::where('limit_repetitions.id', $value)
|
||||
->leftjoin('budget_limits', 'budget_limits.id', '=', 'limit_repetitions.budget_limit_id')
|
||||
->leftJoin('budgets', 'budgets.id', '=', 'budget_limits.budget_id')
|
||||
->where('budgets.user_id', Auth::user()->id)
|
||||
->first(['limit_repetitions.*']);
|
||||
->leftjoin('budget_limits', 'budget_limits.id', '=', 'limit_repetitions.budget_limit_id')
|
||||
->leftJoin('budgets', 'budgets.id', '=', 'budget_limits.budget_id')
|
||||
->where('budgets.user_id', Auth::user()->id)
|
||||
->first(['limit_repetitions.*']);
|
||||
if ($object) {
|
||||
return $object;
|
||||
}
|
||||
@ -112,12 +112,12 @@ Route::bind(
|
||||
);
|
||||
|
||||
Route::bind(
|
||||
'piggyBank', function($value) {
|
||||
'piggyBank', function ($value) {
|
||||
if (Auth::check()) {
|
||||
$object = PiggyBank::where('piggy_banks.id', $value)
|
||||
->leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id')
|
||||
->where('accounts.user_id', Auth::user()->id)
|
||||
->first(['piggy_banks.*']);
|
||||
->leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id')
|
||||
->where('accounts.user_id', Auth::user()->id)
|
||||
->first(['piggy_banks.*']);
|
||||
if ($object) {
|
||||
return $object;
|
||||
}
|
||||
@ -128,7 +128,7 @@ Route::bind(
|
||||
);
|
||||
|
||||
Route::bind(
|
||||
'category', function($value) {
|
||||
'category', function ($value) {
|
||||
if (Auth::check()) {
|
||||
$object = Category::where('id', $value)->where('user_id', Auth::user()->id)->first();
|
||||
if ($object) {
|
||||
@ -142,7 +142,7 @@ Route::bind(
|
||||
|
||||
/** @noinspection PhpUnusedParameterInspection */
|
||||
Route::bind(
|
||||
'reminder', function($value) {
|
||||
'reminder', function ($value) {
|
||||
if (Auth::check()) {
|
||||
/** @var \FireflyIII\Models\Reminder $object */
|
||||
$object = Reminder::find($value);
|
||||
@ -158,7 +158,7 @@ Route::bind(
|
||||
);
|
||||
|
||||
Route::bind(
|
||||
'tag', function($value) {
|
||||
'tag', function ($value) {
|
||||
if (Auth::check()) {
|
||||
$object = Tag::where('id', $value)->where('user_id', Auth::user()->id)->first();
|
||||
if ($object) {
|
||||
@ -189,7 +189,7 @@ Route::get('/routes', ['uses' => 'HomeController@routes', 'as' => 'routes']);
|
||||
* Home Controller
|
||||
*/
|
||||
Route::group(
|
||||
['middleware' => ['auth', 'range', 'reminders']], function() {
|
||||
['middleware' => ['auth', 'range', 'reminders']], function () {
|
||||
Route::get('/', ['uses' => 'HomeController@index', 'as' => 'index', 'middleware' => 'cleanup']);
|
||||
Route::get('/home', ['uses' => 'HomeController@index', 'as' => 'home']);
|
||||
Route::post('/daterange', ['uses' => 'HomeController@dateRange', 'as' => 'daterange']);
|
||||
@ -317,6 +317,12 @@ Route::group(
|
||||
Route::get('/json/box/bills-paid', ['uses' => 'JsonController@boxBillsPaid', 'as' => 'json.box.unpaid']);
|
||||
Route::get('/json/transaction-journals/{what}', 'JsonController@transactionJournals');
|
||||
|
||||
/**
|
||||
* New user Controller
|
||||
*/
|
||||
Route::get('/new-user', ['uses' => 'NewUserController@index', 'as' => 'new-user.index']);
|
||||
Route::post('/new-user/submit', ['uses' => 'NewUserController@submit', 'as' => 'new-user.submit']);
|
||||
|
||||
/**
|
||||
* Piggy Bank Controller
|
||||
*/
|
||||
|
@ -64,7 +64,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
public function getAccounts(array $types)
|
||||
{
|
||||
$result = Auth::user()->accounts()->with(
|
||||
['accountmeta' => function(HasMany $query) {
|
||||
['accountmeta' => function (HasMany $query) {
|
||||
$query->where('name', 'accountRole');
|
||||
}]
|
||||
)->accountTypeIn($types)->orderBy('accounts.name', 'ASC')->get(['accounts.*'])->sortBy('name');
|
||||
@ -79,15 +79,15 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
public function getCreditCards()
|
||||
{
|
||||
return Auth::user()->accounts()
|
||||
->hasMetaValue('accountRole', 'ccAsset')
|
||||
->hasMetaValue('ccType', 'monthlyFull')
|
||||
->get(
|
||||
[
|
||||
'accounts.*',
|
||||
'ccType.data as ccType',
|
||||
'accountRole.data as accountRole'
|
||||
]
|
||||
);
|
||||
->hasMetaValue('accountRole', 'ccAsset')
|
||||
->hasMetaValue('ccType', 'monthlyFull')
|
||||
->get(
|
||||
[
|
||||
'accounts.*',
|
||||
'ccType.data as ccType',
|
||||
'accountRole.data as accountRole'
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -132,18 +132,18 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
public function getFrontpageTransactions(Account $account, Carbon $start, Carbon $end)
|
||||
{
|
||||
return Auth::user()
|
||||
->transactionjournals()
|
||||
->with(['transactions'])
|
||||
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')->where('accounts.id', $account->id)
|
||||
->leftJoin('transaction_currencies', 'transaction_currencies.id', '=', 'transaction_journals.transaction_currency_id')
|
||||
->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
||||
->before($end)
|
||||
->after($start)
|
||||
->orderBy('transaction_journals.date', 'DESC')
|
||||
->orderBy('transaction_journals.id', 'DESC')
|
||||
->take(10)
|
||||
->get(['transaction_journals.*', 'transaction_currencies.symbol', 'transaction_types.type']);
|
||||
->transactionjournals()
|
||||
->with(['transactions'])
|
||||
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')->where('accounts.id', $account->id)
|
||||
->leftJoin('transaction_currencies', 'transaction_currencies.id', '=', 'transaction_journals.transaction_currency_id')
|
||||
->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
||||
->before($end)
|
||||
->after($start)
|
||||
->orderBy('transaction_journals.date', 'DESC')
|
||||
->orderBy('transaction_journals.id', 'DESC')
|
||||
->take(10)
|
||||
->get(['transaction_journals.*', 'transaction_currencies.symbol', 'transaction_types.type']);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -156,13 +156,13 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
{
|
||||
$offset = ($page - 1) * 50;
|
||||
$query = Auth::user()
|
||||
->transactionJournals()
|
||||
->withRelevantData()
|
||||
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
->where('transactions.account_id', $account->id)
|
||||
->orderBy('transaction_journals.date', 'DESC')
|
||||
->orderBy('transaction_journals.order', 'ASC')
|
||||
->orderBy('transaction_journals.id', 'DESC');
|
||||
->transactionJournals()
|
||||
->withRelevantData()
|
||||
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
->where('transactions.account_id', $account->id)
|
||||
->orderBy('transaction_journals.date', 'DESC')
|
||||
->orderBy('transaction_journals.order', 'ASC')
|
||||
->orderBy('transaction_journals.id', 'DESC');
|
||||
|
||||
$count = $query->count();
|
||||
$set = $query->take(50)->offset($offset)->get(['transaction_journals.*']);
|
||||
@ -213,7 +213,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
}
|
||||
|
||||
$accounts->each(
|
||||
function(Account $account) use ($start, $end) {
|
||||
function (Account $account) use ($start, $end) {
|
||||
$account->startBalance = Steam::balance($account, $start, true);
|
||||
$account->endBalance = Steam::balance($account, $end, true);
|
||||
$account->piggyBalance = 0;
|
||||
@ -251,7 +251,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
$end = clone Session::get('end', new Carbon);
|
||||
|
||||
$accounts->each(
|
||||
function(Account $account) use ($start, $end) {
|
||||
function (Account $account) use ($start, $end) {
|
||||
$account->startBalance = Steam::balance($account, $start);
|
||||
$account->endBalance = Steam::balance($account, $end);
|
||||
|
||||
@ -289,25 +289,26 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
*/
|
||||
public function getTransfersInRange(Account $account, Carbon $start, Carbon $end)
|
||||
{
|
||||
$set = TransactionJournal::whereIn(
|
||||
'id', function(Builder $q) use ($account, $start, $end) {
|
||||
$set = TransactionJournal::whereIn(
|
||||
'id', function (Builder $q) use ($account, $start, $end) {
|
||||
$q->select('transaction_journals.id')
|
||||
->from('transactions')
|
||||
->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
|
||||
->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
||||
->where('transactions.account_id', $account->id)
|
||||
->where('transaction_journals.user_id', Auth::user()->id)
|
||||
->where('transaction_journals.date', '>=', $start->format('Y-m-d'))
|
||||
->where('transaction_journals.date', '<=', $end->format('Y-m-d'))
|
||||
->where('transaction_types.type', 'Transfer');
|
||||
->from('transactions')
|
||||
->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
|
||||
->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
||||
->where('transactions.account_id', $account->id)
|
||||
->where('transaction_journals.user_id', Auth::user()->id)
|
||||
->where('transaction_journals.date', '>=', $start->format('Y-m-d'))
|
||||
->where('transaction_journals.date', '<=', $end->format('Y-m-d'))
|
||||
->where('transaction_types.type', 'Transfer');
|
||||
|
||||
}
|
||||
)->get();
|
||||
$filtered = $set->filter(
|
||||
function(TransactionJournal $journal) use ($account) {
|
||||
function (TransactionJournal $journal) use ($account) {
|
||||
if ($journal->destination_account->id == $account->id) {
|
||||
return $journal;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
);
|
||||
@ -342,9 +343,9 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
public function openingBalanceTransaction(Account $account)
|
||||
{
|
||||
return TransactionJournal::accountIs($account)
|
||||
->orderBy('transaction_journals.date', 'ASC')
|
||||
->orderBy('created_at', 'ASC')
|
||||
->first(['transaction_journals.*']);
|
||||
->orderBy('transaction_journals.date', 'ASC')
|
||||
->orderBy('created_at', 'ASC')
|
||||
->first(['transaction_journals.*']);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -364,11 +365,11 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
$opposingData = [
|
||||
'user' => $data['user'],
|
||||
'accountType' => $type,
|
||||
'virtual_balance' => $data['virtualBalance'],
|
||||
'virtualBalance' => 0,
|
||||
'name' => $data['name'] . ' initial balance',
|
||||
'active' => false,
|
||||
];
|
||||
$opposing = $this->storeAccount($opposingData);
|
||||
$opposing = $this->storeAccount($opposingData);
|
||||
$this->storeInitialBalance($newAccount, $opposing, $data);
|
||||
|
||||
}
|
||||
@ -418,7 +419,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
'name' => $data['name'] . ' initial balance',
|
||||
'active' => false,
|
||||
];
|
||||
$opposing = $this->storeAccount($opposingData);
|
||||
$opposing = $this->storeAccount($opposingData);
|
||||
$this->storeInitialBalance($account, $opposing, $data);
|
||||
}
|
||||
|
||||
@ -445,15 +446,17 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
'user_id' => $data['user'],
|
||||
'account_type_id' => $accountType->id,
|
||||
'name' => $data['name'],
|
||||
'virtual_balance' => $data['virtualBalance'],
|
||||
'active' => $data['active'] === true ? true : false,
|
||||
]
|
||||
);
|
||||
|
||||
if (!$newAccount->isValid()) {
|
||||
// does the account already exist?
|
||||
$searchData = [
|
||||
$searchData = [
|
||||
'user_id' => $data['user'],
|
||||
'account_type_id' => $accountType->id,
|
||||
'virtual_balance' => $data['virtualBalance'],
|
||||
'name' => $data['name']
|
||||
];
|
||||
$existingAccount = Account::firstOrNullEncrypted($searchData);
|
||||
|
@ -18,6 +18,13 @@ return [
|
||||
'showEverything' => 'Show everything',
|
||||
'never' => 'Never',
|
||||
|
||||
// new user:
|
||||
'submit' => 'Submit',
|
||||
'getting_started' => 'Getting started',
|
||||
'to_get_started' => 'To get started with Firefly, please enter your current bank\'s name, and the balance of your checking account:',
|
||||
'savings_balance_text' => 'If you have a savings account, please enter the current balance of your savings account:',
|
||||
'cc_balance_text' => 'If you have a credit card, please enter your credit card\'s limit.',
|
||||
|
||||
// forms:
|
||||
'mandatoryFields' => 'Mandatory fields',
|
||||
'optionalFields' => 'Optional fields',
|
||||
|
@ -1,5 +1,12 @@
|
||||
<?php
|
||||
return [
|
||||
|
||||
// new user:
|
||||
'bank_name' => 'Bank name',
|
||||
'bank_balance' => 'Balance',
|
||||
'savings_balance' => 'Savings balance',
|
||||
'credit_card_limit' => 'Credit card limit',
|
||||
|
||||
'name' => 'Name',
|
||||
'active' => 'Active',
|
||||
'amount_min' => 'Minimum amount',
|
||||
|
@ -18,6 +18,13 @@ return [
|
||||
'showEverything' => 'Laat alles zien',
|
||||
'never' => 'Nooit',
|
||||
|
||||
// new user:
|
||||
'submit' => 'Invoeren',
|
||||
'getting_started' => 'Aan de start!',
|
||||
'to_get_started' => 'Begin met de naam van de bank waar je je betaalrekening hebt, en het saldo van die rekening.',
|
||||
'savings_balance_text' => 'Voer ook het saldo van je spaarrekening in, als je die hebt.',
|
||||
'cc_balance_text' => 'Als je een credit card hebt, vul dan hier je credit cardlimiet in.',
|
||||
|
||||
// forms:
|
||||
'mandatoryFields' => 'Verplichte velden',
|
||||
'optionalFields' => 'Optionele velden',
|
||||
|
@ -1,5 +1,12 @@
|
||||
<?php
|
||||
return [
|
||||
|
||||
// new user:
|
||||
'bank_name' => 'Banknaam',
|
||||
'bank_balance' => 'Saldo',
|
||||
'savings_balance' => 'Saldo van spaarrekening',
|
||||
'credit_card_limit' => 'Credit card limiet',
|
||||
|
||||
'name' => 'Naam',
|
||||
'active' => 'Actief',
|
||||
'amount_min' => 'Minimumbedrag',
|
||||
|
@ -2,25 +2,7 @@
|
||||
{% block content %}
|
||||
{{ Breadcrumbs.renderIfExists }}
|
||||
|
||||
{% if count == 0 %}
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<p class="lead">{{ 'welcome'|_ }}</p>
|
||||
|
||||
<p>
|
||||
{{ 'createNewAsset'|_ }}
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
<h2><a href="{{route('accounts.create','asset')}}">{{ 'createNewAssetButton'|_ }}</a></h2>
|
||||
</div>
|
||||
{% else %}
|
||||
<!-- Language test: {{ 'test'|_ }} -->
|
||||
<!-- fancy new boxes -->
|
||||
{% include 'partials/boxes.twig' %}
|
||||
{% include 'partials/boxes.twig' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-md-12 col-sm-12">
|
||||
@ -200,8 +182,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
|
45
resources/twig/new-user/index.twig
Normal file
45
resources/twig/new-user/index.twig
Normal file
@ -0,0 +1,45 @@
|
||||
{% extends "./layout/default.twig" %}
|
||||
{% block content %}
|
||||
{{ Breadcrumbs.renderIfExists }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-sm-8 col-xs-12">
|
||||
<h3>{{ 'getting_started'|_ }}</h3>
|
||||
<p>
|
||||
{{ 'to_get_started'|_ }}
|
||||
</p>
|
||||
<form action="{{ route('new-user.submit') }}" method="post" id="store" class="form-horizontal">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
{{ ExpandedForm.text('bank_name')}}
|
||||
{{ ExpandedForm.balance('bank_balance')}}
|
||||
|
||||
<p>
|
||||
{{ 'savings_balance_text'|_ }}
|
||||
</p>
|
||||
|
||||
{{ ExpandedForm.balance('savings_balance') }}
|
||||
|
||||
<p>
|
||||
{{ 'cc_balance_text'|_ }}
|
||||
|
||||
</p>
|
||||
|
||||
{{ ExpandedForm.balance('credit_card_limit') }}
|
||||
|
||||
<p>
|
||||
<input type="submit" name="submit" value="{{ 'submit'|_ }}" class="bt btn-success btn-lg" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<!-- load the libraries and scripts necessary for Google Charts: -->
|
||||
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
|
||||
<script type="text/javascript" src="js/gcharts.options.js"></script>
|
||||
<script type="text/javascript" src="js/gcharts.js"></script>
|
||||
<script type="text/javascript" src="js/index.js"></script>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user