add table viewing page
This commit is contained in:
@@ -38,7 +38,9 @@
|
||||
<span class="list-group-item">No tables yet.</span>
|
||||
@else
|
||||
@foreach($tables as $table)
|
||||
<a class="list-group-item list-group-item-action" href="">{{ $table->title }}</a>
|
||||
<a class="list-group-item list-group-item-action" href="{{route('table.view', ['user' => Auth::user()->name, 'table' => $table->name])}}">{{
|
||||
$table->title
|
||||
}}</a>
|
||||
@endforeach
|
||||
{{ $tables->links() }}
|
||||
@endif
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
@csrf
|
||||
<div class="col-md-8">
|
||||
{!! Widget::text('title', 'Title')->autoAlias('name', '-')
|
||||
->help('Unique among your tables') !!}
|
||||
|
||||
{!! Widget::text('name', 'Name')->value('molluscs-'.uniqid())
|
||||
->help('Unique among your tables, and part of the URL; only letters, digits and
|
||||
some symbols are allowed.') !!}
|
||||
|
||||
{!! Widget::text('title', 'Title')
|
||||
->help('Unique among your tables') !!}
|
||||
|
||||
{!! Widget::textarea('description', 'Description')->height('8em')
|
||||
->help('Description what data is in the table. Please use the dedicated
|
||||
fields for License and data source. URLs in a full format will be clickable.') !!}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@php
|
||||
/** @var \App\Models\Table $table */
|
||||
@endphp
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<h2>{{ $table->title }}</h2>
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
|
||||
<div class="col-md-8">
|
||||
<table class="table table-hover table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
@foreach($columns as $col)
|
||||
<th>{{ $col->title }}</th>
|
||||
@endforeach
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($rows as $row)
|
||||
<tr>
|
||||
<td>#{{ $row->id }}</td>
|
||||
@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>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user