<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>问答-</title>
    <link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}">
</head>
<body style="background: #f2f2f2;">

<div th:replace="~{common/header::header(activeUrl='question')}"></div>

<main role="main" class="container">
    <div class="row">
        <div class="col-md-9 blog-main">

            <div class="my-3 p-3 bg-white rounded shadow-sm">

                <h6 class="border-bottom border-gray pb-2 mb-0">
                    Q&A 累计：
                    <span th:text="${pageParam.getTotal()}"></span>
                    <span class="float-right" th:if="${!#strings.isEmpty(thisCategoryName)}">
                        <a th:href="@{/question}">全部</a>
                        /
                        <span th:text="${thisCategoryName}"></span>
                    </span>
                </h6>

                <div th:each="question:${questionList}" class="media text-muted pt-3">
                    <!-- 头像 -->
                    <img th:src="${question.getAuthorAvatar()}" style="border-radius: 5px " width="32" height="32">
                    <p class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray" style="margin-left: 5px">
                        <!-- 标题 -->
                        <a th:text="${question.getTitle()}"
                           th:href="@{'/question/read/'+${question.getQid()}}"
                           class="text-dark font-weight-bold text-decoration-none d-block">
                        </a>
                        <!-- 状态 -->
                        <span th:text="${question.getStatus()==0?'未解决':'已解决'}"
                              th:class="${question.getStatus()==0?'badge badge-warning':'badge badge-info'}">
                        </span>
                        <!-- 浏览量 -->
                        <span>
                            <svg class="bi bi-eye-fill" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
  <path d="M10.5 8a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0z"/>
  <path fill-rule="evenodd" d="M0 8s3-5.5 8-5.5S16 8 16 8s-3 5.5-8 5.5S0 8 0 8zm8 3.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z"/>
</svg>
                            [[${question.getViews()}]]
                        </span>
                        <!-- 时间 -->
                        <span th:text="${#dates.format(question.getGmtUpdate(),'yyyy-MM-dd')}"
                              class="badge badge-light float-right">
                        </span>
                    </p>
                </div>

                <!--分页-->
                <nav aria-label="Page navigation example" class="mt-4">
                    <ul class="pagination justify-content-center pagination-sm">
                        <li th:class="${pageParam.hasPrevious()==true?'page-item':'page-item disabled'}">
                            <a class="page-link" th:href="@{'/question/'+${pageParam.getCurrent()-1}+'/10'}" tabindex="">Previous</a>
                        </li>
                        <li class="page-item" th:if="${pageParam.hasPrevious()}">
                            <a class="page-link" th:href="@{'/question/'+${pageParam.getCurrent()-1}+'/10'}" th:text="${pageParam.getCurrent()-1}"></a>
                        </li>
                        <li class="page-item active">
                            <a class="page-link" th:href="@{'/question/'+${pageParam.getCurrent()}+'/10'}" th:text="${pageParam.getCurrent()}"></a>
                        </li>
                        <li class="page-item" th:if="${pageParam.hasNext()}">
                            <a class="page-link" th:href="@{'/question/'+${pageParam.getCurrent()+1}+'/10'}" th:text="${pageParam.getCurrent()+1}"></a>
                        </li>
                        <li th:class="${pageParam.hasNext()==true?'page-item':'page-item disabled'}">
                            <a class="page-link"  th:href="@{'/question/'+${pageParam.getCurrent()+1}+'/10'}" >Next</a>
                        </li>
                    </ul>
                </nav>

            </div>

        </div>

        <aside class="col-md-3 blog-sidebar">

            <div class="my-3 rounded">
                <p class="mb-0">
                    <a th:href="@{/question/write}" class="btn btn-primary btn-sm btn-block" style="color: white">发布问题</a>
                </p>
            </div>

            <div class="p-4 my-3 bg-white rounded">
                <p class="mb-0"> 社区公约: <br> 提问内容描述一定要清楚，回答尽量靠近主题，禁止瞎水社区，违者暂停账号使用!</p>
            </div>

            <div class="p-4 my-3 bg-white rounded">
                <a th:href="@{'/question/category/'+${category.getId()}+'/1/10'}"
                   th:each="category:${categoryList}" th:text="${category.getCategory()}"
                   class="badge badge-pill badge-primary mr-1"></a>
            </div>

            <div class="p-4 my-3 bg-white rounded">
                <h4 class="font-italic">友情链接</h4>
                <ol class="list-unstyled">
                </ol>
            </div>
        </aside>

    </div>

</main>


<div th:replace="~{common/footer::footer}"></div>

<a class="to-top">返回顶部</a>
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
<script th:src="@{/js/toTop.js}"></script>


<script>

</script>

</body>
</html>