diff options
| author | tzur <tzur@ccwn.org> | 2012-04-15 15:30:09 +0200 |
|---|---|---|
| committer | tzur <tzur@ccwn.org> | 2012-04-15 15:30:09 +0200 |
| commit | 5b2095abddf9d0596a7715879357e8d9a3b786b2 (patch) | |
| tree | 0c2b6fdc1484b697b1a3740582a906fb51c1d64f /protected/views/user | |
Initial version
Diffstat (limited to 'protected/views/user')
| -rw-r--r-- | protected/views/user/_form.php | 42 | ||||
| -rw-r--r-- | protected/views/user/_search.php | 44 | ||||
| -rw-r--r-- | protected/views/user/_view.php | 27 | ||||
| -rw-r--r-- | protected/views/user/admin.php | 55 | ||||
| -rw-r--r-- | protected/views/user/create.php | 15 | ||||
| -rw-r--r-- | protected/views/user/index.php | 17 | ||||
| -rw-r--r-- | protected/views/user/update.php | 18 | ||||
| -rw-r--r-- | protected/views/user/view.php | 31 |
8 files changed, 249 insertions, 0 deletions
diff --git a/protected/views/user/_form.php b/protected/views/user/_form.php new file mode 100644 index 0000000..dda3df4 --- /dev/null +++ b/protected/views/user/_form.php @@ -0,0 +1,42 @@ +<div class="form"> + +<?php $form=$this->beginWidget('CActiveForm', array( + 'id'=>'user-form', + 'enableAjaxValidation'=>false, +)); ?> + + <p class="note">Fields with <span class="required">*</span> are required.</p> + + <?php echo $form->errorSummary($model); ?> + + <div class="row"> + <?php echo $form->labelEx($model,'username'); ?> + <?php echo $form->textField($model,'username',array('size'=>60,'maxlength'=>128)); ?> + <?php echo $form->error($model,'username'); ?> + </div> + + <div class="row"> + <?php echo $form->labelEx($model,'password'); ?> + <?php echo $form->passwordField($model,'password',array('size'=>60,'maxlength'=>128, "value"=>"")); ?> + <?php echo $form->error($model,'password'); ?> + </div> + + <div class="row"> + <?php echo $form->labelEx($model,'is_active'); ?> + <?php echo $form->checkbox($model,'is_active'); ?> + <?php echo $form->error($model,'is_active'); ?> + </div> + + <div class="row"> + <?php echo $form->labelEx($model,'is_super_admin'); ?> + <?php echo $form->checkbox($model,'is_super_admin'); ?> + <?php echo $form->error($model,'is_super_admin'); ?> + </div> + + <div class="row buttons"> + <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?> + </div> + +<?php $this->endWidget(); ?> + +</div><!-- form -->
\ No newline at end of file diff --git a/protected/views/user/_search.php b/protected/views/user/_search.php new file mode 100644 index 0000000..77bea16 --- /dev/null +++ b/protected/views/user/_search.php @@ -0,0 +1,44 @@ +<div class="wide form"> + +<?php $form=$this->beginWidget('CActiveForm', array( + 'action'=>Yii::app()->createUrl($this->route), + 'method'=>'get', +)); ?> + + <div class="row"> + <?php echo $form->label($model,'id'); ?> + <?php echo $form->textField($model,'id'); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'username'); ?> + <?php echo $form->textField($model,'username',array('size'=>60,'maxlength'=>128)); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'created_at'); ?> + <?php echo $form->textField($model,'created_at'); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'last_login'); ?> + <?php echo $form->textField($model,'last_login'); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'is_active'); ?> + <?php echo $form->textField($model,'is_active'); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'is_super_admin'); ?> + <?php echo $form->textField($model,'is_super_admin'); ?> + </div> + + <div class="row buttons"> + <?php echo CHtml::submitButton('Search'); ?> + </div> + +<?php $this->endWidget(); ?> + +</div><!-- search-form -->
\ No newline at end of file diff --git a/protected/views/user/_view.php b/protected/views/user/_view.php new file mode 100644 index 0000000..a3106d6 --- /dev/null +++ b/protected/views/user/_view.php @@ -0,0 +1,27 @@ +<div class="view"> + + <b><?php echo CHtml::encode($data->getAttributeLabel('id')); ?>:</b> + <?php echo CHtml::link(CHtml::encode($data->id), array('view', 'id'=>$data->id)); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('username')); ?>:</b> + <?php echo CHtml::encode($data->username); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('created_at')); ?>:</b> + <?php echo CHtml::encode($data->created_at); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('last_login')); ?>:</b> + <?php echo CHtml::encode($data->last_login); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('is_active')); ?>:</b> + <?php echo CHtml::encode($data->is_active); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('is_super_admin')); ?>:</b> + <?php echo CHtml::encode($data->is_super_admin); ?> + <br /> + +</div>
\ No newline at end of file diff --git a/protected/views/user/admin.php b/protected/views/user/admin.php new file mode 100644 index 0000000..90691ce --- /dev/null +++ b/protected/views/user/admin.php @@ -0,0 +1,55 @@ +<?php +$this->breadcrumbs=array( + 'Users'=>array('index'), + 'Manage', +); + +$this->menu=array( + array('label'=>'List User', 'url'=>array('index')), + array('label'=>'Create User', 'url'=>array('create')), +); + +Yii::app()->clientScript->registerScript('search', " +$('.search-button').click(function(){ + $('.search-form').toggle(); + return false; +}); +$('.search-form form').submit(function(){ + $.fn.yiiGridView.update('user-grid', { + data: $(this).serialize() + }); + return false; +}); +"); +?> + +<h1>Manage Users</h1> + +<p> +You may optionally enter a comparison operator (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></b> +or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done. +</p> + +<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?> +<div class="search-form" style="display:none"> +<?php $this->renderPartial('_search',array( + 'model'=>$model, +)); ?> +</div><!-- search-form --> + +<?php $this->widget('zii.widgets.grid.CGridView', array( + 'id'=>'user-grid', + 'dataProvider'=>$model->search(), + 'filter'=>$model, + 'columns'=>array( + 'id', + 'username', + 'created_at', + 'last_login', + 'is_active', + 'is_super_admin', + array( + 'class'=>'CButtonColumn', + ), + ), +)); ?> diff --git a/protected/views/user/create.php b/protected/views/user/create.php new file mode 100644 index 0000000..a0f2ff6 --- /dev/null +++ b/protected/views/user/create.php @@ -0,0 +1,15 @@ +<?php +$this->breadcrumbs=array( + 'Users'=>array('index'), + 'Create', +); + +$this->menu=array( + array('label'=>'List User', 'url'=>array('index')), + array('label'=>'Manage User', 'url'=>array('admin')), +); +?> + +<h1>Create User</h1> + +<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
\ No newline at end of file diff --git a/protected/views/user/index.php b/protected/views/user/index.php new file mode 100644 index 0000000..8c1105b --- /dev/null +++ b/protected/views/user/index.php @@ -0,0 +1,17 @@ +<?php +$this->breadcrumbs=array( + 'Users', +); + +$this->menu=array( + array('label'=>'Create User', 'url'=>array('create')), + array('label'=>'Manage User', 'url'=>array('admin')), +); +?> + +<h1>Users</h1> + +<?php $this->widget('zii.widgets.CListView', array( + 'dataProvider'=>$dataProvider, + 'itemView'=>'_view', +)); ?> diff --git a/protected/views/user/update.php b/protected/views/user/update.php new file mode 100644 index 0000000..569bb5f --- /dev/null +++ b/protected/views/user/update.php @@ -0,0 +1,18 @@ +<?php +$this->breadcrumbs=array( + 'Users'=>array('index'), + $model->id=>array('view','id'=>$model->id), + 'Update', +); + +$this->menu=array( + array('label'=>'List User', 'url'=>array('index')), + array('label'=>'Create User', 'url'=>array('create')), + array('label'=>'View User', 'url'=>array('view', 'id'=>$model->id)), + array('label'=>'Manage User', 'url'=>array('admin')), +); +?> + +<h1>Update User <?php echo $model->id; ?></h1> + +<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
\ No newline at end of file diff --git a/protected/views/user/view.php b/protected/views/user/view.php new file mode 100644 index 0000000..9959b2d --- /dev/null +++ b/protected/views/user/view.php @@ -0,0 +1,31 @@ +<?php +$this->breadcrumbs=array( + 'Users'=>array('index'), + $model->id, +); + +$this->menu=array( + array('label'=>'List User', 'url'=>array('index')), + array('label'=>'Create User', 'url'=>array('create')), + array('label'=>'Update User', 'url'=>array('update', 'id'=>$model->id)), + array('label'=>'Delete User', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')), + array('label'=>'Manage User', 'url'=>array('admin')), +); +?> + +<h1>View User #<?php echo $model->id; ?></h1> + +<?php $this->widget('zii.widgets.CDetailView', array( + 'data'=>$model, + 'attributes'=>array( + 'id', + 'username', + 'algorithm', + 'salt', + 'password', + 'created_at', + 'last_login', + 'is_active', + 'is_super_admin', + ), +)); ?> |
