Skip to content

Commit

Permalink
updated overlay UI
Browse files Browse the repository at this point in the history
  • Loading branch information
schmunk42 committed Oct 23, 2013
1 parent b6d5c3b commit e409cfa
Showing 1 changed file with 159 additions and 149 deletions.
308 changes: 159 additions & 149 deletions components/views/overlay.php
Original file line number Diff line number Diff line change
@@ -1,158 +1,168 @@
<div class="overlay">
<div class="controls">
<div class="pull-left">
<?php
if (isset($model)) {
if ($model->isUpdateable) {
$this->widget(
'TbButton',
array(
'buttonType' => 'link',
#'caption' => 'Edit',
'url' => array(
'/p3widgets/p3Widget/update',
'id' => $model->id,
'returnUrl' => Yii::app()->request->getUrl()
),
'icon' => "pencil",
'type' => $model->statusCssClass,
#'onclick' => 'js:function(){alert("clicked"); this.blur(); return false;}',
'htmlOptions' => array(
'name' => 'btnClick' . uniqid(),
'data-toggle' => 'tooltip',
'data-placement' => 'bottom',
'title' => "Update Widget #{$model->id} {$model->status}"
)
)
);
if ($model->translationModel->isNewRecord) {
$this->widget(
'TbButton',
array(
'buttonType' => 'link',
#'caption' => 'Translations',
'url' => array(
'/p3widgets/p3WidgetTranslation/create',
'P3WidgetTranslation' => array(
'p3_widget_id' => $model->id,
'language' => Yii::app()->language
),
'returnUrl' => Yii::app()->request->getUrl()
),
'icon' => 'flag',
'type' => $model->translationModel->statusCssClass,
'htmlOptions' => array(
'name' => 'btnClick' . uniqid(),
'data-toggle' => 'tooltip',
'data-placement' => 'bottom',
'title' => "Update Translation #{$model->translationModel->id} {$model->translationModel->status}"
<div class="controls">
<div class="pull-left">
<?php
if (isset($model)) {

)
#'onclick' => 'js:function(){alert("clicked"); this.blur(); return false;}',
)
);
} else {
$this->widget(
'TbButton',
array(
'buttonType' => 'link',
#'caption' => 'Translations',
'url' => array(
'/p3widgets/p3WidgetTranslation/update',
'id' => $model->getTranslationModel()->id,
'returnUrl' => Yii::app()->request->getUrl()
),
'icon' => 'flag',
'type' => $model->translationModel->statusCssClass,
#'onclick' => 'js:function(){alert("clicked"); this.blur(); return false;}',
'htmlOptions' => array(
'name' => 'btnClick' . uniqid(),
'data-toggle' => 'tooltip',
'data-placement' => 'bottom',
'title' => "Update Translation #{$model->translationModel->id} {$model->translationModel->status}"
)
)
);
}

echo '<div class="handle">';
$this->widget(
'TbButton',
array(
#'label' => 'Move',
'buttonType' => 'link',
'icon' => 'move',
#'onclick' => 'js:function(){alert("tbd: drag and drop"); this.blur(); return false;}',
'htmlOptions' => array(
'name' => 'btnClick2' . uniqid(),
'data-toggle' => 'tooltip',
'data-placement' => 'bottom',
'title' => 'Move Widget'
)
)
);
echo '</div> ';
$this->widget(
'bootstrap.widgets.TbButtonGroup',
array(
'type' => 'primary',
'encodeLabel' => false,
// '', 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'
'buttons' => array(
array(
'label' => $model->id,
'url' => array(
'/p3widgets/p3Widget/create',
'P3Widget' => $widgetAttributes,
'returnUrl' => Yii::app()->request->getUrl()
),
'icon' => 'pencil',
'items' => array(
array(
'buttonType' => 'link',
'label' => 'Edit Widget <span class="label '.$model->statusCssClass.'">' . $model->status . '</span>',
'visible' => $model->isUpdateable,
'url' => array(
'/p3widgets/p3Widget/update',
'id' => $model->id,
'returnUrl' => Yii::app()->request->getUrl()
),
'icon' => "pencil",
'type' => $model->statusCssClass,
#'onclick' => 'js:function(){alert("clicked"); this.blur(); return false;}',
'htmlOptions' => array(
'name' => 'btnClick' . uniqid(),
'data-toggle' => 'tooltip',
'data-placement' => 'bottom',
'title' => "Update Widget #{$model->id} {$model->status}"
),

}
if ($model->isDeleteable) {
$this->widget(
'TbButton',
array(
'id' => 'delete-' . $model->id,
'buttonType' => 'link',
'type' => 'danger',
#'caption' => 'Delete',
'icon' => 'remove',
// onclick' => see container.js,
'htmlOptions' => array(
'name' => 'btnClick3' . uniqid(),
'title' => 'Delete Widget with all Translations',
'class' => 'delete',
'data-toggle' => 'tooltip',
'data-placement' => 'bottom',
'title' => "Delete Widget #{$model->id} with " . count(
$model->p3WidgetTranslations
) . " Translation(s)"
),
array(
'buttonType' => 'link',
'label' => 'Create Translation',
'visible' => ($model->isUpdateable && $model->translationModel->isNewRecord),
'url' => array(
'/p3widgets/p3WidgetTranslation/create',
'P3WidgetTranslation' => array(
'p3_widget_id' => $model->id,
'language' => Yii::app()->language
),
'returnUrl' => Yii::app()->request->getUrl()
),
'icon' => 'flag',
'type' => $model->translationModel->statusCssClass,
'htmlOptions' => array(
'name' => 'btnClick' . uniqid(),
)
),
array(
'buttonType' => 'link',
'label' => 'Edit Translation <span class="label">' . $model->translationModel->status . '</span>',
'visible' => ($model->translationModel->isUpdateable && !$model->translationModel->isNewRecord),
'url' => array(
'/p3widgets/p3WidgetTranslation/update',
'id' => $model->getTranslationModel()->id,
'returnUrl' => Yii::app()->request->getUrl()
),
'icon' => 'flag',
'type' => $model->translationModel->statusCssClass,
'htmlOptions' => array(
'name' => 'btnClick' . uniqid(),
)
)
)
),

)
)
);
}
}
?>
</div>
),
)
);

<div class="pull-right">
<?php

if ($model->isUpdateable) {
echo '<div class="handle">';
$this->widget(
'bootstrap.widgets.TbButtonGroup',
array(
'type' => 'primary',
// '', 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'
'buttons' => array(
array(
'label' => $this->id,
'url' => array(
'/p3widgets/p3Widget/create',
'P3Widget' => $widgetAttributes,
'returnUrl' => Yii::app()->request->getUrl()
),
'icon' => 'plus',
'htmlOptions' => array(
'data-toggle' => 'tooltip',
'data-placement' => 'bottom',
'title' => "Create a new Widget in container {$this->id}"
)
),
array(
'items' => Yii::app()->getModule('p3widgets')->buildWidgetMenuItems($widgetAttributes)
),
),
)
'TbButton',
array(
#'label' => 'Move',
'buttonType' => 'link',
'icon' => 'move',
#'onclick' => 'js:function(){alert("tbd: drag and drop"); this.blur(); return false;}',
'htmlOptions' => array(
'name' => 'btnClick2' . uniqid(),
'data-toggle' => 'tooltip',
'data-placement' => 'bottom',
'title' => 'Move Widget'
)
)
);
?>
<!--
echo '</div> ';
}


if ($model->isDeleteable) {
$this->widget(
'TbButton',
array(
'id' => 'delete-' . $model->id,
'buttonType' => 'link',
'type' => 'danger',
#'caption' => 'Delete',
'icon' => 'remove',
// onclick' => see container.js,
'htmlOptions' => array(
'name' => 'btnClick3' . uniqid(),
'title' => 'Delete Widget with all Translations',
'class' => 'delete',
'data-toggle' => 'tooltip',
'data-placement' => 'bottom',
'title' => "Delete Widget #{$model->id} with " . count(
$model->p3WidgetTranslations
) . " Translation(s)"

)
)
);
}
}
?>
</div>

<div class="pull-right">
<?php
$this->widget(
'bootstrap.widgets.TbButtonGroup',
array(
'type' => 'primary',
// '', 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'
'buttons' => array(
array(
'label' => $this->id,
'url' => array(
'/p3widgets/p3Widget/create',
'P3Widget' => $widgetAttributes,
'returnUrl' => Yii::app()->request->getUrl()
),
'icon' => 'plus',
'htmlOptions' => array(
'data-toggle' => 'tooltip',
'data-placement' => 'bottom',
'title' => "Create a new Widget in container {$this->id}"
)
),
array(
'items' => Yii::app()->getModule('p3widgets')->buildWidgetMenuItems($widgetAttributes)
),
),
)
);
?>
<!--
<?php
/*
if (isset($widgetAttributes)) {
echo CHtml::dropDownList(
uniqid('alias'),
Expand Down Expand Up @@ -189,9 +199,9 @@
)
)
);
}
}*/
?>
-->
</div>
</div>
</div>
</div>
</div>

0 comments on commit e409cfa

Please sign in to comment.