Skip to content

Commit

Permalink
[add]記事編集削除権限に合わせてボタンを表示するように調整
Browse files Browse the repository at this point in the history
新規登録に関しては「ログインすれば投稿できる」という説明もかねてそのままにしておく。
  • Loading branch information
inaka-phper committed Sep 9, 2015
1 parent f12f564 commit 4ffdfdb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions laravel/resources/views/post/index.blade.php
Expand Up @@ -33,12 +33,16 @@
<a href="/post/{{ $post->id }}" class="btn btn-default">
<span class="glyphicon glyphicon-search" aria-hidden="true"></span> 表示
</a>
@can('update', $post)
<a href="/post/{{ $post->id }}/edit" class="btn btn-primary">
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> 編集
</a>
@endcan
@can('delete', $post)
<button class="btn btn-danger" data-toggle="modal" data-target="#exampleModal" data-whatever="/post/{{ $post->id }}">
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span> 削除
</button>
@endcan
</td>
</tr>
@empty
Expand Down
4 changes: 4 additions & 0 deletions laravel/resources/views/post/show.blade.php
Expand Up @@ -14,12 +14,16 @@
<div class="panel panel-default">
<div class="panel-body">
<p>{!! nl2br(e($post->content)) !!}</p>
@can('update', $post)
<a href="/post/{{ $post->id }}/edit" class="btn btn-primary">
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> 編集
</a>
@endcan
@can('delete', $post)
<button class="btn btn-danger" data-toggle="modal" data-target="#exampleModal" data-whatever="/post/{{ $post->id }}">
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span> 削除
</button>
@endcan
</div>
</div>
</div>
Expand Down

0 comments on commit 4ffdfdb

Please sign in to comment.