<!DOCTYPE HTML>
<html lang="zh-CN">

<head>
    <% include("base/web-settings-meta.html"){} %>
    <title>${site.siteName!}-首页</title>
</head>
<body>

<% include("base/index-list-left-menu.html"){} %>

<div class="nav-user">
    <a class="btn-search" href="#"><i class="fa fa-search"></i></a>
    <a class="btn-read-mode" href="#"><i class="fa fa-sun-o"></i></a>
    <a class="btn-donate" href="javascript:"><i class="fa fa-weixin"></i></a>
</div>
<div id="wrapper" class="clearfix">
    <div id="body">
        <div class="main" id="main">

            <% include("base/index-list-user-view.html"){} %>

            <div class="page-title">
                <ul>
                    <li class="active meu" data-index="0"><a href="#" data-name="全部文章">全部文章</a></li>

                    <li class="meu" data-index="1"><a href="#" data-name="最近发表">最近发表</a></li>

                    <li class="meu" data-index="2"><a href="#" data-name="热门文章">热门文章</a></li>

                    <li class="meu" data-index="3"><a href="#" data-name="友情链接">友情链接</a></li>

                    <li class="page-search">
                        <form id="search" class="search-form">
                            <label for="keyWord" class="sr-only">请输入博文名称</label>
                            <input class="search-field" type="text" name="s" class="text" placeholder="请输入博文名称"/>
                            <button type="submit" class="search-form-submit" title="搜索"><i class="fa fa-search"></i>
                            </button>
                        </form>
                    </li>

                </ul>

            </div>

            <div class="tabs-content-placeholder">
                <!-- 全部-->
                <post class="tab-content-active">

                    <% if(isEmpty(dataList)){ %>

                    <% if(isEmpty(keyWord)){ %>
                    <div class="alert alert-info blog-not-find">未检索到博文条目,请后台录入</div>
                    <% }else{ %>
                    <div class="alert alert-info blog-not-find">未搜索到与 "${keyWord!}" 相关的博文信息</div>
                    <% } %>

                    <% }else{
                    for(data in dataList){
                    %>
                    <article class="post">

                        <div class="post-header">
                            <div class="post-meta">
                                <a href="#" target="_self">
                                    <strong>${data.cname}</strong>
                                </a>
                                <em>·</em>${data.createTime,dateFormat="yyyy-MM-dd"}
                            </div>
                            <a class="post-title" href="/article/${data.ename}/details/${data.shamId}.html"
                               target="_self" title="${data.title}">${data.title}</a>
                            <div class="post-meta">
                                <a href="/tags" target="_self"><i class="fa fa-tags"></i></a>
                                <em>·</em>
                                <a href="#" target="_self">Java</a>

                            </div>
                        </div>
                        <div class="post-desc">
                            ${data.intro}
                        </div>
                    </article>

                    <%}} %>

                    <div id="btn-pager">


                        <%

                        for(var i=1;i
                        <page.totalPage
                                +1;i++){
                                if(page.currentPage==i){
                                print(
                        "<span class='page-number current'>"+i+"</span>");
                        }else{
                        print("<a class='page-number' href='/index?index="+i+"'>"+i+"</a>");
                        }
                        }
                        %>
                    </div>

                </post>

                <!-- 最近发表-->
                <post>

                    <%if(isNotEmpty(lastPublish)){%>

                    <%
                    var publishArticleIndex=1;
                    for(data in lastPublish){
                    %>


                    <article class="post">

                        <div class="post-header">
                            <a class="post-title" href="/article/${data.ename}/details/${data.shamId}.html"
                               target="_self" title="${data.title}">${data.title}</a>
                            <div class="post-meta">
                                <a href="#" target="_self">
                                    <strong>${data.cname}</strong>
                                </a>
                                发表于：${data.createTime,dateFormat="yyyy-MM-dd"}
                            </div>
                        </div>
                    </article>

                    <%
                    publishArticleIndex++;

                    } %>

                    <%}%>


                </post>

                <!-- 热门文章-->
                <post>

                    <%if(isNotEmpty(hots)){%>

                    <%
                    var hotArticleIndex=1;
                    for(data in hots){
                    %>


                    <article class="post">

                        <div class="post-header">
                            <a class="post-title" href="/article/${data.ename}/details/${data.shamId}.html"
                               target="_self" title="${data.title}">${data.title}</a>
                            <div class="post-meta">
                                <a href="#" target="_self">
                                    <strong>${data.cname}</strong>
                                </a>
                                发表于：${data.createTime,dateFormat="yyyy-MM-dd"}
                            </div>
                        </div>
                    </article>

                    <%
                    hotArticleIndex++;

                    } %>

                    <%}%>


                </post>
                <!-- 友情链接-->
                <post>


                    <%if(isNotEmpty(blogrolls)){%>


                    <div class="main-inner">
                        <article class="post" itemscope itemtype="http://schema.org/BlogPosting">
                            <div class="post-content markdown-body" itemprop="articleBody">
                                <ul class="tag-list">

                                    <%
                                    for(data in blogrolls){
                                    %>
                                    <li><a href="${data.link}" target="_blank">${data.cname}</a></li>
                                    <%} %>
                                </ul>
                            </div>
                        </article>
                    </div><!-- end #main-->

                    <%}%>


                </post>

            </div>

        </div><!-- end #main-->
    </div><!-- end #body -->

    <% include("base/web-settings-footer.html"){} %>
</div>

<script>
    $(document).ready(function () {
        var widget = $('.page-title');
        var main = $('.main');
        var tabs = widget.find('ul li.meu');
        var content = main.find('.tabs-content-placeholder > post');
        tabs.on('click', function (e) {
            e.preventDefault();
            var index = $(this).data('index');
            tabs.removeClass('active');
            content.removeClass('tab-content-active');
            $(this).addClass('active');
            content.eq(index).addClass('tab-content-active');
        });
    });
</script>


</body>
</html>