confirmation dialog and user wasn't getting saved #52

This commit is contained in:
Nabeel Shahzad
2018-01-08 16:35:52 -06:00
parent 6b265ed67b
commit 4eb5aeebed
4 changed files with 10 additions and 5 deletions

View File

@@ -100,6 +100,7 @@ news:
the release of Letraset sheets containing Lorem Ipsum passages,
and more recently with desktop publishing software like
Aldus PageMaker including versions of Lorem Ipsum.
created_at: now
airports:
- id: KAUS

View File

@@ -46,7 +46,7 @@ class DashboardController extends BaseController
$attrs = $request->post();
$attrs['user_id'] = Auth::user()->id;
$this->newsRepo->create($request->post());
$this->newsRepo->create($attrs);
} elseif ($request->isMethod('delete')) {
$news_id = $request->input('news_id');
$this->newsRepo->delete($news_id);

View File

@@ -23,7 +23,9 @@
{!!
Form::button('delete',
['type' => 'submit',
'class' => ' btn btn-danger btn-xs text-small'])
'class' => ' btn btn-danger btn-xs text-small',
'onclick' => "return confirm('Are you sure?')"
])
!!}
{!! Form::close() !!}

View File

@@ -22,7 +22,9 @@
'method' => 'delete', 'class' => 'pjax_form form-inline']) !!}
{!! Form::hidden('comment_id', $comment->id) !!}
{!! Form::button('<i class="fa fa-times"></i>', ['type' => 'submit',
'class' => 'btn btn-danger btn-small']) !!}
'class' => 'btn btn-danger btn-small',
'onclick' => "return confirm('Are you sure?')",
]) !!}
{!! Form::close() !!}
</td>
</tr>
@@ -31,8 +33,8 @@
</table>
<hr/>
<div class="row">
<div class="col-lg-12">
<div class="input-group input-group-lg pull-right">
<div class="col-sm-12">
<div class="text-right">
{!! Form::open(['url' => url('/admin/pireps/'.$pirep->id.'/comments'),
'method' => 'post', 'class' => 'pjax_form form-inline']) !!}
{!! Form::input('text', 'comment', null, ['class' => 'form-control input-sm']) !!}