This commit is contained in:
Hillel Coren 2015-12-09 17:54:24 +02:00
parent 0aca2e7fb4
commit 3a5f2ebaf7

View File

@ -41,18 +41,18 @@ class DatatableService
private function createDropdown($entityType, $table, $actions) private function createDropdown($entityType, $table, $actions)
{ {
$table->addColumn('dropdown', function ($model) use ($entityType, $actions) { $table->addColumn('dropdown', function ($model) use ($entityType, $actions) {
$str = ''; $str = '<center>';
if (property_exists($model, 'is_deleted') && $model->is_deleted) { if (property_exists($model, 'is_deleted') && $model->is_deleted) {
$str .= '<button type="button" class="btn btn-sm btn-danger tr-status" style="display:inline-block; width:80px">'.trans('texts.deleted').'</button>'; $str .= '<button type="button" class="btn btn-sm btn-danger tr-status" style="display:inline-block; width:100px">'.trans('texts.deleted').'</button>';
} elseif ($model->deleted_at && $model->deleted_at !== '0000-00-00') { } elseif ($model->deleted_at && $model->deleted_at !== '0000-00-00') {
$str .= '<button type="button" class="btn btn-sm btn-warning tr-status" style="display:inline-block; width:80px">'.trans('texts.archived').'</button>'; $str .= '<button type="button" class="btn btn-sm btn-warning tr-status" style="display:inline-block; width:100px">'.trans('texts.archived').'</button>';
} else { } else {
$str .= '<div class="tr-status" style="display:inline-block; width:80px"></div>'; $str .= '<div class="tr-status" style="display:inline-block; width:100px"></div>';
} }
$str .= '<div class="btn-group tr-action" style="display:none;"> $str .= '<div class="btn-group tr-action" style="display:none;">
<button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown" style="width:80px"> <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown" style="width:100px">
'.trans('texts.select').' <span class="caret"></span> '.trans('texts.select').' <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu" role="menu">'; <ul class="dropdown-menu" role="menu">';
@ -95,7 +95,7 @@ class DatatableService
. trans("texts.delete_{$entityType}") . "</a></li>"; . trans("texts.delete_{$entityType}") . "</a></li>";
} }
return $str.'</ul></div>'; return $str.'</ul></div></center>';
}); });
} }