Skip to content

Commit

Permalink
update activity requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
mufassilyasir committed Jun 12, 2024
1 parent 983844c commit 27d76cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
15 changes: 1 addition & 14 deletions app/Http/Controllers/PrimaryViewsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,6 @@ public function dashboard(Request $request)
$bannerImg = null;
}

//Quote of the day
$quote = Cache::remember('quoteoftheday', 86400, function () {
$client = new Client();
$headers = [
'X-Api-Key' => env('QUOTES_API_TOKEN')
];
$output = $client->get('https://api.api-ninjas.com/v1/quotes',[
'headers' => $headers
]);

return json_decode($output->getBody());
});

return view('my.index', compact('atcResources', 'bannerImg', 'quote'));
return view('my.index', compact('atcResources', 'bannerImg'));
}
}
2 changes: 1 addition & 1 deletion app/Models/Roster/RosterMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function meetsActivityRequirement()
}

//If they are meeting activity requirements why send em an email?
if ($this->currency >= 3.0) {
if ($this->currency >= 1.0) {
return true;
}

Expand Down
8 changes: 2 additions & 6 deletions resources/views/my/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ function randomArrayVar($array)
?>
{{ auth()->user()->fullName('F') }}!
</h1>
@if (isset($quote))
<p style="font-size: 1.2em;">{{ $quote[0]->quote }} ~ {{ $quote[0]->author }}</p>
@endif
</div>
</div>
@if (auth()->user()->created_at->diffInDays(Carbon\Carbon::now()) < 14)
Expand Down Expand Up @@ -355,7 +352,7 @@ class="list-group-item list-group-item-action p-4 z-depth-1 shadow-none mb-3">
<h3 class="font-weight-bold blue-text mt-3 pb-2">Activity</h3>
@php
$currency = auth()->user()->rosterProfile->currency;
$class = $currency < 0.1 ? 'red' : ($currency < 3.0 ? 'blue' : 'green');
$class = $currency < 0.1 ? 'red' : ($currency < 1.0 ? 'blue' : 'green');
@endphp

<h3>
Expand All @@ -365,8 +362,7 @@ class='badge rounded {{ $class }} text-white p-2 shadow-none'>
</span>
</h3>

<p class="mt-4">You require 3 hours of activity every quarter, unless you were certified within
the current activity cycle.</p>
<p class="mt-4">You require 1 hour of activity within the last 12 months.</p>
@else
<h3>
<span style='font-weight: 400' class='badge rounded p-2 red text-white shadow-none'>
Expand Down

0 comments on commit 27d76cf

Please sign in to comment.