|
|
@ -24,19 +24,20 @@ |
|
|
|
<h2>Table Revisions</h2> |
|
|
|
<h2>Table Revisions</h2> |
|
|
|
|
|
|
|
|
|
|
|
@php |
|
|
|
@php |
|
|
|
$revIds = $revisions->pluck('id'); |
|
|
|
$revIds = $revisions->pluck('id')->reverse()->values(); |
|
|
|
@endphp |
|
|
|
@endphp |
|
|
|
|
|
|
|
|
|
|
|
@foreach($revisions as $i => $revision) |
|
|
|
@foreach($revisions as $i => $revision) |
|
|
|
@php |
|
|
|
@php |
|
|
|
$num = count($revisions) - $i; |
|
|
|
$num = count($revisions) - $i; |
|
|
|
|
|
|
|
$isCurrent = $revision->id == $table->revision_id; |
|
|
|
@endphp |
|
|
|
@endphp |
|
|
|
<div class="x-revision rounded border box-shadow mb-3 p-2" id="revision-{{$revision->id}}"> |
|
|
|
<div class="x-revision rounded border box-shadow mb-3 p-2" id="revision-{{$revision->id}}"> |
|
|
|
<div class="row"> |
|
|
|
<div class="row"> |
|
|
|
<div class="col-md-8"> |
|
|
|
<div class="col-md-8"> |
|
|
|
#{{$num}} |
|
|
|
#{{$num}} |
|
|
|
– {{ $revision->created_at->format('Y-m-d, G:i:s') }} |
|
|
|
– {{ $revision->created_at->format('Y-m-d, G:i:s') }} |
|
|
|
@if($i == 0) |
|
|
|
@if($isCurrent) |
|
|
|
<span class="text-muted ml-1">(current)</span> |
|
|
|
<span class="text-muted ml-1">(current)</span> |
|
|
|
@else |
|
|
|
@else |
|
|
|
<span class="text-muted ml-1"> |
|
|
|
<span class="text-muted ml-1"> |
|
|
@ -47,7 +48,7 @@ |
|
|
|
<div class="col-md-4 text-right"> |
|
|
|
<div class="col-md-4 text-right"> |
|
|
|
@if($revision->ancestor_id) |
|
|
|
@if($revision->ancestor_id) |
|
|
|
@if ($revIds->contains($revision->ancestor_id)) |
|
|
|
@if ($revIds->contains($revision->ancestor_id)) |
|
|
|
<span class="x-revision-link text-muted" data-id="{{$revision->ancestor_id}}">Show parent</span> |
|
|
|
<span class="x-revision-link text-muted" data-id="{{$revision->ancestor_id}}">Based on #{{ 1+$revIds->search($revision->ancestor_id) }}</span> |
|
|
|
@else |
|
|
|
@else |
|
|
|
<span class="text-muted">Forked from elsewhere</span> |
|
|
|
<span class="text-muted">Forked from elsewhere</span> |
|
|
|
@endif |
|
|
|
@endif |
|
|
@ -56,36 +57,17 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="row"> |
|
|
|
<div class="row"> |
|
|
|
<div class="col-md-12" style="font-size:140%;"> |
|
|
|
<div class="col-md-10" style="font-size:140%;"> |
|
|
|
{{ $revision->note }} |
|
|
|
{{ $revision->note }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="col-md-2 text-right"> |
|
|
|
|
|
|
|
@if(!$isCurrent && user()->ownsTable($table)) |
|
|
|
|
|
|
|
<a href="{{$table->actionRoute('revert-to', ['rev' => $num])}}" class="btn btn-outline-secondary btn-sm">Set as current</a> |
|
|
|
|
|
|
|
@endif |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@endforeach |
|
|
|
@endforeach |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
@endsection |
|
|
|
@endsection |
|
|
|
|
|
|
|
|
|
|
|
@push('scripts') |
|
|
|
|
|
|
|
<style> |
|
|
|
|
|
|
|
.x-revision.highlight { |
|
|
|
|
|
|
|
background: #a5d5ff; |
|
|
|
|
|
|
|
border-color: #a5d5ff; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.x-revision-link { |
|
|
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
|
|
ready(function() { |
|
|
|
|
|
|
|
$('.x-revision-link').on('mouseenter', function () { |
|
|
|
|
|
|
|
$('#revision-'+$(this).data('id')).addClass('highlight'); |
|
|
|
|
|
|
|
}).on('mouseleave', function () { |
|
|
|
|
|
|
|
$('#revision-'+$(this).data('id')).removeClass('highlight'); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
@endpush |
|
|
|
|
|
|
|