@extends('layouts/contentNavbarLayout') @section('title', 'Global Challenges') @section('vendor-style') @endsection @section('page-style') @endsection @section('content')

Global Challenges

Manage global challenges for all users

{{ $challenges->total() }}
Total Challenges
{{ $challenges->where('status', 'active')->count() }}
Active Challenges
{{ $challenges->where('status', 'finished')->count() }}
Finished Challenges
{{ $challenges->where('status', 'inactive')->count() }}
Inactive Challenges
@forelse($challenges as $challenge)
@if($challenge->status === 'active') Active @elseif($challenge->status === 'finished') Finished @elseif($challenge->status === 'canceled') Canceled @elseif($challenge->status === 'inactive') Inactive @endif
@if($challenge->image) {{ $challenge->title }} @else
@endif
{{ $challenge->title }}

Global Challenge

{{ Str::limit($challenge->description, 100) }}

{{ number_format($challenge->required_steps) }}
Required Steps
{{ $challenge->users_count }}
Participants
{{ ucfirst($challenge->type) }}
Type
Start Date {{ Carbon\Carbon::parse($challenge->start_date)->format('M d, Y') }}
End Date {{ Carbon\Carbon::parse($challenge->end_date)->format('M d, Y') }}
@if($challenge->is_points_prize)
{{ number_format($challenge->points_prize) }} Points @if($challenge->prize_description) {{ Str::limit($challenge->prize_description, 50) }} @endif
@endif
@empty

No Global Challenges Found

Create your first global challenge to get started!

Create Challenge
@endforelse
@if($challenges->hasPages())
{{ $challenges->appends(request()->query())->links() }}
@endif
@endsection @section('vendor-script') @endsection @section('page-script') @endsection