<div class="email-client-body__right">
    @if(!$messages->isEmpty())
        <div class="email-client-list">
            <div class="email-client-list__tool">
                <span class="email-checkbox-all">
                    <input type="checkbox" id="email-checkbox-all-id">
                    <label for="email-checkbox-all-id"></label>
                </span>
                @if($on == 'inbox')
                <span class="already-btn" title="已读">
                    <i class="iconfont icon-already_read"></i>
                </span>
                <span class="unready-btn" title="未读">
                    <i class="iconfont icon-Mail"></i>
                </span>
                @endif
                <span class="delete-btn" title="删除">
                    <i class="iconfont icon-pinhetuxing1"></i>
                </span>
            </div>
            <div class="email-client-list_item">
                <ul class="email-client-list_item-ul">
                    @foreach ($messages as $msg)
                        <li class="email-client-list_item-li">
                            <input type="checkbox" value="{{$msg->id}}" class="email-checkbox">
                            <a href="{{ url('/admin/mail-message/'.$msg->id).'?on='.$on  }}">
                                @if($msg->flags)
                                    <i class="iconfont icon-already_read"></i>
                                @else
                                    <i class="iconfont icon-Mail"></i>
                                @endif
                                @if($on == 'sent')
                                <span class="sent-name">{{$msg->from[0]}}</span>
                                @else
                                <span class="sent-name">{{$msg->from['personal'] ? $msg->from['personal'] : $msg->from['mailbox']}}</span>
                                @endif
                                <span class="email-title">{{$msg->subject}}</span>
                                <span class="email-dsc">--{{mb_substr(strip_tags($msg->body), 0, 150)}}</span>
                                <span class="email-time">{{$msg->date}}</span>
                            </a>
                        </li>
                    @endforeach
                </ul>
            </div>
        </div>
    @else
        <div class="email-client-list_none">暂无邮件，请先收取邮件！</div>
    @endif
    <form class="email-client-foot" method="{{ url('/admin/email/'.$on) }}">
        <input type="hidden" name="email" value="{{ $mail }}">
        @if(!empty($messages->render()))
            <div class="pagination-info">共有{{ $messages->total() }}条</div>
            <div class="pagination-info" style="padding-left: 0">
                <select id="perPage" class="form-control autosize selectpicker show-tick" name="perPage">
                    <option {{ $messages->perPage() == 20 ? 'selected': ''}} value="20">20条/页</option>
                    <option {{ $messages->perPage() == 30 ? 'selected': ''}} value="30">30条/页</option>
                    <option {{ $messages->perPage() == 50 ? 'selected': ''}} value="50">50条/页</option>
                    <option {{ $messages->perPage() == 100 ? 'selected': ''}} value="100">100条/页</option>
                </select>
            </div>
        {!! $messages->render() !!}
        @endif
    </form>
</div>