datatable.directory codebase
https://datatable.directory/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.4 KiB
69 lines
2.4 KiB
{{-- List of table revisions --}}
|
|
|
|
@extends('layouts.app')
|
|
@section('title', "Revisions - $table->title")
|
|
|
|
@php
|
|
/** @var \App\Models\Table $table */
|
|
/** @var \App\Models\Revision[]|\Illuminate\Support\Collection $revisions */
|
|
@endphp
|
|
|
|
@section('content')
|
|
@include('table._table-subpage-header')
|
|
|
|
<div class="row px-3 border-top pt-3">
|
|
<div class="col-md-12">
|
|
<h2>Table Revisions</h2>
|
|
|
|
@php
|
|
$revIds = $revisions->pluck('id')->reverse()->values();
|
|
@endphp
|
|
|
|
@foreach($revisions as $i => $revision)
|
|
@php
|
|
$num = count($revisions) - $i;
|
|
$isCurrent = $revision->id == $table->revision_id;
|
|
@endphp
|
|
<div class="x-revision rounded border box-shadow mb-3 p-2" id="revision-{{$revision->id}}">
|
|
<div class="row">
|
|
<div class="col-md-8">
|
|
#{{$num}} –
|
|
<span title="{{$revision->created_at->format('Y-m-d, G:i:s')}}">
|
|
{{ $revision->created_at->diffForHumans() }}
|
|
</span>
|
|
@if($isCurrent)
|
|
<span class="text-muted ml-1">
|
|
(<a class="link-no-color" href="{{ $table->viewRoute }}">current</a>)
|
|
</span>
|
|
@else
|
|
<span class="text-muted ml-1">
|
|
(<a class="link-no-color" href="{{ $table->viewRoute }}?rev={{$num}}">see table in this revision</a>)
|
|
</span>
|
|
@endif
|
|
</div>
|
|
<div class="col-md-4 text-right">
|
|
@if($revision->ancestor_id)
|
|
@if ($revIds->contains($revision->ancestor_id))
|
|
<span class="x-revision-link text-muted" data-id="{{$revision->ancestor_id}}">Based on #{{ 1+$revIds->search($revision->ancestor_id) }}</span>
|
|
@else
|
|
<span class="text-muted">Forked from elsewhere</span>
|
|
@endif
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-10" style="font-size:140%;">
|
|
{{ $revision->note }}
|
|
</div>
|
|
<div class="col-md-2 text-right">
|
|
@if(!$isCurrent && authed() && 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>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|