Skip to content

Firefly III: a personal finances manager

New preference for page size.

James Coleb097e2910449
diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php
index e84245a4d6..8a04819529 100644
--- a/app/Http/Controllers/PreferencesController.php
+++ b/app/Http/Controllers/PreferencesController.php
@@ -64,25 +64,26 @@ class PreferencesController extends Controller
*/
public function index(ARI $repository)
{
- $accounts = $repository->getAccounts(['Default account', 'Asset account']);
- $viewRangePref = Preferences::get('viewRange', '1M');
- $viewRange = $viewRangePref->data;
- $frontPageAccounts = Preferences::get('frontPageAccounts', []);
- $budgetMax = Preferences::get('budgetMaximum', 1000);
- $language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data;
- $budgetMaximum = $budgetMax->data;
- $customFiscalYear = Preferences::get('customFiscalYear', 0)->data;
- $fiscalYearStartStr = Preferences::get('fiscalYearStart', '01-01')->data;
- $fiscalYearStart = date('Y') . '-' . $fiscalYearStartStr;
- $is2faEnabled = Preferences::get('twoFactorAuthEnabled', 0)->data; // twoFactorAuthEnabled
- $has2faSecret = !is_null(Preferences::get('twoFactorAuthSecret')); // hasTwoFactorAuthSecret
- $showIncomplete = env('SHOW_INCOMPLETE_TRANSLATIONS', false) === true;
+ $accounts = $repository->getAccounts(['Default account', 'Asset account']);
+ $viewRangePref = Preferences::get('viewRange', '1M');
+ $viewRange = $viewRangePref->data;
+ $frontPageAccounts = Preferences::get('frontPageAccounts', []);
+ $budgetMax = Preferences::get('budgetMaximum', 1000);
+ $language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data;
+ $budgetMaximum = $budgetMax->data;
+ $transactionPageSize = Preferences::get('transactionPageSize', 50)->data;
+ $customFiscalYear = Preferences::get('customFiscalYear', 0)->data;
+ $fiscalYearStartStr = Preferences::get('fiscalYearStart', '01-01')->data;
+ $fiscalYearStart = date('Y') . '-' . $fiscalYearStartStr;
+ $is2faEnabled = Preferences::get('twoFactorAuthEnabled', 0)->data; // twoFactorAuthEnabled
+ $has2faSecret = !is_null(Preferences::get('twoFactorAuthSecret')); // hasTwoFactorAuthSecret
+ $showIncomplete = env('SHOW_INCOMPLETE_TRANSLATIONS', false) === true;
return view(
'preferences.index',
compact(
'budgetMaximum', 'language', 'accounts', 'frontPageAccounts',
- 'viewRange', 'customFiscalYear', 'fiscalYearStart', 'is2faEnabled',
+ 'viewRange', 'customFiscalYear', 'transactionPageSize', 'fiscalYearStart', 'is2faEnabled',
'has2faSecret', 'showIncomplete'
)
);
@@ -135,6 +136,14 @@ class PreferencesController extends Controller
Preferences::set('customFiscalYear', $customFiscalYear);
Preferences::set('fiscalYearStart', $fiscalYearStart);
+ // save page size:
+ $transactionPageSize = intval(Input::get('transactionPageSize'));
+ if($transactionPageSize > 0 && $transactionPageSize < 1337) {
+ Preferences::set('transactionPageSize', $transactionPageSize);
+ } else {
+ Preferences::set('transactionPageSize', 50);
+ }
+
// two factor auth
$twoFactorAuthEnabled = intval(Input::get('twoFactorAuthEnabled'));
$hasTwoFactorAuthSecret = !is_null(Preferences::get('twoFactorAuthSecret'));
diff --git a/resources/views/preferences/index.twig b/resources/views/preferences/index.twig
index a78117cacf..549a690594 100644
--- a/resources/views/preferences/index.twig
+++ b/resources/views/preferences/index.twig
@@ -42,7 +42,7 @@
<p class="text-info">
{{ 'pref_budget_settings_help'|_ }}
</p>
- {{ ExpandedForm.amount('budgetMaximum',budgetMaximum,{'label' : 'Budget maximum'}) }}
+ {{ ExpandedForm.amount('budgetMaximum',budgetMaximum,{'label' : 'budget_maximum'|_}) }}
</div>
</div>
<div class="box">
@@ -138,6 +138,21 @@
</div>
</div>
</div>
+
+ <!-- page size -->
+ <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
+ <div class="box">
+ <div class="box-header with-border">
+ <h3 class="box-title">{{ 'transaction_page_size_title'|_ }}</h3>
+ </div>
+ <div class="box-body">
+ <p class="text-info">{{ 'transaction_page_size_help'|_ }}</p>
+ {{ ExpandedForm.integer('transactionPageSize',transactionPageSize,{'label' : 'transaction_page_size_label'|_}) }}
+ </div>
+ </div>
+ </div>
+
+
<div class="col-lg-6 col-md-6 col-sm-6">
<div class="box">
<div class="box-header with-border">