2018-03-12 07:00:42 +08:00
|
|
|
@extends('app')
|
2018-05-19 03:30:59 +08:00
|
|
|
@section('title', __('common.profile'))
|
2018-02-04 08:18:09 +08:00
|
|
|
|
2017-08-03 02:13:08 +08:00
|
|
|
@section('content')
|
2020-02-02 02:05:56 +08:00
|
|
|
<div class="row profile-page content-center text-color-dark-beige">
|
2017-12-25 02:12:26 +08:00
|
|
|
<div class="col-md-4" style="text-align:center;">
|
2020-02-02 02:05:56 +08:00
|
|
|
<div class="photo-container">
|
|
|
|
@if ($user->avatar == null)
|
|
|
|
<img src="{{ $user->gravatar(512) }}" style="width: 123px;">
|
|
|
|
@else
|
|
|
|
<img src="{{ $user->avatar->url }}" style="width: 123px;">
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
<div><br/></div>
|
|
|
|
<div class="social-description">
|
2020-04-07 00:03:19 +08:00
|
|
|
<h2>{{ $user->name_private }}</h2>
|
2020-10-12 04:06:09 +08:00
|
|
|
<p>
|
|
|
|
{{ $user->ident }}
|
|
|
|
<span class="flag-icon flag-icon-{{ $user->country }}"></span>
|
|
|
|
</p>
|
2020-02-02 02:05:56 +08:00
|
|
|
</div>
|
2020-10-12 04:06:09 +08:00
|
|
|
<p class="description" style="color: #9A9A9A;">
|
|
|
|
{{ $user->airline->name }}
|
|
|
|
</p>
|
2020-02-02 02:05:56 +08:00
|
|
|
<div class="social-description">
|
2020-10-10 05:45:16 +08:00
|
|
|
@if (!empty($user->rank->image_url))
|
|
|
|
<img src="{{ $user->rank->image_url }}" style="width: 160px;">
|
|
|
|
@endif
|
2020-10-12 04:06:09 +08:00
|
|
|
<p>{{ $user->rank->name }} <br />
|
|
|
|
@if($user->home_airport)
|
|
|
|
@lang('airports.home'): {{ $user->home_airport->icao }}
|
|
|
|
@endif
|
|
|
|
</p>
|
2020-02-02 02:05:56 +08:00
|
|
|
</div>
|
2017-12-25 02:12:26 +08:00
|
|
|
</div>
|
|
|
|
<div class="col-md-8 content-center">
|
2020-02-02 02:05:56 +08:00
|
|
|
<div class="content">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-6">
|
|
|
|
<div class="card text-center">
|
|
|
|
<div class="card-body">
|
|
|
|
<h2 class="card-title">{{ $user->flights}}</h2>
|
|
|
|
<p class="card-text">Flights</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-12-25 02:12:26 +08:00
|
|
|
|
2020-02-02 02:05:56 +08:00
|
|
|
<div class="col-lg-6">
|
|
|
|
<div class="card text-center">
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="social-description">
|
2020-10-05 00:48:12 +08:00
|
|
|
<h2 class="card-title">@minutestotime($user->flight_time)</h2>
|
|
|
|
<p class="card-text">@lang('flights.flighthours')</p>
|
2017-12-25 02:12:26 +08:00
|
|
|
</div>
|
2020-02-02 02:05:56 +08:00
|
|
|
</div>
|
2019-09-12 23:48:41 +08:00
|
|
|
</div>
|
2020-02-02 02:05:56 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
@if($user->current_airport)
|
|
|
|
<div class="col-lg-6">
|
|
|
|
<div class="card text-center">
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="social-description">
|
2020-10-05 00:48:12 +08:00
|
|
|
<h2 class="card-title">{{ $user->current_airport->icao }}</h2>
|
|
|
|
<p class="card-text">@lang('airports.current')</p>
|
2020-02-02 02:05:56 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
2017-12-25 02:12:26 +08:00
|
|
|
|
2018-09-05 08:09:33 +08:00
|
|
|
|
2020-02-02 02:05:56 +08:00
|
|
|
@if(setting('pilots.allow_transfer_hours') === true)
|
|
|
|
<div class="col-lg-6">
|
|
|
|
<div class="card text-center">
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="social-description">
|
2020-10-05 00:48:12 +08:00
|
|
|
<h2 class="card-title">@minutestohours($user->transfer_time)h</h2>
|
|
|
|
<p class="card-text">@lang('profile.transferhours')</p>
|
2020-02-02 02:05:56 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-09-12 23:48:41 +08:00
|
|
|
</div>
|
2020-02-02 02:05:56 +08:00
|
|
|
@endif
|
2017-12-25 02:12:26 +08:00
|
|
|
</div>
|
2020-02-02 02:05:56 +08:00
|
|
|
</div>
|
2017-12-25 02:12:26 +08:00
|
|
|
</div>
|
2020-02-02 02:05:56 +08:00
|
|
|
</div>
|
2017-12-25 02:12:26 +08:00
|
|
|
|
2020-10-12 04:06:09 +08:00
|
|
|
{{-- Show the user's award if they have any --}}
|
|
|
|
@if ($user->awards)
|
|
|
|
<div class="clearfix" style="height: 50px;"></div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-12">
|
|
|
|
<h3 class="description">@lang('profile.your-awards')</h3>
|
|
|
|
@foreach($user->awards->chunk(3) as $awards)
|
|
|
|
<div class="row">
|
|
|
|
@foreach($awards as $award)
|
|
|
|
<div class="card card-signup">
|
|
|
|
<div class="header header-primary text-center">
|
|
|
|
<h4 class="title title-up">{{ $award->name }}</h4>
|
|
|
|
@if ($award->image_url)
|
|
|
|
<div class="photo-container">
|
|
|
|
<img src="{{ $award->image_url }}" alt="{{ $award->description }}" style="width: 123px;">
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
<div class="content content-center">
|
|
|
|
<div class="social-description text-center">
|
|
|
|
{{ $award->description }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="footer text-center">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endforeach
|
|
|
|
</div>
|
|
|
|
<div class="clearfix" style="height: 20px;"></div>
|
|
|
|
@endforeach
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
@endif
|
|
|
|
|
2020-02-02 02:05:56 +08:00
|
|
|
{{--
|
|
|
|
show the details/edit fields only for the currently logged in user
|
|
|
|
--}}
|
|
|
|
@if(Auth::check() && $user->id === Auth::user()->id)
|
2017-12-25 02:12:26 +08:00
|
|
|
<div class="clearfix" style="height: 50px;"></div>
|
|
|
|
<div class="row">
|
2020-02-02 02:05:56 +08:00
|
|
|
<div class="col-sm-12">
|
|
|
|
<div class="text-right">
|
2020-02-21 00:36:26 +08:00
|
|
|
@if (isset($acars) && $acars === true)
|
2020-02-08 02:29:43 +08:00
|
|
|
<a href="{{ route('frontend.profile.acars') }}" class="btn btn-primary"
|
2021-01-26 05:04:43 +08:00
|
|
|
onclick="alert('Copy or Save to \'My Documents/phpVMS\'')">ACARS Config</a>
|
2020-02-08 02:29:43 +08:00
|
|
|
|
|
|
|
@endif
|
2020-02-02 02:05:56 +08:00
|
|
|
<a href="{{ route('frontend.profile.regen_apikey') }}" class="btn btn-warning"
|
2021-01-26 05:04:43 +08:00
|
|
|
onclick="return confirm('Are you sure? This will reset your API key!')">@lang('profile.newapikey')</a>
|
2020-02-02 02:05:56 +08:00
|
|
|
|
|
|
|
<a href="{{ route('frontend.profile.edit', [$user->id]) }}"
|
|
|
|
class="btn btn-primary">@lang('common.edit')</a>
|
2017-12-25 02:12:26 +08:00
|
|
|
</div>
|
2020-02-02 02:05:56 +08:00
|
|
|
|
2020-10-12 04:06:09 +08:00
|
|
|
<h3 class="description">@lang('profile.your-profile')</h3>
|
2020-02-02 02:05:56 +08:00
|
|
|
<table class="table table-full-width">
|
|
|
|
<tr>
|
|
|
|
<td>@lang('common.email')</td>
|
|
|
|
<td>{{ $user->email }}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>@lang('profile.apikey') <span class="description">(@lang('profile.dontshare'))</span></td>
|
2020-10-03 23:13:28 +08:00
|
|
|
<td><span id="apiKey_show" style="display: none">{{ $user->api_key }} <i class="fas fa-eye-slash" onclick="apiKeyHide()"></i></span><span id="apiKey_hide">@lang('profile.apikey-show') <i class="fas fa-eye" onclick="apiKeyShow()"></i></span></td>
|
2020-02-02 02:05:56 +08:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>@lang('common.timezone')</td>
|
|
|
|
<td>{{ $user->timezone }}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>@lang('profile.opt-in')</td>
|
|
|
|
<td>{{ $user->opt_in ? __('common.yes') : __('common.no') }}</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
2017-12-25 02:12:26 +08:00
|
|
|
</div>
|
2020-02-02 02:05:56 +08:00
|
|
|
@endif
|
2020-08-12 05:48:51 +08:00
|
|
|
|
|
|
|
<div class="clearfix" style="height: 50px;"></div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-12">
|
|
|
|
<table class="table table-full-width">
|
|
|
|
@foreach($userFields as $field)
|
2021-01-28 21:31:29 +08:00
|
|
|
@if(!$field->private)
|
2020-08-12 05:48:51 +08:00
|
|
|
<tr>
|
|
|
|
<td>{{ $field->name }}</td>
|
|
|
|
<td>{{ $field->value }}</td>
|
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
@endforeach
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-08-03 02:13:08 +08:00
|
|
|
@endsection
|
2020-10-03 23:13:28 +08:00
|
|
|
|
|
|
|
@section('scripts')
|
|
|
|
<script>
|
|
|
|
function apiKeyShow(){
|
|
|
|
document.getElementById("apiKey_show").style = "display:block";
|
|
|
|
document.getElementById("apiKey_hide").style = "display:none";
|
|
|
|
}
|
|
|
|
function apiKeyHide(){
|
|
|
|
document.getElementById("apiKey_show").style = "display:none";
|
|
|
|
document.getElementById("apiKey_hide").style = "display:block";
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
@endsection
|