<!--

    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

-->
{{template "header" . }}
<div class="d-flex justify-content-center px-0 px-md-4">
  <div class="answer-container">
    <div class="pt-4 mb-5 row">
      <div class="page-main flex-auto overflow-x-hidden col">
        <div>
          <div class="mb-3 d-flex flex-wrap justify-content-between">
            <h5 class="fs-5 text-nowrap mb-3 mb-md-0">
              {{translator $.language "ui.question.all_questions"}}
            </h5>
            {{template "sort-btns" .}}
          </div>
          <div class="rounded-0 list-group">
            {{range .data}}
            <li class="py-3 px-2 border-start-0 border-end-0 position-relative pointer list-group-item list-group-item-action">
              <div class="d-flex flex-wrap text-secondary small mb-12">
                <div class="d-flex align-items-center  text-secondary me-1">
                  <a href="{{$.baseURL}}/users/{{.Operator.Username}}">
                    <img src="{{$.baseURL}}/users/{{.Operator.Avatar}}" width="24px" height="24px" class="rounded-circle me-1" alt="shuai" data-processed="true">
                    <span class="me-1 name-ellipsis" style="max-width: 300px;">{{.Operator.DisplayName}}</span>
                  </a>
                  <span class="fw-bold" title="Reputation">{{.Operator.Rank}}</span>
                </div>
                •
                <time
                  class="text-secondary ms-1"
                  datetime="{{timeFormatISO $.timezone .OperatedAt}}"
                  title="{{translatorTimeFormatLongDate $.language $.timezone .OperatedAt}}">
                  {{translator $.language "ui.question.asked"}}
                  {{translatorTimeFormat $.language $.timezone .OperatedAt}}
                </time>
              </div>

              <h5 class="text-wrap text-break">
                {{if $.useTitle }}
                <a class="link-dark d-block" href="{{$.baseURL}}/questions/{{.ID}}/{{urlTitle .Title}}">
                  {{.Title}}
                </a>
                {{else}}
                <a class="link-dark d-block" href="{{$.baseURL}}/questions/{{.ID}}">{{.Title}}</a>
                {{end}}
              </h5>

              <div class="text-truncate-2 mb-2">
                {{if $.useTitle }}
                <a class="d-block small text-body" href="{{$.baseURL}}/questions/{{.ID}}/{{urlTitle .Title}}">{{.Description}}
                </a>
                {{else}}
                <a class="d-block small text-body" href="{{$.baseURL}}/questions/{{.ID}}">{{.Description}}</a>
                {{end}}
              </div>

              <div class="question-tags mb-12">
                {{range .Tags }}
                <a
                  href="{{$.baseURL}}/tags/{{.SlugName}}"
                  class="badge-tag rounded-1 {{if .Reserved}}badge-tag-reserved{{end}} {{if .Recommend}}badge-tag-required{{end}} me-1">
                  <span class="">{{.SlugName}}</span>
                </a>
                {{end}}
              </div>

              <div class="small text-secondary">
                <div class="d-flex align-items-center mt-2 mt-md-0">
                  <div class="d-flex align-items-center flex-shrink-0">
                    <i class="br bi-hand-thumbs-up-fill me-1"></i>
                    <span class="fw-medium">{{.VoteCount}}</span>
                    <span class="ms-1">{{translator $.language "ui.counts.votes"}}</span>
                  </div>
                  <div class="d-flex flex-shrink-0 align-items-center ms-3">
                    <i class="br bi-chat-square-text-fill me-1"></i>
                    <span class="fw-medium">{{.AnswerCount}}</span>
                    <span class="ms-1">{{translator $.language "ui.counts.answers"}}</span>
                  </div>
                  <span class="summary-stat ms-3 flex-shrink-0">
                    <i class="br bi-bar-chart-fill"></i>
                    <span class="fw-medium ms-1">{{.ViewCount}}</span>
                    <span class="ms-1">{{translator $.language "ui.counts.views"}}</span>
                  </span>
                </div>
              </div>
            </li>
            {{end}}
          </div>
          <div class="mt-4 mb-2 d-flex justify-content-center">
            {{template "page" .}}
          </div>
        </div>
      </div>
      <div class="page-right-side mt-4 mt-xl-0 col">
        {{template "hot-question" .}}
      </div>
    </div>
  </div>
</div>
{{template "footer" .}}
