Skip to content

Commit

Permalink
Added notifications view file out of the box. Updated stubs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Flobbo authored and Flobbo committed Dec 21, 2018
1 parent 3ffb62b commit 2286815
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/Crudable/CrudableServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public function boot(){
__DIR__.'/../config/crudable.php' => config_path('crudable.php'),
__DIR__.'/../resources/lang' => resource_path('lang')
]);
//Add views
$this->loadViewsFrom(__DIR__.'/../resources/views', 'crudable');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/resources/stubs/create.stub
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
{{ csrf_field() }}

<div class="card-header">
<!-- insert title here -->
<h5><!-- insert title here --></h5>
@lang('crud.create_headline')
</div>

<div class="card-body">

{{--@include('admin.notifications')--}}
@include('crudable::notifications')

</div>

Expand Down
4 changes: 2 additions & 2 deletions src/resources/stubs/edit.stub
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
{{method_field('PUT')}}

<div class="card-header">
<!-- insert title here -->
<h5><!-- insert title here --></h5>
@lang('crud.edit_headline')
</div>

<div class="card-body">

{{-- @include('admin.notifications') --}}
@include('crudable::notifications')

</div>

Expand Down
14 changes: 7 additions & 7 deletions src/resources/stubs/index.stub
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@
<div class="card-header">
<div class="row">
<div class="col-sm-6">
<!-- insert title here -->
<h5><!-- insert title here --></h5>
</div>
<div class="col-sm-6">
<a href="{{ route('admin.DummyViewPath.create') }}" class="btn btn-light btn-sm pull-right">
<div class="col-sm-6 text-right">
<a href="{{ route('admin.DummyViewPath.create') }}" class="btn btn-light btn-sm">
@lang('crud.create_button')
</a>
</div>
</div>
</div>

<div class="card-body">
{{-- @include('admin.notifications') --}}
@include('crudable::notifications')
@if($DummyServiceVar->isEmpty())
@lang('crud.no_entries')
@else
<table class="table table-striped">
<thead>
<tr>
<th></th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
@foreach($DummyServiceVar as $DummySingularServiceVar)
<tr>
<td>
<div class="btn-group pull-right" role="group">
<td class="text-right">
<div class="btn-group" role="group">
<a class="btn btn-sm btn-primary" href="{{ route('admin.DummyViewPath.edit',$DummySingularServiceVar->id) }}">
<i class="glyphicon glyphicon-pencil"></i> @lang('crud.edit')
</a>
Expand Down
21 changes: 21 additions & 0 deletions src/resources/views/notifications.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@if (count($errors) > 0)
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
@endif

@if(session()->has('message'))
<div class="alert alert-success alert-dismissible fade show" role="alert">
{{ session('message') }}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
@endif

0 comments on commit 2286815

Please sign in to comment.