Skip to content

Commit

Permalink
intro and outro
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed May 11, 2021
1 parent b56cf3c commit 977a9ce
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/aws/DetailViewActiveWindow.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,18 @@ class DetailViewActiveWindow extends ActiveWindow
* Please refer to [[\yii\helpers\BaseHtml::renderTagAttributes()]] for the supported syntax.
*/
public $attributes;

/**
* @var string A text (can include html) which shown before the detail view table.
* @since 4.0.0
*/
public $intro;

/**
* @var string A text (can include html) which shown after the detail view table.
* @since 4.0.0
*/
public $outro;

/**
* @inheritdoc
Expand All @@ -122,6 +134,8 @@ public function defaultIcon()
public function index()
{
return $this->render('index', [
'intro' => $this->intro,
'outro' => $this->outro,
'model' => $this->model,
'attributes' => $this->attributes,
]);
Expand Down
1 change: 1 addition & 0 deletions src/models/ProxyMachine.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public function ngRestActiveWindows()
return [
[
'class' => DetailViewActiveWindow::class,
'intro' => 'For more details about how to use the sync command, take a look at the <a class="text-primary" href="https://luya.io/api/luya-admin-commands-ProxyController" target="_blank">admin/proxy guide</a>.',
'attributes' => [
'name',
'identifier',
Expand Down
11 changes: 9 additions & 2 deletions src/views/aws/detailview/index.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
<?php
use yii\widgets\DetailView;

?>
<?php if (!empty($intro)): ?>
<div class="mb-3"><?= $intro; ?></div>
<?php endif; ?>

<div class="table-responsive">
<?= DetailView::widget([
'model' => $model,
'attributes' => $attributes,
'options' => ['class' => 'table table-bordered table-striped'],
]); ?>
</div>
</div>

<?php if (!empty($outro)): ?>
<div class="mt-3"><?= $outro; ?></div>
<?php endif; ?>

0 comments on commit 977a9ce

Please sign in to comment.