{% extends "../main.html" %}
{% block title %}主关键词表{% end %}
{% block content %}

<div class="page-hero page-container " id="page-hero">
    <div class="padding d-flex">
        <div class="page-title">
            <h2 class="text-md text-highlight">主关键词库</h2>            
        </div>
        <div class="flex"></div>
        <div>
            <a href="/" class="btn btn-md text-muted">
                <span class="d-none d-sm-inline mx-1">返回</span>
                <i data-feather="arrow-right"></i>
            </a>
        </div>
    </div>
  
    <div class="padding d-flex">
        <div class="page-title">
            <ul>
                <li>说明：用来采集对应关键词的文章,不同的用户等级词库不同 </li>
                <li>初始化建站：点击后将从服务器获取建站初始词 </li>
            </ul>               
        </div>
        <div class="flex"></div>
        <div class="col-sm-3">
            <a href="/initkeywords" class="btn btn-success " role="button">建站初始化</a>
        </div>
    </div>

    <div class="padding">
        <div id="toolbar"></div>
        <table id="table" class="table table-theme v-middle" data-plugin="bootstrapTable" data-toolbar="#toolbar"
            data-search="true" data-search-align="left" data-show-export="true" data-show-columns="true"
            data-detail-view="false" data-mobile-responsive="true" data-pagination="true"
            data-page-list="[10, 25, 50, 100, ALL]">
            <thead>
                <tr>
                    <th>关键词</th>
                    <th>对应文章数</th>
                    <th>流量指数</th>
                    <th>收录量</th>
                    <th>指向栏目数</th>
                    <th>长尾词数量</th>
                </tr>
            </thead>
            <tbody>
                {%  for mainkey in mainkeys %}
                <tr>
                    <td>{{ mainkey['keyword'] }}</td>
                    <td>{{ mainkey['post_count'] }}</td>
                    <td>{{ mainkey['traffic_count'] }}</td>
                    <td>{{ mainkey['collect_count'] }}</td>
                    <td>{{ mainkey['column_count'] }}</td>
                    <td><a href="longtailword?mid={{ mainkey['mid'] }}">{{ mainkey['longtail_count'] }}</a></td>
                </tr>

                {% end %}

            </tbody>
        </table>

        <div class="mb-3 text-center">

            {% if prev_url %}

            <a href="{{ prev_url }}" class="btn w-sm mb-1 btn-primary " role="button">上一页</a>
            {% end %}

            {% if next_url %}
            <a href="{{ next_url }}" class="btn w-sm mb-1 btn-primary " role="button">下一页</a>
            {% end %}

        </div>
    </div>
</div>


{% end %}