{% load static simpletags sptags %}

{% if 'SIMPLEPRO_INFO'|get_config != False %}

    {% if 'SIMPLEUI_HOME_INFO'|get_config != False %}
        <el-card shadow="hover" class="box-card setting-card" style="margin-top: 20px">
            <div slot="header" class="clearfix">

        <span><i class="fab fa-stripe-s"></i>Simpleui <span
                v-text="getLanuage('Home page')"></span></span>
            </div>
            <div class="float-wrap clearfix">
                <div style="text-align: center">
                    <table class="simpleui-table">
                        <tbody>
                        <tr>
                            <th>Simple UI</th>
                            <td>{% get_simple_version %}</td>
                            <td>
                                <el-tag style="cursor: pointer" @click="report()" v-text="getLanuage('Report issue')"
                                        size="small"></el-tag>
                            </td>
                        </tr>
                        <tr>
                            <th width="120">Simple Pro</th>
                            <td>{% get_sp_version %}</td>
                            <td>
                                <el-tag style="cursor: pointer" type="success"
                                        @click="report('https://github.com/newpanjing/simplepro/issues')"
                                        v-text="getLanuage('Report issue')" size="small"></el-tag>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <a v-if="upgrade.isUpdate" href="javascript:;" @click="upgrade.dialogVisible=true"
                       class="upgrade"><span class="el-icon-top"></span><span
                            v-text="upgrade.version"></span></a>
                </div>
                <el-button icon="fas fa-code" @click="openUrl('https://gitee.com/tompeppa/simpleui')">Gitee
                </el-button>
                <el-button icon="fab fa-github" @click="openUrl('https://github.com/newpanjing/simpleui')">
                    Github
                </el-button>
            </div>
        </el-card>
        <el-dialog
                title="Upgrade Simpleui"
                :visible.sync="upgrade.dialogVisible"
                width="50%">
            <el-alert
                    :title="'You can upgrade to '+upgrade.version"
                    type="success">
            </el-alert>
            <div style="padding: 10px">
                <div>
                    <h3>
                        Run Command:
                    </h3>
                    <el-alert
                            title="pip install django-simpleui -U"
                            type="info">
                    </el-alert>

                </div>
                <div><h3>Change logs:</h3></div>
                <div v-text="upgrade.body"></div>
            </div>
        </el-dialog>
    {% endif %}

{% endif %}