More stuff for intro texts.

This commit is contained in:
James Cole
2017-07-16 18:14:29 +02:00
parent 7f4fd2c52f
commit 021d0e6359
5 changed files with 42 additions and 21 deletions

View File

@@ -68,6 +68,7 @@ class Controller extends BaseController
// get shown-intro-preference: // get shown-intro-preference:
if (auth()->check()) { if (auth()->check()) {
$route = Route::currentRouteName(); $route = Route::currentRouteName();
$route = str_replace('.', '_', $route);
$key = 'shown_demo_' . $route; $key = 'shown_demo_' . $route;
$config = config('intro.' . $route); $config = config('intro.' . $route);
$shownDemo = Preferences::get($key, false)->data; $shownDemo = Preferences::get($key, false)->data;

View File

@@ -11,7 +11,6 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Json; namespace FireflyIII\Http\Controllers\Json;
use Preferences;
use Response; use Response;
/** /**
@@ -29,6 +28,7 @@ class IntroController
*/ */
public function getIntroSteps(string $route) public function getIntroSteps(string $route)
{ {
$route = str_replace('.', '_', $route);
$elements = config(sprintf('intro.%s', $route)); $elements = config(sprintf('intro.%s', $route));
$steps = []; $steps = [];
if (is_array($elements) && count($elements) > 0) { if (is_array($elements) && count($elements) > 0) {
@@ -37,12 +37,14 @@ class IntroController
// point to HTML element when not an intro or outro: // point to HTML element when not an intro or outro:
if (!in_array($key, ['intro', 'outro'])) { if (!in_array($key, ['intro', 'outro'])) {
$currentStep['element'] = '#' . $key; $currentStep['element'] = $options['selector'];
} }
// get the text: // get the text:
$currentStep['intro'] = trans('intro.' . $route . '_' . $key); $currentStep['intro'] = trans('intro.' . $route . '_' . $key);
// save in array: // save in array:
$steps[] = $currentStep; $steps[] = $currentStep;
} }
@@ -59,7 +61,8 @@ class IntroController
public function postFinished(string $route) public function postFinished(string $route)
{ {
$key = 'shown_demo_' . $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)]); return Response::json(['result' => sprintf('Reported demo watched for route "%s".', $route)]);
} }

View File

@@ -16,10 +16,20 @@ declare(strict_types=1);
return [ return [
'index' => [ 'index' => [
'intro' => [], 'intro' => [],
'accounts-chart' => [], 'accounts-chart' => ['selector' => '#accounts-chart'],
'box_out_holder' => [], 'box_out_holder' => ['selector' => '#box_out_holder'],
'all_transactions' => ['position' => 'left'], 'help' => ['selector' => '#help', 'position' => 'bottom'],
'help' => ['position' => 'bottom'], 'sidebar-toggle' => ['selector' => '#sidebar-toggle', 'position' => 'bottom'],
'outro' => [], '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' => [],
],
]; ];

View File

@@ -11,8 +11,15 @@ 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_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_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_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_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_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!',
]; ];

View File

@@ -7,7 +7,7 @@
<div class="row"> <div class="row">
<div class="col-lg-12 col-md-12 col-sm-12"> <div class="col-lg-12 col-md-12 col-sm-12">
<p> <p>
<a href="{{ route('rule-groups.create') }}" class="btn btn-success">{{ 'new_rule_group'|_ }}</a> <a href="{{ route('rule-groups.create') }}" id="new_rule_group" class="btn btn-success">{{ 'new_rule_group'|_ }}</a>
</p> </p>
</div> </div>
</div> </div>
@@ -71,7 +71,7 @@
{% for rule in ruleGroup.rules %} {% for rule in ruleGroup.rules %}
<tr> <tr>
<td> <td>
<div class="btn-group btn-group-xs"> <div class="btn-group btn-group-xs prio_buttons">
{% if rule.order > 1 %} {% if rule.order > 1 %}
<a title="{{ 'rule_priority_up'|_ }}" <a title="{{ 'rule_priority_up'|_ }}"
href="{{ route('rules.up', rule.id) }}" href="{{ route('rules.up', rule.id) }}"
@@ -94,7 +94,7 @@
</div> </div>
</td> </td>
<td> <td>
<div class="btn-group btn-group-xs"> <div class="btn-group btn-group-xs edit_buttons">
<a title="{{ 'edit'|_ }}" href="{{ route('rules.edit', rule.id) }}" <a title="{{ 'edit'|_ }}" href="{{ route('rules.edit', rule.id) }}"
class="btn btn-default"><span class="btn btn-default"><span
class="fa fa-fw fa-pencil"></span></a> class="fa fa-fw fa-pencil"></span></a>
@@ -105,7 +105,7 @@
</div> </div>
</td> </td>
<td> <td>
<div class="btn-group btn-group-xs"> <div class="btn-group btn-group-xs test_buttons">
{# show which transactions would match #} {# show which transactions would match #}
<a href="#" class="btn btn-default test_rule_triggers" data-id="{{ rule.id }}" <a href="#" class="btn btn-default test_rule_triggers" data-id="{{ rule.id }}"
title="{{ 'test_rule_triggers'|_ }}"><i data-id="{{ rule.id }}" class="fa fa-fw fa-flask"></i></a> title="{{ 'test_rule_triggers'|_ }}"><i data-id="{{ rule.id }}" class="fa fa-fw fa-flask"></i></a>
@@ -184,7 +184,7 @@
<p> <p>
<br/> <br/>
<a href="{{ route('rules.create', ruleGroup.id) }}" <a href="{{ route('rules.create', ruleGroup.id) }}"
class="btn btn-success">{{ 'new_rule'|_ }}</a> class="btn btn-success new_rule">{{ 'new_rule'|_ }}</a>
</p> </p>
</div> </div>
</div> </div>