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.
104 lines
3.4 KiB
104 lines
3.4 KiB
{{--
|
|
args: $table
|
|
--}}
|
|
|
|
@php
|
|
/** @var \App\Models\Table $table */
|
|
@endphp
|
|
|
|
<nav aria-label="Table action buttons">
|
|
@sr(Table actions)
|
|
|
|
@if(guest() || !user()->confirmed || user()->ownsTable($table))
|
|
{{-- Guest, unconfirmed, or a table owner --}}
|
|
|
|
@if(FEATURE_FORKS)
|
|
{{-- Passive fork buttons with counter --}}
|
|
<a href="" class="btn btn-outline-primary py-1 btn-sm" @tooltip(Forks)>
|
|
@icon(fa-code-fork, sr:Forks)
|
|
{{ $table->forks_count ?: '–' }}
|
|
</a>
|
|
@endif
|
|
|
|
@if(FEATURE_FAVES)
|
|
{{-- Passive favourite buttons with counter --}}
|
|
<a href="{{ $table->actionRoute('favourites') }}" class="btn btn-outline-primary py-1 btn-sm" @tooltip(Favourites)>
|
|
@icon(fa-star, sr:Favourites)
|
|
{{ $table->favourites_count ?: '–' }}
|
|
</a>
|
|
@endif
|
|
|
|
@else
|
|
{{-- Logged in and does not own the table --}}
|
|
|
|
@if(FEATURE_FORKS)
|
|
{{-- Active fork button | counter --}}
|
|
<div class="btn-group" role="group" aria-label="Fork">
|
|
<a href="" class="btn btn-outline-primary py-1 btn-sm btn-square" @tooltip(Fork)>
|
|
@icon(fa-code-fork, sr:Fork)
|
|
</a>
|
|
<a href="" class="btn btn-outline-primary py-1 btn-sm" @tooltip(Fork Count)>
|
|
{{ $table->forks_count ?: '–' }}
|
|
</a>
|
|
</div>
|
|
@endif
|
|
|
|
@if(FEATURE_FAVES)
|
|
{{-- Active favourite button | counter --}}
|
|
<div class="btn-group" role="group" aria-label="Favourite">
|
|
@if(user()->favouritesTable($table))
|
|
<a href="{{ $table->actionRoute('unfavourite') }}" class="btn btn-outline-primary py-1 btn-sm btn-square" @tooltip(Un-favourite)>
|
|
@icon(fa-star, sr:Un-favourite)
|
|
</a>
|
|
@else
|
|
<a href="{{ $table->actionRoute('favourite') }}" class="btn btn-outline-primary py-1 btn-sm btn-square" @tooltip(Favourite)>
|
|
@icon(fa-star-o, sr:Favourite)
|
|
</a>
|
|
@endif
|
|
<a href="{{ $table->actionRoute('favourites') }}" class="btn btn-outline-primary py-1 btn-sm" @tooltip(Favourite Count)>
|
|
{{ $table->favourites_count ?: '–' }}
|
|
</a>
|
|
</div>
|
|
@endif
|
|
|
|
@endif
|
|
|
|
@if(FEATURE_TABLE_COMMENTS)
|
|
{{-- Comments button with counter --}}
|
|
<a href="" class="btn btn-outline-primary py-1 btn-sm" @tooltip(Comments)>
|
|
@icon(fa-comment, sr:Comments)
|
|
{{ $table->comments_count ?: '–' }}
|
|
</a>
|
|
@endif
|
|
|
|
{{-- Active proposals button | counter --}}
|
|
<div class="btn-group" role="group" aria-label="Fork">
|
|
@if(FEATURE_PROPOSALS)
|
|
<a href="" class="btn btn-outline-primary py-1 btn-sm" @tooltip(Change Proposals)>
|
|
@icon(fa-inbox fa-pr, sr:Change Proposals){{ $proposals_count ?: '–' }}
|
|
</a>
|
|
@endif
|
|
@auth
|
|
@if(user()->ownsTable($table))
|
|
{{-- Table owner logged in --}}
|
|
<a href="{{ $table->draftRoute }}" class="btn btn-outline-primary py-1 btn-sm btn-square" @tooltip(Draft Change)>
|
|
@icon(fa-pencil, sr:Draft Change)
|
|
</a>
|
|
@else
|
|
@if(FEATURE_PROPOSALS)
|
|
{{-- Not a table owner --}}
|
|
<a href="{{ $table->draftRoute }}" class="btn btn-outline-primary py-1 btn-sm btn-square" @tooltip(Propose Change)>
|
|
@icon(fa-pencil, sr:Propose Change)
|
|
</a>
|
|
@endif
|
|
@endif
|
|
@endauth
|
|
</div>
|
|
|
|
@if(authed() && user()->ownsTable($table))
|
|
{{-- Table opts menu for table owner --}}
|
|
<a href="{{ $table->settingsRoute }}" class="btn btn-outline-primary py-1 btn-sm" @tooltip(Table Options)>
|
|
@icon(fa-wrench, sr:Table Options)
|
|
</a>
|
|
@endif
|
|
</nav>
|
|
|