Skip to content

Commit

Permalink
skip label replaced, added title to rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Matej-ch committed Jun 9, 2022
1 parent 671a5ba commit 3029521
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 24 deletions.
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
],
"require": {
"php": ">=7.2.0",
"yiisoft/yii2": "~2.0.42",
"bower-asset/intro.js": "^2.9"
"yiisoft/yii2": "~2.0.42"
},
"repositories": [
{
Expand All @@ -31,5 +30,10 @@
"psr-4": {
"matejch\\pageGuide\\tests\\": "tests/"
}
},
"config": {
"allow-plugins": {
"yiisoft/yii2-composer": true
}
}
}
21 changes: 3 additions & 18 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/messages/cs/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'step' => 'Krok',
'element' => 'Element na který napojit návod',
'element_help' => 'Nápověda k elementu',
'element_title' => 'Titulek nápovedy',
'help_4' => 'Přesuňte požadovaný element sem',
'rule_element' => 'Element',
'intro' => 'Obsah',
Expand Down
1 change: 1 addition & 0 deletions src/messages/en/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'help_3' => 'Every page you want to use for creating page guides must have widget PageAssist on it from widget directory',
'step' => 'Step',
'element' => 'Element for linking information',
'element_title' => 'Assistance title',
'element_help' => 'Assistance for element',
'help_4' => 'Moved element from other window here',
'rule_element' => 'Element',
Expand Down
1 change: 1 addition & 0 deletions src/messages/it/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'step' => 'Passo',
'element' => 'Elemento per collegare le informazioni',
'element_help' => 'Assistenza per l\'elemento',
'element_title' => 'Assistance title',
'help_4' => 'Muovere l\'elemento dall\'altra finestra qui',
'rule_element' => 'Elemento',
'intro' => 'Contenuto',
Expand Down
1 change: 1 addition & 0 deletions src/messages/sk/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'help_3' => 'Na stránkach ktorých chcete vytvoriť pomocníka musí mať widget PageAssist z adresára widget',
'step' => 'Krok',
'element' => 'Element na ktorý napojiť návod',
'element_title' => 'Titulok nápovedy',
'element_help' => 'Nápoveda k elementu',
'help_4' => 'Presuňte požadovaný element sem',
'rule_element' => 'Element',
Expand Down
6 changes: 6 additions & 0 deletions src/views/page-guide/partials/_rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
'top' => Yii::t('pageGuide/view','top')
], ['class' => 'form-control js-position']) ?>
</div>

<div class="w-full">
<label class="control-label"><?= Yii::t('pageGuide/view','element_title') ?></label>
<input name="PageGuide[rules][<?= $index ?>][title]" value="<?= $rule['title'] ?? '' ?>" class="form-control js-title">
</div>

<div class="w-full">
<label class="control-label"><?= Yii::t('pageGuide/view','element_help') ?></label>
<textarea name="PageGuide[rules][<?= $index ?>][intro]" cols="30" rows="10" class="form-control js-intro"><?= $rule['intro'] ?? '' ?></textarea>
Expand Down
6 changes: 6 additions & 0 deletions src/views/page-guide/templates/_rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
'top' => Yii::t('pageGuide/view','top')
], ['class' => 'form-control js-position']) ?>
</div>

<div class="w-full">
<label class="control-label"><?= Yii::t('pageGuide/view','element_title') ?></label>
<input name="PageGuide[rules][][title]" value="" class="form-control js-title">
</div>

<div class="w-full">
<label class="control-label"><?= Yii::t('pageGuide/view','element_help') ?></label>
<textarea name="PageGuide[rules][][intro]" cols="30" rows="10" class="form-control js-intro"></textarea>
Expand Down
4 changes: 2 additions & 2 deletions src/views/page-guide/update.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/* @var $this yii\web\View */
/* @var $model \matejch\pageGuide\PageGuide */
/* @var $model \matejch\pageGuide\models\PageGuide*/

$this->title = Yii::t('pageGuide/view','update guide',['id' => $model->id]);
$this->title = Yii::t('pageGuide/view','update guide',['id' => $model->url]);
$this->params['breadcrumbs'][] = ['label' => Yii::t('pageGuide/view','page guide'), 'url' => ['index']];
$this->params['breadcrumbs'][] = 'Update';
?>
Expand Down
4 changes: 3 additions & 1 deletion src/web/js/assist.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ document.addEventListener('DOMContentLoaded',() => {

intro.setOption("prevLabel",window.guideLabels.prevLabel || 'Prev' );
intro.setOption("nextLabel",window.guideLabels.nextLabel || 'Next' );
intro.setOption("skipLabel",window.guideLabels.skipLabel || 'Skip' );
intro.setOption("skipLabel", '×');
intro.setOption("doneLabel",window.guideLabels.doneLabel || 'Done' );

if(window.guideCallbacks) {
Expand Down Expand Up @@ -128,6 +128,7 @@ document.addEventListener('DOMContentLoaded',() => {
container.querySelector('.js-step').name = 'PageGuide[rules]['+step+'][step]';
container.querySelector('.js-step').value = step + 1;
container.querySelector('.js-position').name = 'PageGuide[rules]['+step+'][position]';
container.querySelector('.js-title').name = 'PageGuide[rules]['+step+'][title]';
container.querySelector('.js-element').name = 'PageGuide[rules]['+step+'][element]';
container.querySelector('.js-intro').name = 'PageGuide[rules]['+step+'][intro]';

Expand Down Expand Up @@ -155,6 +156,7 @@ document.addEventListener('DOMContentLoaded',() => {
tmpl.querySelector('.js-step').name = 'PageGuide[rules]['+count+'][step]';
tmpl.querySelector('.js-step').value = count + 1;
tmpl.querySelector('.js-position').name = 'PageGuide[rules]['+count+'][position]';
tmpl.querySelector('.js-title').name = 'PageGuide[rules]['+count+'][title]';
tmpl.querySelector('.js-element').name = 'PageGuide[rules]['+count+'][element]';
tmpl.querySelector('.js-intro').name = 'PageGuide[rules]['+count+'][intro]';
document.getElementById('js-el-container').appendChild(tmpl);
Expand Down
2 changes: 1 addition & 1 deletion src/web/js/assist.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3029521

Please sign in to comment.