Skip to content

Commit

Permalink
close #1379 Fixed: App delete link show wrong name
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Mar 25, 2020
1 parent e3e775d commit da5f7f5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
13 changes: 12 additions & 1 deletion resources/views/partials/form/delete_button.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,22 @@
}
$text = $text ? $text : $page;
$title = trans_choice('general.' . $text, 2);
$type = mb_strtolower(trans_choice('general.' . $text, 1));
// for module
if (\Str::contains($text, ['::'])) {
$title = trans_choice($text, 2);
$type = mb_strtolower(trans_choice($text, 1));
}
$message = trans('general.delete_confirm', ['name' => '<strong>' . $name . '</strong>', 'type' => $type]);
@endphp

{!! Form::button('<i class="fa fa-trash-o" aria-hidden="true"></i> ' . trans('general.delete'), array(
'type' => 'button',
'class' => 'btn btn-danger btn-xs',
'title' => trans('general.delete'),
'@click' => 'confirmDelete("' . $url . '", "' . trans_choice('general.' . $text, 2) . '", "' . trans('general.delete_confirm', ['name' => '<strong>' . $item->$value . '</strong>', 'type' => mb_strtolower(trans_choice('general.' . $text, 1))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")'
'@click' => 'confirmDelete("' . $url . '", "' . $title . '", "' . $message . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")'
)) !!}
13 changes: 12 additions & 1 deletion resources/views/partials/form/delete_link.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,22 @@
$text = $text ? $text : $page;
$name = addslashes($item->$value);
$title = trans_choice('general.' . $text, 2);
$type = mb_strtolower(trans_choice('general.' . $text, 1));
// for module
if (\Str::contains($text, ['::'])) {
$title = trans_choice($text, 2);
$type = mb_strtolower(trans_choice($text, 1));
}
$message = trans('general.delete_confirm', ['name' => '<strong>' . $name . '</strong>', 'type' => $type]);
@endphp

{!! Form::button(trans('general.delete'), array(
'type' => 'button',
'class' => 'dropdown-item action-delete',
'title' => trans('general.delete'),
'@click' => 'confirmDelete("' . $url . '", "' . trans_choice('general.' . $text, 2) . '", "' . trans('general.delete_confirm', ['name' => '<strong>' . $name . '</strong>', 'type' => mb_strtolower(trans_choice('general.' . $text, 1))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")'
'@click' => 'confirmDelete("' . $url . '", "' . $title . '", "' . $message . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")'
)) !!}

0 comments on commit da5f7f5

Please sign in to comment.