Skip to content

Commit

Permalink
Sync yiisoft/yii-bootstrap5 package last changes. (#635)
Browse files Browse the repository at this point in the history
* Update carousel bootstrap5.

* Update alert bootstrap5.

* Update alert bootstrap5.

* Update blog/resources/messages/en/app.php

Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>

* Update blog/resources/messages/en/app.php

Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>

* Fix pagination namespace and update row attributes in user index view.

---------

Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>
  • Loading branch information
terabytesoftw and vjik authored Dec 6, 2024
1 parent 486e8b9 commit 3d1e94b
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 40 deletions.
9 changes: 6 additions & 3 deletions blog/resources/messages/de/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
'gridview.login' => 'Anmelden',
'gridview.profile' => 'Profil',
'gridview.title' => 'Liste der Benutzer',
'home.caption.slide1' => '<h5>Hello, everyone!</h5><p>Ein toller Tag, um Yii 3 auszuprobieren, richtig?</p>',
'home.caption.slide2' => '<h5>Der Code wartet!</h5><p>Schau dir den Projektcode an. Er ist nicht ideal, da es sich auch um eine Entwicklungs-Sandbox handelt, bietet aber einen mittelmäßigen Überblick über die Funktionen von Yii 3.</p>',
'home.caption.slide3' => '<h5>Wir brauchen Rückmeldungen!</h5><p>Bitte gib uns deine Rückmeldungen über die im README genannten Telegram- und Slack-Kanäle.</p>',
'home.caption.slide1' => 'Hello, everyone!',
'home.caption.placeholder1' => 'Ein toller Tag, um Yii 3 auszuprobieren, richtig?',
'home.caption.slide2' => 'Der Code wartet!',
'home.caption.placeholder2' => 'Schau dir den Projektcode an. Er ist nicht ideal, da es sich auch um eine Entwicklungs-Sandbox handelt, bietet aber einen mittelmäßigen Überblick über die Funktionen von Yii 3.',
'home.caption.slide3' => 'Wir brauchen Rückmeldungen!',
'home.caption.placeholder3' => 'Bitte gib uns deine Rückmeldungen über die im README genannten Telegram- und Slack-Kanäle.',
'layout.add.post' => 'Neuer Beitrag',
'layout.add.random-content' => 'Füge zufälligen Inhalt ein',
'layout.add.tag' => 'Neues Stichwort',
Expand Down
9 changes: 6 additions & 3 deletions blog/resources/messages/en/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
'gridview.login' => 'Login',
'gridview.profile' => 'Profile',
'gridview.title' => 'List of users',
'home.caption.slide1' => '<h5>Hello, everyone!</h5><p>A great day to try Yii 3, right?</p>',
'home.caption.slide2' => '<h5>Code awaits!</h5><p>Check the project code. It\'s not ideal since it\'s a development sandbox as well, but gives a so-so overview of Yii 3 capabilities.</p>',
'home.caption.slide3' => '<h5>We need feedback!</h5><p>Please leave your feedback in either Telegram or Slack mentioned in README.</p>',
'home.caption.slide1' => 'Hello, everyone!',
'home.caption.placeholder1' => 'A great day to try Yii3, right?',
'home.caption.slide2' => 'Code awaits!',
'home.caption.placeholder2' => 'Check the project code. It\'s not ideal since it\'s a development sandbox as well, but gives a so-so overview of Yii3 capabilities.',
'home.caption.slide3' => 'We need feedback!',
'home.caption.placeholder3' => 'Please leave your feedback in either Telegram or Slack mentioned in README.',
'layout.add.post' => 'Add post',
'layout.add.random-content' => 'Add random content',
'layout.add.tag' => 'Add tag',
Expand Down
9 changes: 6 additions & 3 deletions blog/resources/messages/id/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
'gridview.api' => 'API',
'gridview.profile' => 'Profil',
'gridview.title' => 'Daftar pengguna',
'home.caption.slide1' => '<h5>Halo semuanya!</h5><p>Hari yang menyenangkan untuk mencoba Yii 3, bukan?</p>',
'home.caption.slide2' => '<h5>Menunggu kode!</h5><p>Periksa kode proyek. Ini tidak ideal karena ini juga merupakan sandbox pengembangan, tetapi memberikan gambaran umum tentang kemampuan Yii 3.</p>',
'home.caption.slide3' => 'Kami membutuhkan umpan balik!</h5><p>Silakan tinggalkan umpan balik Anda di Telegram atau Slack yang disebutkan di README.</p>',
'home.caption.slide1' => 'Halo semuanya!',
'home.caption.placeholder1' => 'Hari yang menyenangkan untuk mencoba Yii 3, bukan?',
'home.caption.slide2' => 'Menunggu kode!',
'home.caption.placeholder2' => 'Periksa kode proyek. Ini tidak ideal karena ini juga merupakan sandbox pengembangan, tetapi memberikan gambaran umum tentang kemampuan Yii 3.',
'home.caption.slide3' => 'Kami membutuhkan umpan balik!',
'home.caption.placeholder3' => 'Silakan tinggalkan umpan balik Anda di Telegram atau Slack yang disebutkan di README.',
'layout.add.post' => 'Tambahkan postingan',
'layout.add.random-content' => 'Tambahkan konten acak',
'layout.add.tag' => 'Tambahkan tag',
Expand Down
9 changes: 6 additions & 3 deletions blog/resources/messages/ru/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
'gridview.api' => 'API',
'gridview.profile' => 'Профиль',
'gridview.title' => 'Список пользователей',
'home.caption.slide1' => '<h5>Всем привет!</h5><p>Отличный день чтобы попробовать Yii 3!</p>',
'home.caption.slide2' => '<h5>Код ждёт!</h5><p>Изучите код проекта. Он не идеален потому как это ещё и песочница разработчиков, но даёт представление о том, что может Yii 3.</p>',
'home.caption.slide3' => '<h5>Нам нужна обратная связь!</h5><p>Оствляйте её в Telegram или Slack, которые можно найти в README.</p>',
'home.caption.slide1' => 'Всем привет!',
'home.caption.placeholder1' => 'Отличный день чтобы попробовать Yii 3!',
'home.caption.slide2' => 'Код ждёт!',
'home.caption.placeholder2' => 'Изучите код проекта. Он не идеален потому как это ещё и песочница разработчиков, но даёт представление о том, что может Yii 3.',
'home.caption.slide3' => 'Нам нужна обратная связь!',
'home.caption.placeholder3' => 'Оствляйте её в Telegram или Slack, которые можно найти в README.',
'layout.add.post' => 'Добавить пост',
'layout.add.random-content' => 'Добавить случайный контент',
'layout.add.tag' => 'Добавить тег',
Expand Down
9 changes: 6 additions & 3 deletions blog/resources/messages/sk/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
'gridview.api' => 'API',
'gridview.profile' => 'Profil',
'gridiview.title' => 'Zoznam používateľov',
'home.caption.slide1' => '<h5>Dobrý deň!</h5><p>Možno je ten správny deň, skúsiť nový Yii 3 framework!</p>',
'home.caption.slide2' => '<h5>Kód už čaká na Vás!</h5><p>Naučte sa syntax kódu projektu. Nie je ešte ideálny, pretože je to ešte hračka v rukách developerov, ale Vám dá aspoň predstavu, čo Yii3 dokáže už dnes.</p>',
'home.caption.slide3' => '<h5>Potrebujeme poznať Váš názor!</h5><p>Kontaktujte nás cez Telegram alebo Slack, detaily nájdete v súbore README.</p>',
'home.caption.slide1' => 'Dobrý deň!',
'home.caption.placeholder1' => 'Možno je ten správny deň, skúsiť nový Yii 3 framework!',
'home.caption.slide2' => 'Kód už čaká na Vás!',
'home.caption.placeholder2' => 'Naučte sa syntax kódu projektu. Nie je ešte ideálny, pretože je to ešte hračka v rukách developerov, ale Vám dá aspoň predstavu, čo Yii3 dokáže už dnes.',
'home.caption.slide3' => 'Potrebujeme poznať Váš názor!',
'home.caption.placeholder3' => 'Kontaktujte nás cez Telegram alebo Slack, detaily nájdete v súbore README.',
'layout.add.post' => 'Pridať príspevok',
'layout.add.random-content' => 'Vytvoriť náhodný obsah',
'layout.add.tag' => 'Pridať tag',
Expand Down
4 changes: 1 addition & 3 deletions blog/resources/views/blog/post/__form.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@

if (!empty($errors)) {
foreach ($errors as $field => $error) {
echo Alert::widget()
->options(['class' => 'alert-danger'])
->body(Html::encode($field . ':' . $error));
echo Alert::widget()->addClass('alert-danger')->body(Html::encode($field . ':' . $error));
}
}
?>
Expand Down
41 changes: 24 additions & 17 deletions blog/resources/views/site/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

declare(strict_types=1);

use Yiisoft\Html\Tag\Div;
use Yiisoft\Translator\TranslatorInterface;
use Yiisoft\View\WebView;
use Yiisoft\Yii\Bootstrap5\Carousel;
use Yiisoft\Yii\Bootstrap5\CarouselItem;

/**
* @var TranslatorInterface $translator
Expand All @@ -13,23 +15,28 @@
$this->setTitle('Home');

echo Carousel::widget()
->items([
[
'content' => '<div class="d-block w-100 bg-info" style="height: 200px"></div>',
'caption' => $translator->translate('home.caption.slide1'),
'captionOptions' => ['class' => ['d-none', 'd-md-block']],
],
[
'content' => '<div class="d-block w-100 bg-secondary" style="height: 200px"></div>',
'caption' => $translator->translate('home.caption.slide2'),
'captionOptions' => ['class' => ['d-none', 'd-md-block']],
],
[
'content' => '<div class="d-block w-100 bg-dark" style="height: 200px"></div>',
'caption' => $translator->translate('home.caption.slide3'),
'captionOptions' => ['class' => ['d-none', 'd-md-block']],
],
]);
->captionTagName('h2')
->items(
new CarouselItem(
Div::tag()->addAttributes(['style' => 'height: 200px'])->addClass('d-block w-100 bg-info'),
$translator->translate('home.caption.slide1'),
$translator->translate('home.caption.placeholder1'),
captionAttributes: ['class' => ['d-none', 'd-md-block']],
),
new CarouselItem(
Div::tag()->addAttributes(['style' => 'height: 200px'])->addClass('d-block w-100 bg-secondary'),
$translator->translate('home.caption.slide2'),
$translator->translate('home.caption.placeholder2'),
captionAttributes: ['class' => ['d-none', 'd-md-block']],
),
new CarouselItem(
Div::tag()->addAttributes(['style' => 'height: 200px'])->addClass('d-block w-100 bg-dark'),
$translator->translate('home.caption.slide3'),
$translator->translate('home.caption.placeholder3'),
captionAttributes: ['class' => ['d-none', 'd-md-block']],
),
)
->showIndicators();
?>


Expand Down
4 changes: 2 additions & 2 deletions blog/resources/views/user/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Yiisoft\View\WebView;
use Yiisoft\Yii\DataView\Column\DataColumn;
use Yiisoft\Yii\DataView\GridView;
use Yiisoft\Yii\DataView\OffsetPagination;
use Yiisoft\Yii\DataView\Pagination\OffsetPagination;

/**
* @var string $csrf
Expand Down Expand Up @@ -135,7 +135,7 @@
->paginator($paginator)
->render(),
)
->rowAttributes(['class' => 'align-middle'])
->headerRowAttributes(['class' => 'align-middle'])
->summaryAttributes(['class' => 'summary text-end mb-5'])
->tableAttributes(['class' => 'table table-hover'])
->toolbar(
Expand Down
4 changes: 1 addition & 3 deletions blog/src/Widget/FlashMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ public function render(): string
$html = [];
foreach ($flashes as $type => $data) {
foreach ($data as $message) {
$html[] = Alert::widget()
->options(['class' => "alert-{$type} shadow"])
->body($message['body']);
$html[] = Alert::widget()->addClass("alert-{$type} shadow")->body($message['body']);
}
}

Expand Down

0 comments on commit 3d1e94b

Please sign in to comment.