revisions.blade.php
913 Bytes
@if (isset($comment->meta['revision']))
<div class="comment-history comment-body" data-commentId="{!! $comment->id !!}">
<div class="comment-history-header">Showing previous versions of this text.</div>
@foreach ($comment->meta['revision'] as $revision)
<?php
// we need to convert tabs (/s is basically a space) into spaces for legal json
$revision = preg_replace('/\s/', ' ', $revision);
$revision = json_decode($revision);
?>
@if ($revision)
<article class="comment-revision">
@if (isset($revision->date))
<div class="comment-revision-time">
<time class="timeago" datetime="{!! date('c', strtotime($revision->date)) !!}">
{!! $revision->date !!}
</time>
</div>
@endif
<div class="{!! $revisionClass !!}">{!! $revision->content !!}</div>
</article>
@endif
@endforeach
</div>
@endif