laravel-learn-bbs/resources/views/topics/_reply_list.blade.php

39 lines
1.7 KiB
PHP
Raw Permalink Normal View History

2018-01-15 15:24:11 +00:00
<div class="reply-list">
@foreach ($replies as $index => $reply)
<div class=" media" name="reply{{ $reply->id }}" id="reply{{ $reply->id }}">
<div class="avatar pull-left">
<a href="{{ route('users.show', [$reply->user_id]) }}">
<img class="media-object img-thumbnail" alt="{{ $reply->user->name }}"
src="{{ $reply->user->avatar }}" style="width:48px;height:48px;"/>
</a>
</div>
<div class="infos">
<div class="media-heading">
<a href="{{ route('users.show', [$reply->user_id]) }}" title="{{ $reply->user->name }}">
{{ $reply->user->name }}
</a>
<span> </span>
<span class="meta" title="{{ $reply->created_at }}">{{ $reply->created_at->diffForHumans() }}</span>
{{-- 回复删除按钮 --}}
2018-01-31 15:00:57 +00:00
@can('destroy',$reply)
<span class="meta pull-right">
<form action="{{route('replies.destroy',$reply->id)}}" method="post">
{{csrf_field()}}
{{method_field('DELETE')}}
<button type="submit" class="btn btn-default btn-xs pull-left">
<i class="glyphicon glyphicon-trash"></i>
</button>
</form>
</span>
@endcan
2018-01-15 15:24:11 +00:00
</div>
<div class="reply-content">
{!! $reply->content !!}
</div>
</div>
</div>
<hr>
@endforeach
</div>