diff --git a/app/helpers.php b/app/helpers.php index 87537e7..eb39c42 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -6,6 +6,11 @@ const VALI_EMAIL = 'string|email|max:255'; const VALI_TEXT = 'string|max:4095'; const VALI_LINE = 'string|max:255'; +const FEATURE_FORKS = false; +const FEATURE_FAVES = false; +const FEATURE_TABLE_COMMENTS = false; +const FEATURE_PROPOSALS = false; + // global helpers function authed() { return ! \Auth::guest(); diff --git a/resources/views/profile/_table-list.blade.php b/resources/views/profile/_table-list.blade.php index 3ebeb92..391947c 100644 --- a/resources/views/profile/_table-list.blade.php +++ b/resources/views/profile/_table-list.blade.php @@ -24,24 +24,31 @@ @icon(fa-table fa-pr){!! $showAuthors ? (e($table->owner->handle) . '/') : '' !!}{{ $table->title }} - {{-- - --}}
{{-- - --}} + +
+ {{ $table->visits }}@icon(fa-eye fa-pl, ~Visits~~) - {{-- - --}}{{-- + + + @if(FEATURE_FORKS) + {{ $forks }}@icon(fa-code-fork fa-pl, ~Forks~~) - --}}{{-- - --}}{{-- + + @endif + + @if(FEATURE_FAVES) + {{ $faves }}@icon(fa-star fa-pl, ~Favourites~~) - --}}{{-- - --}}{{-- + + @endif + + {{ $revs }}@icon(fa-history fa-pl, ~Revisions~~) - --}}{{-- - --}} + + + {{ $rows }}@icon(fa-th-list fa-pl, ~Rows) - {{-- - --}} +
diff --git a/resources/views/table/_rows.blade.php b/resources/views/table/_rows.blade.php index 7c6895e..effce66 100644 --- a/resources/views/table/_rows.blade.php +++ b/resources/views/table/_rows.blade.php @@ -11,7 +11,7 @@ - + {{----}} @foreach($columns as $col) @endforeach @@ -20,7 +20,7 @@ @foreach($rows as $row) - + {{----}} @foreach($columns as $col) @endforeach diff --git a/resources/views/table/_view-action-buttons.blade.php b/resources/views/table/_view-action-buttons.blade.php index 84785f7..37d9ed4 100644 --- a/resources/views/table/_view-action-buttons.blade.php +++ b/resources/views/table/_view-action-buttons.blade.php @@ -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 --}} @icon(fa-code-fork, sr:Forks)  {{ $table->forks_count ?: '–' }} + @endif + @if(FEATURE_FAVES) {{-- Passive favourite buttons with counter --}} @icon(fa-star, sr:Favourites)  {{ $table->favourites_count ?: '–' }} + @endif @else {{-- Logged in and does not own the table --}} + @if(FEATURE_FORKS) {{-- Active fork button | counter --}}
@@ -36,7 +41,9 @@ {{ $table->forks_count ?: '–' }}
+ @endif + @if(FEATURE_FAVES) {{-- Active favourite button | counter --}}
@if(user()->favouritesTable($table)) @@ -52,20 +59,25 @@ {{ $table->favourites_count ?: '–' }}
+ @endif @endif + @if(FEATURE_TABLE_COMMENTS) {{-- Comments button with counter --}} @icon(fa-comment, sr:Comments)  {{ $table->comments_count ?: '–' }} + @endif {{-- Active proposals button | counter --}}
+ @if(FEATURE_PROPOSALS) @icon(fa-inbox fa-pr, sr:Change Proposals){{ $table->proposals_count ?: '–' }} + @endif @auth @if(user()->ownsTable($table)) {{-- Table owner logged in --}} @@ -73,10 +85,12 @@ @icon(fa-pencil, sr:Draft Change) @else + @if(FEATURE_PROPOSALS) {{-- Not a table owner --}} @icon(fa-pencil, sr:Propose Change) + @endif @endif @endauth
##{{ $col->title }}
{{$row->_id}}{{$row->_id}}{{ $row->{$col->name} }}