<!DOCTYPE html>
{% load static djacore_tags default_tags  cache %}
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
{% block meta %}
{% block seo_tdk %}
<title>{% block title %}{% endblock %}{{site_name|default:"DjaCore"}}</title>
<meta name="description" content="{% block metades %}{% endblock %}">
<meta name="keywords" content="{% block metakeywork %}{% endblock %}">
{% endblock %}
<meta name="site_name" content="{{ site_name }}">
<meta name="application-name" content="{{ site_name }}">
<meta name="apple-mobile-web-app-title" content="{{ site_name }}">
{% if og_enabled %}
{% block og_block %}
<!-- Open Graph -->
<meta property="og:site_name" content="{{ site_name }}">      
{% endblock %}    
{% endif %} 
{% if twitter_card_enabled %}
{% block twitter_card_block %}
<!-- Twitter Card -->
<meta property="og:site_name" content="{{ site_name }}">  
{% endblock %}
{% endif %}
<meta name="referrer" content="strict-origin-when-cross-origin">
<meta name="generator" content="DjaCore CMS"/><!-- 版权信息禁止删除 -->
{% if json_ld_enabled %}
{% block json_ld_block %}
<!-- JSON-LD -->
<script type="application/ld+json">
{
    "@context": "https://schema.org",
    "@type": "WebSite",
    "@id": "{{ request.build_absolute_uri }}#website",
    "url": "{{ site_url }}",
    "name": "{{ site_name }}",
    "description": "{{ meta_description }}",
    "potentialAction": {
        "@type": "SearchAction",
        "target": "{{ site_url }}/search/?key={search_term_string}",
        "query-input": "required name=search_term_string"
    }
}
</script>     
{% endblock %}
{% endif %}    
{% endblock %}
<!-- 以下标签根据实际需求考虑是否保留 -->
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<!-- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> --> <!-- 通常可省略 -->
    <link rel="icon" href="{% static "favicon.ico" %}" type="image/x-icon" />    
    <link rel="stylesheet" href="{% static 'shared/css/bootstrap.min.css' %}">
    <link rel="stylesheet" href="{% static 'shared/css/bootstrap-icons.min.css' %}">
    <link rel="stylesheet" href="{% static 'css/global.css' %}"> 
    <script src="{% static 'shared/js/bootstrap.js' %}"></script>
    <script src="{% static 'shared/js/jquery.min.js' %}"></script>
    <script src="{% static 'shared/js/bootstrap.bundle.js' %}"></script>
    {% block extra_css %}{% endblock %}
    {% block extra_js %}{% endblock %}  
