phpvms/resources/views/layouts/default/widgets/weather.blade.php

81 lines
2.7 KiB
PHP
Raw Normal View History

{{--
If you want to edit this, you can reference the CheckWX API docs:
https://api.checkwx.com/#metar-decoded
--}}
@if(!$metar)
2018-05-19 03:59:34 +08:00
<p>@lang('widgets.weather.metarnotretrieved')</p>
@else
2018-04-04 08:21:42 +08:00
<table class="table table-striped">
<tr>
2018-05-19 03:59:34 +08:00
<td>@lang('widgets.weather.conditions')</td>
<td>
2018-04-07 22:05:06 +08:00
{{ $metar['category'] }}
{{ $metar['temperature'][$unit_temp] }}
2018-04-07 22:05:06 +08:00
°{{strtoupper($unit_temp)}}
@if($metar['visibility'])
2018-05-19 03:59:34 +08:00
, @lang('widgets.weather.visibility') {{ $metar['visibility'][$unit_dist] }} {{$unit_dist}}
2018-04-07 22:05:06 +08:00
@endif
@if($metar['humidity'])
2018-05-19 03:59:34 +08:00
, {{ $metar['humidity'] }}% @lang('widgets.weather.humidity')
2018-04-07 22:05:06 +08:00
@endif
@if($metar['dew_point'])
2018-05-19 03:59:34 +08:00
, @lang('widgets.weather.dewpoint')
{{ $metar['dew_point'][$unit_temp] }}
°{{strtoupper($unit_temp)}}
@endif
</td>
</tr>
<tr>
2018-05-19 03:59:34 +08:00
<td>@lang('widgets.weather.barometer')</td>
<td>
{{ number_format($metar['barometer'], 2) }} hPa
/ {{ number_format($metar['barometer_in'], 2) }} inHg
</td>
</tr>
2018-04-07 22:05:06 +08:00
@if($metar['clouds'])
<tr>
2018-05-19 03:59:34 +08:00
<td>@lang('widgets.weather.clouds')</td>
2018-04-07 22:05:06 +08:00
<td>
@if($unit_alt === 'ft')
{{$metar['clouds_report_ft']}}
@else
{{ $metar['clouds_report'] }}
@endif
</td>
</tr>
@endif
<tr>
2018-05-19 03:59:34 +08:00
<td>@lang('widgets.weather.wind')</td>
<td>
2018-05-19 03:18:12 +08:00
{{$metar['wind_speed']}} kts @lang('common.from') {{$metar['wind_direction_label']}}
2018-04-07 22:05:06 +08:00
({{$metar['wind_direction']}}°)
@if($metar['wind_gust_speed'])
2018-05-19 03:59:34 +08:00
@lang('widgets.weather.guststo') {{ $metar['wind_gust_speed'] }}
@endif
</td>
</tr>
<tr>
2018-05-19 03:18:12 +08:00
<td>@lang('common.metar')</td>
<td>
<div style="line-height:1.5em;min-height: 3em;">
2018-04-07 22:05:06 +08:00
{{ $metar['raw'] }}
</div>
</td>
</tr>
2018-04-07 22:05:06 +08:00
@if($metar['remarks'])
<tr>
2018-05-19 03:59:34 +08:00
<td>@lang('widgets.weather.remarks')</td>
2018-04-07 22:05:06 +08:00
<td>
{{ $metar['remarks'] }}
</td>
</tr>
@endif
<tr>
2018-05-19 03:59:34 +08:00
<td>@lang('widgets.weather.updated')</td>
2018-04-07 22:05:06 +08:00
<td>{{$metar['observed_time']}} ({{$metar['observed_age']}})</td>
</tr>
</table>
@endif