Skip to content

Commit

Permalink
Fixed invalid modal calls
Browse files Browse the repository at this point in the history
Concerns #395
  • Loading branch information
mikron-ia committed May 28, 2024
1 parent 3d3bde7 commit ff43fcf
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 9 deletions.
4 changes: 2 additions & 2 deletions common/messages/pl/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,9 @@
'SCENARIO_TECHNICAL_DETAILS' => 'Szczegóły techniczne',
'SCENARIO_TITLE_CREATE' => 'Dodaj scenariusz',
'SCENARIO_TITLE_UPDATE' => 'Zmień scenariusz',
'SCRIBBLES_BUTTON_NO' => 'Klinij, by dodać do ulubionych',
'SCRIBBLES_BUTTON_NO' => 'Klinij, żeby dodać do ulubionych',
'SCRIBBLES_BUTTON_WORKING' => 'Zmiana statusu w toku...',
'SCRIBBLES_BUTTON_YES' => 'W ulubionych; kliknij, by usunąć z ulubionych',
'SCRIBBLES_BUTTON_YES' => 'W ulubionych; kliknij, żeby usunąć z ulubionych',
'SCRIBBLES_FAVORITE_ERROR_GENERIC' => 'Błąd zapisu statusu',
'SCRIBBLES_TITLE_NO' => 'Notatnik',
'SCRIBBLES_TITLE_YES' => 'Notatnik',
Expand Down
18 changes: 18 additions & 0 deletions frontend/assets/IndexBoxesCharacterAsset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace frontend\assets;

use yii\web\AssetBundle;

class IndexBoxesCharacterAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [];
public $js = [
'js/index-boxes-character.js',
];
public $depends = [
'frontend\assets\IndexBoxesAsset',
];
}
18 changes: 18 additions & 0 deletions frontend/assets/IndexBoxesGroupAsset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace frontend\assets;

use yii\web\AssetBundle;

class IndexBoxesGroupAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [];
public $js = [
'js/index-boxes-group.js',
];
public $depends = [
'frontend\assets\IndexBoxesAsset',
];
}
2 changes: 1 addition & 1 deletion frontend/views/character/_index_box.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</h3>

<span class="index-box-header-icon index-box-header-icon-top glyphicon <?= $favoriteClass ?> favorite-button"
data-box-key="<?= $model->key ?>"
data-character-key="<?= $model->key ?>"
data-scribble-id="<?= $scribbleObject?->scribble_id ?>"
title="<?= $favoriteTitle ?>"
></span>
Expand Down
4 changes: 2 additions & 2 deletions frontend/views/character/index.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

use frontend\assets\IndexBoxesAsset;
use frontend\assets\IndexBoxesCharacterAsset;
use yii\bootstrap\Modal;
use yii\bootstrap\Tabs;
use yii\helpers\Html;

IndexBoxesAsset::register($this);
IndexBoxesCharacterAsset::register($this);

/* @var $this yii\web\View */
/* @var $searchModel common\models\CharacterQuery */
Expand Down
4 changes: 2 additions & 2 deletions frontend/views/group/_index_box.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@
</h3>

<span class="index-box-header-icon index-box-header-icon-top glyphicon <?= $favoriteClass ?> favorite-button"
data-box-key="<?= $model->key ?>"
data-group-key="<?= $model->key ?>"
data-scribble-id="<?= $scribbleObject?->scribble_id ?>"
title="<?= $favoriteTitle ?>"
></span>

<span class="index-box-header-icon index-box-header-icon-bottom glyphicon <?= $scribbleClass ?> scribble-button"
data-box-key="<?= $model->key ?>"
data-group-key="<?= $model->key ?>"
title="<?= $scribbleTitle ?>"
></span>

Expand Down
4 changes: 2 additions & 2 deletions frontend/views/group/index.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

use frontend\assets\IndexBoxesAsset;
use frontend\assets\IndexBoxesGroupAsset;
use yii\bootstrap\Modal;
use yii\bootstrap\Tabs;
use yii\helpers\Html;

IndexBoxesAsset::register($this);
IndexBoxesGroupAsset::register($this);

/* @var $this yii\web\View */
/* @var $searchModel common\models\CharacterQuery */
Expand Down
10 changes: 10 additions & 0 deletions frontend/web/js/index-boxes-character.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$(".scribble-button").on('click', function () {
$.get(
'../character/open-scribble-modal',
{key: $(this).data('character-key')},
function (data) {
$('.modal-body').html(data);
$('#scribble-modal').modal();
}
);
});
10 changes: 10 additions & 0 deletions frontend/web/js/index-boxes-group.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$(".scribble-button").on('click', function () {
$.get(
'../group/open-scribble-modal',
{key: $(this).data('group-key')},
function (data) {
$('.modal-body').html(data);
$('#scribble-modal').modal();
}
);
});

0 comments on commit ff43fcf

Please sign in to comment.