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.
datatable.directory/resources/views/table/view.blade.php

108 lines
2.8 KiB

{{-- Basic table view --}}
@extends('layouts.app')
@php
/** @var \App\Models\Table $table */
@endphp
@section('content')
<div class="row justify-content-start px-3">
<h2 class="d-flex w-100 align-items-baseline">
<small class="small2 flex-grow-1">
<a href="{{route('profile.view', $table->owner->name)}}" class="link-no-color">{{ $table->owner->handle }}</a>{{--
--}}<span class="px-1">/</span>{{--
--}}{{ $table->name }}
</small>
<span class="">{{ $table->title }}</span>
</h2>
6 years ago
</div>
<div class="row mx-auto col-md-12 justify-content-center mb-1 border rounded px-0 py-2 box-shadow mb-3">
<div class="col-md-6">
@if($table->description)
<b>Description</b>
{!! Widget::collapsible($table->description, 400, '8em') !!}
@endif
@if($table->origin)
<p class="last-p-mb-0">
<b>Source</b><br>
@icon(fa-link){!! Widget::tryLink($table->origin) !!}
</p>
@endif
</div>
<div class="col-md-4 border-left">
<table>
<tbody>
<tr>
<th class="text-right pr-2">Author</th>
<td>
{{ $table->owner->title }}
(<a href="{{route('profile.view', $table->owner->name)}}">{{ $table->owner->handle }}</a>)
</td>
</tr>
<tr>
<th class="text-right pr-2">License</th>
<td>{{ $table->license ?: 'CC0' }}</td>
</tr>
<tr>
<th class="text-right pr-2">Created</th>
<td>{{ $table->created_at->format("M j, Y") }}</td>
</tr>
<tr>
<th class="text-right pr-2">Updated</th>
<td>{{ $table->updated_at->format("M j, Y") }}</td>
</tr>
<tr>
<th class="text-right pr-2">Revisions</th>
<td>{{ $table->revisions()->count() }}</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-2 border-left">
Right Column with buttons etc, maybe
</div>
</div>
<div class="row justify-content-center mb-2">
<div class="col-md-12 d-flex">
<nav class="text-center ml-auto" aria-label="Pages of the table">
{{ $rows->links(null, ['ulClass' => 'mb-0']) }}
</nav>
</div>
</div>
<div class="row justify-content-center">
<div class="col-12">
6 years ago
<table class="table table-hover table-sm">
<thead>
<tr>
@foreach($columns as $col)
<th>{{ $col->title }}</th>
@endforeach
</tr>
</thead>
<tbody>
@foreach($rows as $row)
<tr>
@php($rdata = json_decode($row['data'], true))
@foreach($columns as $col)
<td data-id="{{ $row->id }}">{{ $rdata[$col->name] }}</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection