Skip to content

Commit

Permalink
Migrate to new version of Bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Shevchuk authored and Anton Shevchuk committed Sep 29, 2017
1 parent ebea677 commit e0b0bec
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 35 deletions.
34 changes: 17 additions & 17 deletions application/modules/options/views/crud.phtml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
<?php /** @var \Application\Options\Row $row */ ?>
<?php $uid = uniqid('form_'); ?>
<?php $uid = uniqid('form_', false); ?>
<form id="<?=$uid?>" action="<?=$this->url('options', 'crud')?>" class="form-horizontal ajax" method="POST">
<input type="hidden" name="_method" value="<?=$method?>"/>
<?php if ($method != 'POST') : ?>
<?php if ($method !== 'POST') : ?>
<input type="hidden" name="namespace" value="<?=esc($row->namespace)?:'default'?>"/>
<input type="hidden" name="key" value="<?=esc($row->key)?>"/>
<?php endif; ?>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title"><?=__('Options')?></h4>
<h4 class="modal-title"><?=__('Options')?></h4>
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<div class="modal-body">
<?php if ($method === 'PUT') :?>
<div class="form-group">
<label class="control-label col-lg-2" for="author"><?=__('Author')?></label>
<div class="col-lg-10">
<div class="form-group row">
<label class="control-label col-lg-4" for="author"><?=__('Author')?></label>
<div class="col-lg-8">
<input type="text" class="form-control" id="author" name="author" value="<?=\Application\Users\Table::findRow($row->userId)->login;?>" disabled />
</div>
</div>
<?php endif; ?>
<div class="form-group">
<label class="control-label col-lg-2" for="namespace"><?=__('Namespace')?></label>
<div class="col-lg-10">
<div class="form-group row">
<label class="control-label col-lg-4" for="namespace"><?=__('Namespace')?></label>
<div class="col-lg-8">
<input type="text" class="form-control" id="namespace" name="namespace" value="<?=esc($row->namespace)?:'default'?>" <?=($method !== 'POST')?'disabled':''?> required />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-2" for="key"><?=__('Key name')?></label>
<div class="col-lg-10">
<div class="form-group row">
<label class="control-label col-lg-4" for="key"><?=__('Key name')?></label>
<div class="col-lg-8">
<input type="text" class="form-control" id="key" name="key" value="<?=esc($row->key)?>" <?=($method !== 'POST')?'disabled':''?> />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-2" for="value"><?=__('Key value')?></label>
<div class="col-lg-10">
<div class="form-group row">
<label class="control-label col-lg-4" for="value"><?=__('Key value')?></label>
<div class="col-lg-8">
<?php $value = $row->value; ?>
<?php if (is_array($value)) : ?>
<input type="text" class="form-control" id="value" name="value" disabled value="<?=__('Array (length=%d)', count($value));?>"/>
Expand All @@ -44,7 +44,7 @@
<?php endif; ?>
</div>
</div>
<div class="form-group">
<div class="form-group row">
<div class="col-lg-12">
<label class="control-label" for="description"><?=__('Description')?></label>
<textarea class="form-control" id="description" name="description"><?=esc($row->description)?></textarea>
Expand Down
27 changes: 9 additions & 18 deletions application/modules/options/views/grid.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,28 @@ if (!$grid) return;
// use data-spy="grid" for use AJAX for reload grid
require(['bluz.grid']);
</script>

<nav class="navbar navbar-default" role="navigation">
<div class="col-lg-6">
<a href="<?=$this->url('options', 'crud')?>" class="btn btn-primary navbar-btn dialog" data-ajax-method="get"><?=__('Create')?></a>
</div>
<div class="col-lg-6">

</div>
<nav class="navbar navbar-light bg-light">
<a href="<?=$this->url('options', 'crud')?>" class="btn btn-primary navbar-btn dialog" data-ajax-method="get"><?=__('Create')?></a>
</nav>

<hr/>
<?=$this->partial('grid/total.phtml', ['grid'=>$grid]) ?>
<?=$this->partial('grid/limit.phtml', ['grid'=>$grid]) ?>

<table class="table table-striped table-hover">
<thead>
<tr>
<th width="80px"><a href="<?=$grid->order('namespace')?>"><?=__('Space')?></a></th>
<th width="160px"><a href="<?=$grid->order('key')?>"><?=__('Key')?></a></th>
<th><a href="<?=$grid->order('value')?>"><?=__('Value')?></a></th>
<th width="160px"><a href="<?=$grid->order('created')?>"><?=__('Created')?></a></th>
<th width="160px"><a href="<?=$grid->order('updated')?>"><?=__('Updated')?></a></th>
<th width="72px"></th>
<th width="180px"><a href="<?=$grid->order('created')?>"><?=__('Created')?></a></th>
<th width="180px"><a href="<?=$grid->order('updated')?>"><?=__('Updated')?></a></th>
<th width="120px"></th>
</tr>
</thead>
<tbody>
<?php foreach($grid->getData() as $row) : ?>
<tr>
<td><span class="label label-info"><?=$row['namespace']?></span></td>
<td><span class="bluz-tooltip" data-toggle="tooltip" title="<?=esc($row['description'])?>"><?=esc($row['key'])?></span></td>
<td><span class="badge badge-info"><?=$row['namespace']?></span></td>
<td><span title="<?=esc($row['description'])?>"><?=esc($row['key'])?></span></td>
<td>
<?php
$value = unserialize($row['value'], ['allow_classes' => false]);
Expand Down Expand Up @@ -66,9 +59,7 @@ if (!$grid) return;
<?php endforeach; ?>
</tbody>
</table>

<?=$this->partial('grid/empty-rows.phtml', ['grid'=>$grid]) ?>
<?=$this->partial('grid/pagination.phtml', ['grid'=>$grid]) ?>
<?=$this->partial('grid/total.phtml', ['grid'=>$grid]) ?>

</div>
</div>

0 comments on commit e0b0bec

Please sign in to comment.