Commit cf0fecee authored by Tobias Munk's avatar Tobias Munk

updated UI

parent fa78df08
......@@ -67,8 +67,16 @@ $this->params['breadcrumbs'][] = Yii::t('app', 'View');
'id',
'name',
'php_class',
'json_schema:ntext',
'twig_template:ntext',
[
'attribute' => 'json_schema',
'format' => 'html',
'value' => '<pre class="pre-x-scrollable">'.Html::encode($model->json_schema).'</pre>'
],
[
'attribute' => 'twig_template',
'format' => 'html',
'value' => '<pre>'.Html::encode($model->twig_template).'</pre>'
],
],
]); ?>
......
......@@ -47,7 +47,7 @@ var widgets = {
console.log($(elem).val());
if (!lastTemplateId || confirm('Reset values and update template?')) {
lastTemplateId = $(elem).val();
url = '/de/widgets/crud/widget/create?Widget[widget_template_id]='+$('#widgetcontent-widget_template_id').val();
url = '/widgets/crud/widget/create?Widget[widget_template_id]='+$('#widgetcontent-widget_template_id').val();
//alert(url);
$.pjax.reload({url: url, container: '#pjax-widget-form'});
} else {
......
......@@ -44,15 +44,15 @@ $this->params['breadcrumbs'][] = \Yii::t('app', 'View');
<div class="clearfix crud-navigation">
<!-- menu buttons -->
<div class='pull-left'>
<?php echo Html::a('<span class="glyphicon glyphicon-pencil"></span> '.Yii::t('app', 'Edit'),
<?php echo Html::a('<span class="glyphicon glyphicon-pencil"></span> '.\Yii::t('app', 'Edit'),
['update', 'id' => $model->id], ['class' => 'btn btn-info']) ?>
<?php echo Html::a('<span class="glyphicon glyphicon-copy"></span> '.Yii::t('app', 'Copy'),
<?php echo Html::a('<span class="glyphicon glyphicon-copy"></span> '.\Yii::t('app', 'Copy'),
['create', 'id' => $model->id, 'Widget' => $copyParams], ['class' => 'btn btn-success']) ?>
<?php echo Html::a('<span class="glyphicon glyphicon-plus"></span> '.Yii::t('app', 'New'), ['create'],
<?php echo Html::a('<span class="glyphicon glyphicon-plus"></span> '.\Yii::t('app', 'New'), ['create'],
['class' => 'btn btn-success']) ?>
</div>
<div class="pull-right">
<?php echo Html::a('<span class="glyphicon glyphicon-list"></span> '.Yii::t('app', 'Full list'), ['index'],
<?php echo Html::a('<span class="glyphicon glyphicon-list"></span> '.\Yii::t('app', 'Full list'), ['index'],
['class' => 'btn btn-default']) ?>
</div>
......@@ -64,12 +64,21 @@ $this->params['breadcrumbs'][] = \Yii::t('app', 'View');
<?php echo DetailView::widget([
'options' => ['class' => 'table table-striped table-bordered detail-view'],
'model' => $model,
'attributes' => [
'id',
'status',
'widget_template_id',
'default_properties_json:ntext',
[
'attribute' => 'widget_template_id',
'format' => 'raw',
'value' => \yii\helpers\Html::a($model->template->name, ['crud/widget-template/view', 'id'=>$model->widget_template_id])
],
[
'attribute' => 'default_properties_json',
'format' => 'raw',
'value' => "<pre><code>".Html::encode($model->default_properties_json)."</code></pre>",
],
'name_id',
'container_id',
'rank',
......@@ -88,11 +97,11 @@ $this->params['breadcrumbs'][] = \Yii::t('app', 'View');
<hr/>
<?php echo Html::a('<span class="glyphicon glyphicon-trash"></span> '.Yii::t('app', 'Delete'),
<?php echo Html::a('<span class="glyphicon glyphicon-trash"></span> '.\Yii::t('app', 'Delete'),
['delete', 'id' => $model->id],
[
'class' => 'btn btn-danger',
'data-confirm' => ''.Yii::t('app', 'Are you sure to delete this item?').'',
'data-confirm' => ''.\Yii::t('app', 'Are you sure to delete this item?').'',
'data-method' => 'post',
]); ?>
<?php $this->endBlock(); ?>
......
......@@ -17,7 +17,7 @@ use yii\helpers\Html;
<?= \insolita\wgadminlte\SmallBox::widget(
[
'head' => WidgetContent::find()->count(),
'footer' => 'Contents',
'footer' => 'Widget Contents',
'footer_link' => ['crud/widget'],
]
) ?>
......@@ -53,6 +53,7 @@ use yii\helpers\Html;
<h4>Example</h4>
<p>
<code>{"hrzg\\widget\\widgets\\TwigTemplate": "Twig layout"}</code></p>
<?= Html::a('Open settings', ['/settings'], ['class' => 'btn btn-default']) ?>
<?= Html::a('Online documentation', 'https://git.hrzg.de/hrzg/yii2-widgets2-module', ['class' => 'btn btn-info']) ?>
......@@ -62,9 +63,10 @@ use yii\helpers\Html;
<?php \insolita\wgadminlte\Box::begin() ?>
<?= Html::a('Test page index', ['test/index'], ['class' => 'btn btn-warning']) ?>
<?= Html::a('Test page index', ['test/index'], ['class' => 'btn btn-default']) ?>
<?= Html::a('Test page-1 (with parameter)', ['test/with-param', 'id' => 'page-1'], ['class' => 'btn btn-default']) ?>
<?= Html::a('Test page-1 (with parameter)', ['test/with-param', 'id'=>'page-1'], ['class' => 'btn btn-warning']) ?>
<?= Html::a('Test page-2 (with parameter)', ['test/with-param', 'id'=>'page-2'], ['class' => 'btn btn-warning']) ?>
<?= Html::a('Test page-2 (with parameter)', ['test/with-param', 'id' => 'page-2'], ['class' => 'btn btn-default']) ?>
<?php \insolita\wgadminlte\Box::end() ?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment