<div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h4 class="modal-title">@lang('meddocuments::lang.version_history') — {{ $document->title }}</h4>
        </div>
        <div class="modal-body">
            <table class="table table-bordered table-striped">
                <thead><tr>
                    <th>#</th>
                    <th>@lang('meddocuments::lang.file')</th>
                    <th>@lang('meddocuments::lang.size')</th>
                    <th>@lang('meddocuments::lang.uploaded')</th>
                    <th>@lang('meddocuments::lang.notes')</th>
                    <th>@lang('messages.action')</th>
                </tr></thead>
                <tbody>
                @foreach($document->versions as $v)
                    <tr @if($v->id == $document->current_version_id) class="success" @endif>
                        <td>v{{ $v->version_no }} @if($v->id == $document->current_version_id)<span class="label label-success">@lang('meddocuments::lang.current')</span>@endif</td>
                        <td>{{ $v->original_name }}</td>
                        <td>{{ $v->humanSize() }}</td>
                        <td>{{ optional($v->created_at)->format('Y-m-d H:i') }}</td>
                        <td>{{ $v->notes }}</td>
                        <td>
                            <a href="{{ route('meddoc.documents.view', [$document->id, 'version' => $v->id]) }}" target="_blank" class="btn btn-xs btn-default"><i class="fa fa-eye"></i></a>
                            <a href="{{ route('meddoc.documents.download', [$document->id, 'version' => $v->id]) }}" class="btn btn-xs btn-default"><i class="fa fa-download"></i></a>
                            @can('meddoc.download_original')
                            <a href="{{ route('meddoc.documents.download-original', [$document->id, 'version' => $v->id]) }}" class="btn btn-xs btn-warning" title="@lang('meddocuments::lang.download_original')"><i class="fa fa-file"></i></a>
                            @endcan
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">@lang('messages.close')</button>
        </div>
    </div>
</div>