</head>
<body class="bg-body-tertiary">
    {% block top_main %}
        {% block top_top %}{% endblock %}  
        {% block top_center %}{% block navbar %}{% include 'includes/navigation.html' %}{% endblock %}{% endblock %}  
        {% block top_bottom %}{% block header %}{% include 'includes/header.html' %}{% endblock %} {% endblock %}  
    {% endblock %}      
    <main >
        {% block body_main %}
        <div class="container mt-4" style="min-height:80vh;">
        <div class="row">
            <div class="col-md-8 bg-white p-md-5 p-3">
                {% block breadcrumb %}{% endblock %} 
                {% block body_left_top %}{% endblock %} 
                {% block body_left_center %}{% endblock %} 
                {% block body_left_bottom %}{% endblock %} 
            </div>
            <div class="col-md-4">
                {% block body_right_main %}
                    {% block body_right_top %}
                        {% if obj.category %}
                            {% cache body_right_center_timeout body_right_top %}
                            <div class="my-3"><span class="border-start border-5  ps-3">最近更新</span></div>                
                                    <hr>
                                    {% article_cate_list category=0 shownum=10 as articles %}
                                    {% for item in articles%}
                                        <div class="border-bottom p-1 mt-3 d-flex  flex-nowrap">
                                            <a href="{{ item.get_absolute_url }}" rel="nofollow"><img style="width: 4rem;height: 4rem;" src="{% if item.thumb_image%}{{ uploadpath }}{{item.thumb_image}}{%else%}{% nopic cate=item.category.slug %}{% endif %}" alt="{{ item.title }}"  class="rounded me-3"  onerror="javascript:this.style.display='none'"></a>
                                            <div class="flex-column d-flex">
                                                <div class=" fw-bold" style="font-size: 90%"><a href="{{ item.get_absolute_url }}">{{ item.title|slice:'30' }}</a></div>
                                                <div class="text-secondary mt-auto" style="font-size: 50%">{{ item.update_time | date:"Y-m-d H:i:s" }} <span class="ms-3">浏览：{{ item.hits }}</span>    </div>
                                            </div>
                                        </div>
                                    
                                    {% endfor%}
                            {% endcache %} 
                        {% endif %}
                    {% endblock %} 
                    
                    {% block body_right_center %}         
                        {% cache body_right_center_timeout body_right_center %}                   
                            <div class="my-3"><span class="border-start border-5  ps-3">热门文章</span></div>                
                            <hr>
                            {% article_cate_list category=0 order_by='-hits' shownum=10 as articles %}
                                {% for item in articles%}
                                    <div class="border-bottom p-1 mt-3 d-flex  flex-nowrap">
                                        <a href="{{ item.get_absolute_url }}" rel="nofollow"><img style="width: 4rem;height: 4rem;" src="{% if item.thumb_image%}{{ uploadpath }}{{item.thumb_image}}{%else%}{% nopic cate=item.category.slug %}{% endif %}" alt="{{ item.title }}"  class="rounded me-3"  onerror="javascript:this.style.display='none'"></a>
                                        <div class="flex-column d-flex">
                                            <div class=" fw-bold" style="font-size: 90%"><a href="{{ item.get_absolute_url }}">{{ item.title|slice:'30' }}</a></div>
                                            <div class="text-secondary mt-auto" style="font-size: 50%">{{ item.update_time | date:"Y-m-d H:i:s" }} <span class="ms-3">浏览：{{ item.hits }}</span>    </div>
                                        </div>
                                    </div>
                                
                                {% endfor%}
                            {% get_tag_list order_by='?' limit=20 as tagslist%} 
                            <div class="fs-6 mt-3"><i class="bi bi-tags-fill fs-6 text-primary"></i> 标签列表</div>
                            <hr />
                            <ul class="nav">

                                {% for item in tagslist %}
                                <li class="nav-item mt-3">
                                    <a href="{{ item.get_absolute_url }}" class="btn-group me-3  btn-group-sm" title="{{item.usage_count}}篇和“{{item.title}}”相关内容介绍、详解">
                                        <span class="btn btn-outline-secondary">{{item.title}}</span>
                                        <span class="btn btn-secondary">{{item.usage_count}}</span>
                                        
                                    </a>
                                </li>

                                {% endfor %}
                            </ul>
                            {% endcache %} 
                    {% endblock %}
                    
                    {% block body_right_bottom %}{% endblock %} 
                {% endblock %} 

            </div>
        </div>
    </div>
        {% endblock %}
        
    </main>
    {% block foot_main %}
    {% block foot_top %}{% endblock %} 
    {% block foot_center %}{% include 'includes/footer.html' %}{% endblock %} 
    {% block foot_bottom %}{% endblock %} 
    {% endblock %} 
    <div class="kefu">
        {% load qr_code %}
    <ul>
    <!-- <li class="kefu_wechat">
        <a class="d-block d-md-none" href="https://work.weixin.qq.com/kfid/kfcbbc48c80c094b9f3"><i class="bi bi-person-fill"></i></a>
        <a href="#" class="d-none d-md-block"><span><img src="{% static "images/wxworkqrcode.png" %}" alt="企业微信二维码" /></span><i class="bi bi-person-fill"></i></a>
    </li>
    
        <li><a href="tel:15666115168"><span>15666115168</span><i class="bi bi-telephone-fill"></i></a></li>
    <li><a href="http://wpa.qq.com/msgrd?v=3&uin=343489416&site=qq&menu=yes" target="_blank"><span>QQ在线客服</span><i class="fs-5">QQ</i></a></li> -->
    <!--<li><a href="/Guest" target="_blank"><span>留言咨询</span><i class="zi zi_msgchat"></i></a></li>-->
    <li class="kefu_qrcode"><a href="javascript:;"><span>{% qr_from_text request.build_absolute_uri size="6"  light_color="#FFFFFF"  %}扫码分享到手机阅读</span><i class="bi bi-upc-scan"></i></a></li>
    </ul>
    </div> 
    <button id="goTop" class="btn btn-sm shadow-none position-fixed bottom-0 end-0 mb-4 me-4">  
        <i class="bi bi-arrow-up-circle-fill fs-3 text-primary opacity-75 hover-opacity-100"></i>  
      </button>
      <script>
        $('.kefu .kefu_qrcode svg').width('100%').height('100%')
        //gotop
        $('#goTop').hide()
        $(function(){
            $(window).scroll(function(){
                var scrH=document.documentElement.scrollTop+document.body.scrollTop;
                if(scrH>200){
                    $('#goTop').fadeIn(400);
                }else{
                    $('#goTop').stop().fadeOut(400);
                }
            });
            $('#goTop').click(function(){
                $('html,body').animate({scrollTop:'0px'},200);
            });
        });
        
        //刷新验证码的脚本，放到body部分的最后面即可
        $('.captcha').click(function () {
            $.getJSON('/captcha/refresh/',function (result) {
                console.log(result)
                $('.captcha').attr('src',result['image_url']);
                $('#id_captcha_0').val(result['key']);
            });
        });
        $('#id_captcha_1').blur(function (){
               json_data={
                   'response':$('#id_captcha_1').val(),
                   'hashkey':$('#id_captcha_0').val()
               }
               $.getJSON('/api/ajax_captcha',json_data,function (data){
                   $('#captcha_status').remove()
                   
                   if(data['status']){
                        $('#id_captcha_1').after('<span id="captcha_status" class="text-success">*验证码正确</span>')
                        $('#captcha_btn').attr('disabled',false)
                        
                   }else {
                        $('#id_captcha_1').after('<span id="captcha_status" class="text-danger">*验证码错误</span>')
                   }
               });
           });
        {{ global_js|safe }}
    </script>
</body>
</html>
