@extends('layout.app')

@section('left-menu')
    @parent
		<ul>
        <a href="/userprofile"><li>Mój profil<img src="/img/left_menu_icon/edit.png"></li></a>
        <a href="/userprofile/edit"><li>Edytuj profil<img src="/img/left_menu_icon/edit.png"></li></a>
        <a href="/userprofile/szkolenia"><li>Szkolenia<img src="/img/left_menu_icon/more.png"></li></a>
        <a href="/userprofile/passwordchange"><li>Zmiana hasła<img src="/img/left_menu_icon/edit.png"></li></a>
    	</ul>
    @stop
@section('center-area')
    @parent

    @if( auth()->check())
        @if( auth()->user()->fireStationID == NULL)
            Jednostka nie istnieje
        @else
        	@if(count($userDecorations) > 0)
            	<p align='center'>
            	<table class='table'>
                    <thead>
                        <tr>
                            <th colspan="2"><center>Odznaczenia</center></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <th>Odznaczenie</th>
                            <th>Data przyznania</th>
                        </tr>
                        @foreach($userDecorations as $userDecoration)
                            <tr>
                                <td id="decorationName{{ $userDecoration->id }}">{{ $userDecoration->decorationName }}</td>
                                <td id="amount{{ $userDecoration->id }}">{{ $userDecoration->dateOfAward }}</td>
                            </tr>
                        @endforeach
                    </tbody>
            </table>
        	</p>
                @else
                	Nie posiadasz jeszcze żadnych odznaczeń.
               	@endif
        @endif
     @else
        Brak autoryzacji
     @endif

@stop