Hide unimplemented feature buttons and indicators with feature flags

This commit is contained in:
2018-08-10 13:32:58 +02:00
parent aceb0453fc
commit c642774316
4 changed files with 41 additions and 15 deletions
+2 -2
View File
@@ -11,7 +11,7 @@
<table class="table table-hover table-sm">
<thead>
<tr>
<th>#</th>
{{--<th>#</th>--}}
@foreach($columns as $col)
<th title="{{$col->name}}">{{ $col->title }}</th>
@endforeach
@@ -20,7 +20,7 @@
<tbody>
@foreach($rows as $row)
<tr>
<td>{{$row->_id}}</td>
{{--<td>{{$row->_id}}</td>--}}
@foreach($columns as $col)
<td>{{ $row->{$col->name} }}</td>
@endforeach
@@ -12,21 +12,26 @@
@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)&nbsp;
{{ $table->forks_count ?: '' }}
</a>
@endif
@if(FEATURE_FAVES)
{{-- Passive favourite buttons with counter --}}
<a href="" class="btn btn-outline-primary py-1 btn-sm" @tooltip(Favourites)>
@icon(fa-star, sr:Favourites)&nbsp;
{{ $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)>
@@ -36,7 +41,9 @@
{{ $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))
@@ -52,20 +59,25 @@
{{ $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)&nbsp;
{{ $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){{ $table->proposals_count ?: '' }}
</a>
@endif
@auth
@if(user()->ownsTable($table))
{{-- Table owner logged in --}}
@@ -73,10 +85,12 @@
@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>