Add user balance to dashboard

This commit is contained in:
Nabeel Shahzad 2018-04-03 12:06:06 -05:00
parent 99555539a7
commit af28156498
3 changed files with 80 additions and 28 deletions

View File

@ -2,6 +2,42 @@
*
*/
.dashboard-box {
background: #067ec1;
color: #FFF;
}
.dashboard-box .header {
left: 0;
right: 0;
height: 100px;
line-height: 100px;
white-space: nowrap;
}
.dashboard-box .icon-background {
float: left;
position: absolute;
display: block;
top: 0;
left: 0;
right: 0;
font-size: 125px;
}
.dashboard-box .icon {
opacity: .1;
}
.dashboard-box .description {
position: absolute;
color: white;
bottom: 0;
left: 0;
right: 0;
font-size: 1.3em;
}
.mini-splash {
padding: 30px 0;
text-align: center;

View File

@ -4,45 +4,61 @@
@section('content')
<div class="row">
<div class="col-sm-8">
{{-- TOP BAR WITH BOXES --}}
<div class="row">
<div class="col-sm-4">
<div class="card card-primary text-white" style="background: #067ec1; color: #FFF;">
<div class="col-sm-3">
<div class="card card-primary text-white dashboard-box">
<div class="card-block text-center">
<div style="float: left; position: absolute; display:block; top: 0px;font-size: 150px">
<i class="fas fa-plane" style="opacity: .1;"></i>
<div class="icon-background">
<i class="fas fa-plane icon"></i>
</div>
<h4 class="">{{ $user->flights }}</h4>
<h5 class="description" style="color: white;">{{ str_plural('flight', $user->flights) }}</h5>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="card card-primary text-white" style="background: #067ec1; color: #FFF;">
<div class="card-block text-center">
<div style="float: left; position: absolute; display:block; top: 0px;font-size: 150px">
<i class="far fa-clock" style="opacity: .1;"></i>
</div>
<h4 class="">{{ \App\Facades\Utils::minutesToTimeString($user->flight_time, false)}}</h4>
<h5 class="description" style="color: white;">total hours</h5>
<h3 class="header">{{ $user->flights }}</h3>
<h5 class="description">{{ str_plural('flight', $user->flights) }}</h5>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="card card-primary text-white" style="background: #067ec1; color: #FFF;">
<div class="col-sm-3">
<div class="card card-primary text-white dashboard-box">
<div class="card-block text-center">
<div style="float: left; position: absolute; display:block; top: 0px;font-size: 150px">
<i class="fas fa-map-marker" style="opacity: .1;"></i>
<div class="icon-background">
<i class="far fa-clock icon"></i>
</div>
@if($user->current_airport)
<h4 class="">{{ $user->current_airport->icao }}</h4>
@else
<h4 class="">-</h4>
@endif
<h5 class="description" style="color: white;">current airport</h5>
<h3 class="header">{{ \App\Facades\Utils::minutesToTimeString($user->flight_time, false)}}</h3>
<h5 class="description">total hours</h5>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card card-primary text-white dashboard-box">
<div class="card-block text-center">
<div class="icon-background"> {{--110px font-size--}}
<i class="fas fa-money-bill-alt icon"></i>
</div>
<h3 class="header">{{ $user->journal->balance }}</h3>
<h5 class="description">your balance</h5>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card card-primary text-white dashboard-box">
<div class="card-block text-center">
<div class="icon-background">
<i class="fas fa-map-marker icon"></i>
</div>
@if($user->current_airport)
<h3 class="header">{{ $user->curr_airport_id }}</h3>
@else
<h3 class="header">{{ $user->home_airport_id }}</h3>
@endif
<h5 class="description">current airport</h5>
</div>
</div>
</div>
</div>
@if($last_pirep === null)

View File

@ -3,7 +3,7 @@
<div class="row">
<div class="col-12">
<h5>
<a class="text-c" href="{{ route('frontend.pireps.show', [$pirep->id]) }}">
<a href="{{ route('frontend.pireps.show', [$pirep->id]) }}">
{{ $pirep->ident }}
</a>
-