Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin forms layout fills screen width #2108

Draft
wants to merge 12 commits into
base: develop
Choose a base branch
from
Prev Previous commit
Next Next commit
feat: admin dataset project form
luistoptal committed Nov 23, 2024

Verified

This commit was signed with the committer’s verified signature.
commit 36fd6a7a3277bc858f9e510affe17787e95517d1
95 changes: 52 additions & 43 deletions protected/views/adminDatasetProject/_form.php
Original file line number Diff line number Diff line change
@@ -1,55 +1,64 @@
<div class="section form row">
<div class="section form">
<?php $form = $this->beginWidget('CActiveForm', array(
'id' => 'dataset-project-form',
'enableAjaxValidation' => false,
'htmlOptions' => [
'class' => 'row'
]
)); ?>

<div class="col-md-offset-3 col-md-6">
<?php $form = $this->beginWidget('CActiveForm', array(
'id' => 'dataset-project-form',
'enableAjaxValidation' => false,
)); ?>

<?php if ($model->hasErrors()) : ?>
<?php if ($model->hasErrors()) : ?>
<div class="col-md-12">
<div class="alert alert-danger">
<?php echo $form->errorSummary($model); ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>

<?php
$this->widget('application.components.controls.DropdownField', [
'form' => $form,
'model' => $model,
'attributeName' => 'dataset_id',
'listDataOptions' => [
'data' => Util::getDois(),
'valueField' => 'id',
'textField' => 'identifier',
],
'inputOptions' => [
'required' => true,
],
]);
?>
<?php
$this->widget('application.components.controls.DropdownField', [
'form' => $form,
'model' => $model,
'attributeName' => 'dataset_id',
'listDataOptions' => [
'data' => Util::getDois(),
'valueField' => 'id',
'textField' => 'identifier',
],
'inputOptions' => [
'required' => true,
],
'groupOptions' => [
'class' => 'col-md-6'
],
]);
?>

<?php
$this->widget('application.components.controls.DropdownField', [
'form' => $form,
'model' => $model,
'attributeName' => 'project_id',
'listDataOptions' => [
'data' => Project::model()->findAll(),
'valueField' => 'id',
'textField' => 'name',
],
'inputOptions' => [
'required' => true,
],
]);
?>
<?php
$this->widget('application.components.controls.DropdownField', [
'form' => $form,
'model' => $model,
'attributeName' => 'project_id',
'listDataOptions' => [
'data' => Project::model()->findAll(),
'valueField' => 'id',
'textField' => 'name',
],
'inputOptions' => [
'required' => true,
],
'groupOptions' => [
'class' => 'col-md-6'
],
]);
?>

<div class="col-md-12">
<div class="pull-right btns-row">
<a href="/adminDatasetProject/admin" class="btn background-btn-o">Cancel</a>
<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array('class' => 'btn background-btn')); ?>
<a href="/adminDatasetProject/admin" class="btn background-btn-o btn-min-width">Cancel</a>
<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array('class' => 'btn background-btn btn-min-width')); ?>
</div>

<?php $this->endWidget(); ?>
</div>

<?php $this->endWidget(); ?>
</div>