{$layout}
<!-- {$template "../settings_menu"} -->

<div class="left-right-box-container">
    {$template "/left_menu"}

    <div class="right-box">
        <!-- 审核中 -->
        <div v-show="isAuditing">
            <div class="margin"></div>
            <warning-message>当前域名正在审核中，请审核域名的所有人、备案情况等。</warning-message>
            <form method="post" class="ui form" data-tea-action=".audit" data-tea-success="auditSuccess">
                <csrf-token></csrf-token>
                <input type="hidden" name="serverId" :value="serverId"/>
                <table class="ui table definition selectable">
                    <tr>
                        <td class="title">审核中域名</td>
                        <td>
                            <span v-for="serverName in allServerNames" class="ui label basic" :class="{green: serverName.isPassed}">
                                {{serverName.name}}
                            </span>
                            <p class="comment" v-if="hasPassedDomains"><span class="green">绿色</span>标注的域名表示之前已经审核通过的域名。</p>
                        </td>
                    </tr>
                    <tr v-if="auditingTime.length > 0">
                        <td>提交审核时间</td>
                        <td>{{auditingTime}}</td>
                    </tr>
                    <tr>
                        <td>审核结果</td>
                        <td>
                            <radio name="auditingOK" :v-value="1" v-model="auditing">审核通过</radio> &nbsp;
                            <radio name="auditingOK" :v-value="0" v-model="auditing">审核不通过</radio>
                        </td>
                    </tr>
                    <tr v-show="auditing == 0">
                        <td>审核不通过原因 *</td>
                        <td>
                            <input type="text" name="auditingReason" maxlength="100" placeholder="包含审核不通过的域名等"/>
                        </td>
                    </tr>
                </table>
                <submit-btn>提交审核结果</submit-btn>
            </form>
        </div>

        <!-- 审核不通过 -->
        <div class="ui message error" v-if="!isAuditing && !auditingResult.isOk">
            审核不通过，原因：{{auditingResult.reason}} （{{auditingResult.createdTime}}）。等待用户重新提交。
        </div>

        <!-- 不在审核中 -->
        <div v-show="!isAuditing && auditingResult.isOk">
            <form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
                <csrf-token></csrf-token>
                <input type="hidden" name="serverId" :value="serverId"/>
                <table class="ui table definition selectable">
                    <tr>
                        <td class="title">已绑定的域名</td>
                        <td>
                            <server-name-box :v-server-names="serverNames"></server-name-box>
                            <p class="comment">用户可以通过这些域名访问当前网站。</p>
                        </td>
                    </tr>
                </table>
                <submit-btn></submit-btn>
            </form>
        </div>
    </div>
</div>