<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" th:with="title='管理中心',active='home'">
<header th:replace="admin/header::headerFragment(${title},${active})"></header>
<body class="fixed-left">
<div id="wrapper">
    <div th:replace="admin/header::header-body"></div>
    <div class="content-page">
        <div class="content">
            <div class="container">
                <div class="row">
                    <div class="col-sm-12">
                        <h4 class="page-title">仪表盘</h4>
                    </div>

                    <div class="row">
                        <div class="col-sm-6 col-lg-3">
                            <div class="mini-stat clearfix bx-shadow bg-info">
                                <span class="mini-stat-icon"><i class="fa fa-quote-right" aria-hidden="true"></i></span>
                                <div class="mini-stat-info text-right">
                                    发表了<span class="counter" th:text="${statistics.articles}"></span>篇文章
                                </div>
                            </div>
                        </div>

                        <div class="col-sm-6 col-lg-3">
                            <div class="mini-stat clearfix bg-purple bx-shadow">
                                <span class="mini-stat-icon"><i class="fa fa-comments-o" aria-hidden="true"></i></span>
                                <div class="mini-stat-info text-right">
                                    收到了<span class="counter" th:text="${statistics.comments}"></span>条留言
                                </div>
                            </div>
                        </div>

                        <div class="col-sm-6 col-lg-2">
                            <div class="mini-stat clearfix bg-pink bx-shadow">
                                <span class="mini-stat-icon"><i class="fa fa-font-awesome" aria-hidden="true"></i></span>
                                <div class="mini-stat-info text-right">
                                    在线人数<span class="counter" th:text="${application.online_number}">0</span>人
                                </div>
                            </div>
                        </div>

                        <div class="col-sm-6 col-lg-2">
                            <div class="mini-stat clearfix bg-success bx-shadow">
                                <span class="mini-stat-icon"><i class="fa fa-cloud-upload"
                                                                aria-hidden="true"></i></span>
                                <div class="mini-stat-info text-right">
                                    上传了<span class="counter" th:text="${statistics.attachs}"></span>个附件
                                </div>
                            </div>
                        </div>


                        <div class="col-sm-6 col-lg-2">
                            <div class="mini-stat clearfix bg-primary bx-shadow">
                                <span class="mini-stat-icon"><i class="fa fa-link" aria-hidden="true"></i></span>
                                <div class="mini-stat-info text-right">
                                    友链了<span class="counter" th:text="${statistics.links}"></span>个好友
                                </div>
                            </div>
                        </div>

                    </div>

                    <div class="row">
                        <div class="col-md-4">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h4 class="panel-title">最新文章</h4>
                                </div>
                                <div class="panel-body">
                                    <ul class="list-group">
                                        <li class="list-group-item" th:each="article : ${articles}">
                            <span class="badge badge-primary"
                                  th:title="${article.commentsNum}+'条评论'" th:text="${article.commentsNum}"></span>
                                            <a target="_blank" th:href="${commons.site_url('/article/')}+${article.cid}"
                                               th:text="${article.title}"></a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <!--最新留言-->
                        <div class="col-md-4">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h4 class="panel-title">最新留言</h4>
                                </div>
                                <div class="panel-body">
                                    <div th:if="${comments}== null and ${#lists.size(comments)}==0">
                                        <div class="alert alert-warning">
                                            还没有收到留言.
                                        </div>
                                    </div>
                                    <ul class="list-group"
                                        th:unless="${comments}==null and ${#lists.size(comments)}==0">
                                        <li class="list-group-item" th:each="comment : ${comments}">
                                            <div th:if="${comment.url}!=null and ${comment.url}!=''">
                                                <a th:href="@{${comment.url}}" target="_blank"
                                                   th:text="${comment.author}"></a>
                                            </div>
                                            <th:block th:unless="${comment.url}!=null and ${comment.url}!=''" th:text="${comment.author}"/>
                                            于<th:block th:text="${commons.fmtdate(comment.created,'MM月dd日HH:mm')}"/>：<a
                                                th:href="${commons.site_url('/article/')}+${comment.contents.cid}+'#comments'"
                                                target="_blank" th:utext="${commons.article(comment.content)}"></a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <!--系统日志-->
                        <div class="col-md-4">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h4 class="panel-title">系统日志</h4>
                                </div>
                                <div class="panel-body">
                                    <ul class="list-group" >
                                        <li class="list-group-item" th:each="log : ${logs}">
                                            <span th:text="${commons.fmtdate(log.created, 'yyyy-MM-dd HH:mm:ss')} +' => '+ ${log.action}"></span>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div th:replace="admin/footer :: footer-content"></div>
            </div>
        </div>
    </div>
</div>
<div th:replace="admin/footer :: footer"></div>
</body>
</html>