Compare commits

..

No commits in common. "master" and "1.0.0" have entirely different histories.

2 changed files with 10 additions and 13 deletions

View File

@ -5,7 +5,6 @@
"keywords": ["laravel", "admin", "grid", "form"], "keywords": ["laravel", "admin", "grid", "form"],
"homepage": "https://github.com/z-song/laravel-admin", "homepage": "https://github.com/z-song/laravel-admin",
"license": "MIT", "license": "MIT",
"version": "1.0.0",
"authors": [ "authors": [
{ {
"name": "zsong", "name": "zsong",

View File

@ -144,12 +144,12 @@ class Actions extends AbstractDisplayer
$actions = $this->prepends; $actions = $this->prepends;
foreach ($this->actions as $action) { foreach ($this->actions as $action) {
$method = 'render' . ucfirst($action); $method = 'render'.ucfirst($action);
array_push($actions, $this->{$method}()); array_push($actions, $this->{$method}());
} }
$actions = array_merge($actions, $this->appends); $actions = array_merge($actions, $this->appends);
$actions_str = implode('', $actions); $actions_str=implode('', $actions);
return <<<EOT return <<<EOT
<div class="btn-group"> <div class="btn-group">
$actions_str $actions_str
@ -193,7 +193,6 @@ EOT;
$resume_checkout = "<label><input type='checkbox' class='resume_checkout' name='resume_checkout' style='width: 18px;height: 13px;position: relative;top:2px;'>{$tip}</label>"; $resume_checkout = "<label><input type='checkbox' class='resume_checkout' name='resume_checkout' style='width: 18px;height: 13px;position: relative;top:2px;'>{$tip}</label>";
return $resume_checkout; return $resume_checkout;
} }
/** /**
* Render delete action. * Render delete action.
* *
@ -202,22 +201,21 @@ EOT;
protected function renderDelete() protected function renderDelete()
{ {
$title = ''; $title = '';
$url_pams = []; $url_pams = '';
if (strstr($this->getResource(), 'firm/company') && !(strstr($this->getResource(), 'firm/companyimg')) && !(strstr($this->getResource(), 'firm/companysetmeal'))) { if(strstr($this->getResource(),'firm/company') && !(strstr($this->getResource(),'firm/companyimg'))&& !(strstr($this->getResource(),'firm/companysetmeal'))) {
$deleteConfirm = trans('admin.delete_company_confirm'); $deleteConfirm = trans('admin.delete_company_confirm');
} elseif (strstr($this->getResource(), 'personal/members')) { }elseif (strstr($this->getResource(),'personal/members')) {
$deleteConfirm = trans('admin.delete_person_confirm'); $deleteConfirm = trans('admin.delete_person_confirm');
} elseif (strstr($this->getResource(), 'recycle/index')) { } elseif (strstr($this->getResource(),'recycle/index')){
$scope = array_get(request()->all(), 'scope', 1); $scope = array_get(request()->all(),'scope',1);
$url_pams['scope'] = $scope; $url_pams='?scope='.$scope;
$deleteConfirm = trans('admin.delete_confirm'); $deleteConfirm = trans('admin.delete_confirm');
} elseif (strstr($this->getResource(), 'personal/resume')) { }elseif (strstr($this->getResource(),'personal/resume')){
$deleteConfirm = trans('admin.delete_confirm'); $deleteConfirm = trans('admin.delete_confirm');
$title = $this->resume_checkout(); $title = $this->resume_checkout();
} else { } else {
$deleteConfirm = trans('admin.delete_confirm'); $deleteConfirm = trans('admin.delete_confirm');
} }
$url_pams = empty(http_build_query($url_pams)) ? '' : '&' . http_build_query($url_pams);
$confirm = trans('admin.confirm'); $confirm = trans('admin.confirm');
$cancel = trans('admin.cancel'); $cancel = trans('admin.cancel');
$script = <<<SCRIPT $script = <<<SCRIPT
@ -241,7 +239,7 @@ function render_action_delete() {
return new Promise(function(resolve) { return new Promise(function(resolve) {
$.ajax({ $.ajax({
method: 'post', method: 'post',
url: '{$this->getResource()}/' + id +'?is_resume='+is_resume+'{$url_pams}', url: '{$this->getResource()}/' + id +'$url_pams'+'?is_resume='+is_resume,
data: { data: {
_method:'delete', _method:'delete',
_token:LA.token, _token:LA.token,