{# <!--
@Author       : xupingmao
@email        : 578749341@qq.com
@Date         : 2022-04-30 10:07:51
@LastEditors  : xupingmao
@LastEditTime : 2022-05-01 12:47:31
@FilePath     : /xnote/handlers/search/component/search_sidebar.html
--> #}

{% init key = "" %}
{% init relevant_words = [] %}

{% include common/sidebar/app_index.html %}

{% if key != "" %}
<div class="card">
    <div class="card-title">
        <span>相关搜索</span>
        <div class="float-right">
            <a class="btn btn-default" href="{{_server_home}}/dict/list?dict_type=3">编辑词库</a>
        </div>
    </div>

    <div class="list">
        {% if len(relevant_words) == 0 %}
            <a class="list-item" href="#">暂无相关搜索</a>
        {% end %}
        {% for word in relevant_words %}
        <a class="list-item" href="{{_server_home}}/search?key={{quote(word)}}&search_type={{search_type}}">
            {{word}}
        </a>
        {% end %}
    </div>
</div>
{% end %}
