{% init category_url = xutils.call("plugin.get_category_url_by_code", model.category) %}


{% if model.header_html != "" %}
    <!-- 自定义Header -->
    {% raw model.header_html %}
{% elif model.show_title %}
    <!-- 插件默认的header -->
    <div class="plugin-head card">
        <div class="card-title btn-line-height">
            {% if model.parent_link %}
                <a class="link2 path-link" href="{{model.parent_link.href}}">{{model.parent_link.text}}</a>
                <span>/</span>
            {% elif model.show_category and model.category %}
                <a class="link2 path-link" href="{{category_url}}">{{model.category_name}}</a>
                <span>/</span>
            {% end %}
            <span>{{title}}</span>
            <span class="float-right">
                {% raw model.get_option_html() %}
                <a class="btn btn-default" href="javascript:history.back();">返回</a>
            </span>
        </div>
    </div>

    {% if description != "" or error != "" or rows > 0 %}
        <div class="card">
            {% if description != "" %}
                <pre class="col-md-12 plugin-description">{{description}}</pre>
            {% end %}

            {% if error != "" %}
                <pre class="col-md-12 error">{{error}}</pre>
            {% end %}

            {% if rows > 0 %}
                <div class="row">
                    <form method="{{method}}">
                        <!-- 输入框区域 BEGIN -->
                        {% if rows == 1 %}
                            <input type="text" class="plugin-input" name="input" value="{{input}}" placeholder="{{model.placeholder}}"/>
                        {% else %}
                            <textarea class="col-md-12 code" name="input" rows={{rows}} placeholder="{{model.placeholder}}">{{input}}</textarea>
                        {% end %}
                        <!-- 输入框区域 END -->

                        <!-- 按钮区域 BEGIN -->
                        <button>{{model.btn_text}}</button>
                        <!-- 按钮区域 END -->
                    </form>
                </div>
            {% end %}
        </div>
    {% end %}
    
{% end %}
