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-action-buttons.blade.php

91 lines
3.0 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))
7 years ago
{{-- Guest, unconfirmed, or a table owner --}}
{{-- Passive fork buttons with counter --}}
<a href="" class="btn btn-outline-primary py-1 btn-sm" @tooltip(Forks)>
7 years ago
@icon(fa-code-fork, sr:Forks)&nbsp;
{{ $table->forks_count ?: '–' }}
</a>
{{-- Passive favourite buttons with counter --}}
<a href="" class="btn btn-outline-primary py-1 btn-sm" @tooltip(Favourites)>
7 years ago
@icon(fa-star, sr:Favourites)&nbsp;
{{ $table->favourites_count ?: '–' }}
</a>
@else
7 years ago
{{-- Logged in and does not own the table --}}
{{-- 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>
{{-- Active favourite button | counter --}}
<div class="btn-group" role="group" aria-label="Favourite">
@if(user()->favouritesTable($table))
<a href="" class="btn btn-outline-primary py-1 btn-sm btn-square" @tooltip(Un-favourite)>
@icon(fa-star, sr:Un-favourite)
</a>
@else
<a href="" class="btn btn-outline-primary py-1 btn-sm btn-square" @tooltip(Favourite)>
@icon(fa-star-o, sr:Favourite)
</a>
@endif
<a href="" class="btn btn-outline-primary py-1 btn-sm" @tooltip(Favourite Count)>
{{ $table->favourites_count ?: '–' }}
</a>
</div>
@endif
{{-- Comments button with counter --}}
<a href="" class="btn btn-outline-primary py-1 btn-sm" @tooltip(Comments)>
7 years ago
@icon(fa-comment, sr:Comments)&nbsp;
{{ $table->comments_count ?: '–' }}
</a>
{{-- Active proposals button | counter --}}
<div class="btn-group" role="group" aria-label="Fork">
<a href="" class="btn btn-outline-primary py-1 btn-sm" @tooltip(Change Proposals)>
@icon(fa-inbox fa-pr, sr:Change Proposals){{ $table->proposals_count ?: '–' }}
</a>
7 years ago
@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)>
7 years ago
@icon(fa-pencil, sr:Draft Change)
</a>
@else
{{-- Not a table owner --}}
<a href="{{ $table->draftRoute }}" class="btn btn-outline-primary py-1 btn-sm btn-square" @tooltip(Propose Change)>
7 years ago
@icon(fa-pencil, sr:Propose Change)
</a>
@endif
@endauth
</div>
7 years ago
@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>