Skip to content

Commit

Permalink
edit button now optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Lobz committed Jun 19, 2024
1 parent c5609df commit 43a3ae1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/views/exercicio/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div class="alert alert-info">{{ Session::get('message') }}</div>
@endif
<!-- content -->
@include('exercicio.table')
@include('exercicio.table', ['editButton' => true])
</div>

</div>
Expand Down
8 changes: 7 additions & 1 deletion resources/views/exercicio/table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<thead>
<tr>
<td>Título</td>
<td>Ações</td>
@if ($editButton ?? '')
<td>Ações</td>
@endif
</tr>
</thead>
<tbody>
Expand All @@ -16,14 +18,18 @@
</a>
</td>

@if ($editButton ?? '')
<td>

<!-- edit -->
@if ($editButton ?? '')
@can ('edit', $value)
<a class="btn btn-small btn-edit" href="{{ URL::to('exercicio/' . $value->id . '/edit') }}">Editar</a>
@endcan
@endif

</td>
@endif
</tr>
@endforeach
</tbody>
Expand Down

0 comments on commit 43a3ae1

Please sign in to comment.