Some small optimisations.

This commit is contained in:
James Cole 2017-02-18 09:32:10 +01:00
parent f7642beb7c
commit f0cb63fd48
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
4 changed files with 5 additions and 11 deletions

View File

@ -58,7 +58,8 @@ class HelpController extends Controller
return Response::json($content); return Response::json($content);
} }
$content = $help->getFromGithub($language, $route); $content = $help->getFromGithub($language, $route);
$notYourLanguage = '<p><em>' . strval(trans('firefly.help_may_not_be_your_language')) . '</em></p>';
// get backup language content (try English): // get backup language content (try English):
if (strlen($content) === 0) { if (strlen($content) === 0) {
@ -68,12 +69,11 @@ class HelpController extends Controller
$content = $help->getFromCache($route, $language); $content = $help->getFromCache($route, $language);
} }
if (!$help->inCache($route, $language)) { if (!$help->inCache($route, $language)) {
$content = $help->getFromGithub($language, $route); $content = trim($notYourLanguage . $help->getFromGithub($language, $route));
$content = '<p><em>' . strval(trans('firefly.help_may_not_be_your_language')) . '</em></p>' . $content;
} }
} }
if (strlen($content) === 0) { if ($content === $notYourLanguage) {
$content = '<p>' . strval(trans('firefly.route_has_no_help')) . '</p>'; $content = '<p>' . strval(trans('firefly.route_has_no_help')) . '</p>';
} }

View File

@ -21,8 +21,6 @@ class AccountTypeSeeder extends Seeder
{ {
public function run() public function run()
{ {
DB::table('account_types')->delete();
AccountType::create(['type' => 'Default account']); AccountType::create(['type' => 'Default account']);
AccountType::create(['type' => 'Cash account']); AccountType::create(['type' => 'Cash account']);
AccountType::create(['type' => 'Asset account']); AccountType::create(['type' => 'Asset account']);
@ -31,6 +29,7 @@ class AccountTypeSeeder extends Seeder
AccountType::create(['type' => 'Initial balance account']); AccountType::create(['type' => 'Initial balance account']);
AccountType::create(['type' => 'Beneficiary account']); AccountType::create(['type' => 'Beneficiary account']);
AccountType::create(['type' => 'Import account']); AccountType::create(['type' => 'Import account']);
AccountType::create(['type' => 'Loan']);
} }

View File

@ -21,8 +21,6 @@ class TransactionCurrencySeeder extends Seeder
{ {
public function run() public function run()
{ {
DB::table('transaction_currencies')->delete();
TransactionCurrency::create(['code' => 'EUR', 'name' => 'Euro', 'symbol' => '€', 'decimal_places' => 2]); TransactionCurrency::create(['code' => 'EUR', 'name' => 'Euro', 'symbol' => '€', 'decimal_places' => 2]);
TransactionCurrency::create(['code' => 'USD', 'name' => 'US Dollar', 'symbol' => '$', 'decimal_places' => 2]); TransactionCurrency::create(['code' => 'USD', 'name' => 'US Dollar', 'symbol' => '$', 'decimal_places' => 2]);
TransactionCurrency::create(['code' => 'HUF', 'name' => 'Hungarian forint', 'symbol' => 'Ft', 'decimal_places' => 2]); TransactionCurrency::create(['code' => 'HUF', 'name' => 'Hungarian forint', 'symbol' => 'Ft', 'decimal_places' => 2]);

View File

@ -21,9 +21,6 @@ class TransactionTypeSeeder extends Seeder
{ {
public function run() public function run()
{ {
DB::table('transaction_types')->delete();
TransactionType::create(['type' => TransactionType::WITHDRAWAL]); TransactionType::create(['type' => TransactionType::WITHDRAWAL]);
TransactionType::create(['type' => TransactionType::DEPOSIT]); TransactionType::create(['type' => TransactionType::DEPOSIT]);
TransactionType::create(['type' => TransactionType::TRANSFER]); TransactionType::create(['type' => TransactionType::TRANSFER]);