From 021d0e6359d64abdce33e0ca75c21adb3dd34030 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 16 Jul 2017 18:14:29 +0200 Subject: [PATCH] More stuff for intro texts. --- app/Http/Controllers/Controller.php | 1 + app/Http/Controllers/Json/IntroController.php | 9 ++++--- config/intro.php | 24 +++++++++++++------ resources/lang/en_US/intro.php | 19 ++++++++++----- resources/views/rules/index.twig | 10 ++++---- 5 files changed, 42 insertions(+), 21 deletions(-) diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 7a4f5ccfbe..73755b1a61 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -68,6 +68,7 @@ class Controller extends BaseController // get shown-intro-preference: if (auth()->check()) { $route = Route::currentRouteName(); + $route = str_replace('.', '_', $route); $key = 'shown_demo_' . $route; $config = config('intro.' . $route); $shownDemo = Preferences::get($key, false)->data; diff --git a/app/Http/Controllers/Json/IntroController.php b/app/Http/Controllers/Json/IntroController.php index 6b448d6f38..e6f3104a31 100644 --- a/app/Http/Controllers/Json/IntroController.php +++ b/app/Http/Controllers/Json/IntroController.php @@ -11,7 +11,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; -use Preferences; use Response; /** @@ -29,6 +28,7 @@ class IntroController */ public function getIntroSteps(string $route) { + $route = str_replace('.', '_', $route); $elements = config(sprintf('intro.%s', $route)); $steps = []; if (is_array($elements) && count($elements) > 0) { @@ -37,12 +37,14 @@ class IntroController // point to HTML element when not an intro or outro: if (!in_array($key, ['intro', 'outro'])) { - $currentStep['element'] = '#' . $key; + $currentStep['element'] = $options['selector']; } // get the text: $currentStep['intro'] = trans('intro.' . $route . '_' . $key); + + // save in array: $steps[] = $currentStep; } @@ -59,7 +61,8 @@ class IntroController public function postFinished(string $route) { $key = 'shown_demo_' . $route; - Preferences::set($key, true); + + // Preferences::set($key, true); return Response::json(['result' => sprintf('Reported demo watched for route "%s".', $route)]); } diff --git a/config/intro.php b/config/intro.php index 8bb0bc1301..90c6a517b0 100644 --- a/config/intro.php +++ b/config/intro.php @@ -14,12 +14,22 @@ declare(strict_types=1); */ return [ - 'index' => [ - 'intro' => [], - 'accounts-chart' => [], - 'box_out_holder' => [], - 'all_transactions' => ['position' => 'left'], - 'help' => ['position' => 'bottom'], - 'outro' => [], + 'index' => [ + 'intro' => [], + 'accounts-chart' => ['selector' => '#accounts-chart'], + 'box_out_holder' => ['selector' => '#box_out_holder'], + 'help' => ['selector' => '#help', 'position' => 'bottom'], + 'sidebar-toggle' => ['selector' => '#sidebar-toggle', 'position' => 'bottom'], + 'outro' => [], + ], + 'rules_index' => [ + 'intro' => [], + 'new_rule_group' => ['selector' => '#new_rule_group'], + 'new_rule' => ['selector' => '.new_rule'], + 'prio_buttons' => ['selector' => '.prio_buttons'], + 'test_buttons' => ['selector' => '.test_buttons'], + 'rule-triggers' => ['selector' => '.rule-triggers'], + 'outro' => [], + ], ]; \ No newline at end of file diff --git a/resources/lang/en_US/intro.php b/resources/lang/en_US/intro.php index fce1d669de..c245d815d1 100644 --- a/resources/lang/en_US/intro.php +++ b/resources/lang/en_US/intro.php @@ -8,11 +8,18 @@ */ return [ - 'index_intro' => 'Welcome to the index page of Firefly III. Please take the time to walk through this intro to get a feeling of how Firefly III works.', - 'index_accounts-chart' => 'This chart shows the current balance of your asset accounts. You can select the accounts visible here in your preferences.', - 'index_box_out_holder' => 'This little box and the boxes next to this one will give you a quick overview of your financial situation', - 'index_all_transactions' => 'These boxes will hold your most recent transactions.', - 'index_help' => 'If you ever need help with a page or a form, press this button.', - 'index_outro' => 'Most pages of Firefly III will start with a little tour like this one. Please contact me when you have questions or comments. Enjoy!', + 'index_intro' => 'Welcome to the index page of Firefly III. Please take the time to walk through this intro to get a feeling of how Firefly III works.', + 'index_accounts-chart' => 'This chart shows the current balance of your asset accounts. You can select the accounts visible here in your preferences.', + 'index_box_out_holder' => 'This little box and the boxes next to this one will give you a quick overview of your financial situation', + 'index_help' => 'If you ever need help with a page or a form, press this button.', + 'index_outro' => 'Most pages of Firefly III will start with a little tour like this one. Please contact me when you have questions or comments. Enjoy!', + 'index_sidebar-toggle' => 'To create new transactions, accounts or other things, use the menu under this icon.', + 'rules_index_intro' => 'Firefly III allows you to manage rules, that will automagically be applied to any transaction you create or edit.', + 'rules_index_new_rule_group' => 'You can combine rules in groups for easier management.', + 'rules_index_new_rule' => 'Create as many rules as you like.', + 'rules_index_prio_buttons' => 'Order them any way you see fit.', + 'rules_index_test_buttons' => 'You can test your rules or apply them to existing transactions.', + 'rules_index_rule-triggers' => 'Rules have "triggers" and "actions" that you can order by drag-and-drop.', + 'rules_index_outro' => 'Be sure to check out the help pages using the (?) icon in the top right!', ]; \ No newline at end of file diff --git a/resources/views/rules/index.twig b/resources/views/rules/index.twig index a66d291105..00ac53009d 100644 --- a/resources/views/rules/index.twig +++ b/resources/views/rules/index.twig @@ -7,7 +7,7 @@
@@ -71,7 +71,7 @@ {% for rule in ruleGroup.rules %} -
+
{% if rule.order > 1 %} -
+
@@ -105,7 +105,7 @@
-
+
{# show which transactions would match #} @@ -184,7 +184,7 @@


{{ 'new_rule'|_ }} + class="btn btn-success new_rule">{{ 'new_rule'|_ }}