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/profile/_table-list.blade.php

66 lines
2.3 KiB

@php
if (!isset($showAuthors)) $showAuthors = false;
@endphp
@php
/** @var \App\Models\Table[] $tables */
@endphp
<div class="list-group list-group-flush">
@if(count($tables) == 0)
<span class="list-group-item">No tables yet.</span>
@else
@foreach($tables as $table)
@php
$forks = $table->forks_count;
$faves = $table->favourites_count;
$revs = $table->revisions_count;
$rows = $table->revision->row_count;
@endphp
<a class="list-group-item list-group-item-action"
href="{{$table->viewRoute}}">
<span class="row">{{-- this must be span so that Lynx includes the table name in the anchor --}}
<span class="d-block col-7 flex-grow-1">
@icon(fa-table fa-pr){!!
$showAuthors ? (e($table->owner->handle) . '<span class="px-1">/</span>') : ''
!!}<b>{{ $table->title }}</b>
</span>
<div class="d-flex justify-content-end col-5 small text-right">
<span title="Visits" class="d-inline-block pl-2" style="min-width: 50px;">
{{ $table->visits }}@icon(fa-eye fa-pl, ~Visits~~)
</span>
@if(FEATURE_FORKS)
<span title="Forks" class="d-inline-block pl-2 {{$forks==0?'hidden':''}}" style="min-width: 50px;">
{{ $forks }}@icon(fa-code-fork fa-pl, ~Forks~~)
</span>
@endif
@if(FEATURE_FAVES)
<span title="Favourites" class="d-inline-block pl-2 {{$faves==0?'hidden':''}}" style="min-width: 50px;">
{{ $faves }}@icon(fa-star fa-pl, ~Favourites~~)
</span>
@endif
<span title="Revisions" class="d-inline-block pl-2" style="min-width: 50px;">
{{ $revs }}@icon(fa-history fa-pl, ~Revisions~~)
</span>
<span title="Rows" class="d-inline-block pl-2" style="min-width: 50px;">
{{ $rows }}@icon(fa-th-list fa-pl, ~Rows)
</span>
</div>
</span>
<div class="small row">
<div class="d-inline-block col-8">
@sr(Description:~){{ ellipsis($table->description, 215) }}
</div>{{--
--}}<div class="d-inline-block col-4 text-right text-muted">
Last change {{ $table->updated_at->diffForHumans() }}
</div>
</div>
</a>
@endforeach
@endif
</div>