<!DOCTYPE html>
<html lang="en"
      th:replace="~{admin/dashboard/layout:: parent(~{::#content},~{::title},~{::script})}"
      xmlns="http://www.w3.org/1999/html">
<head>
    <title >View A Tag</title>
</head>
<body>
    <!-- Page content-->
        <section class="content" id="content">

                <div class="row">
                    <div class="col-md-6">
                        <div class="card card-primary">
                            <div class="card-header">
                                <h3 class="card-title">View Tag</h3>

                                <div class="card-tools">
                                    <button type="button" class="btn btn-tool" data-card-widget="collapse" title="Collapse">
                                        <i class="fas fa-minus"></i>
                                    </button>
                                </div>
                            </div>
                            <div class="card-body">
                                    <div class="form-group">
                                        <label for="id">Id</label>
                                        <p id="id" th:text="${tagObj.tagId}"></p>
                                    </div>
                                    <div class="form-group">
                                        <label for="name">Name</label>
                                        <p id="name" th:text="${tagObj.name}"></p>
                                    </div>
                                    <div class="form-group">
                                        <label for="slug">Slug</label>
                                        <p id="slug" th:text="${tagObj.slug}"></p>
                                    </div>
                                    <div class="form-group">
                                        <label for="description">Description</label>
                                        <p id="description" th:text="${tagObj.desc}"></p>
                                    </div>
                                    <div class="form-group">
                                        <label for="date">Date</label>
                                        <p id="date" th:text="${tagObj.createdAt}"></p>
                                    </div>
                                    <div class="form-group">
                                        <label>Tag Status</label>
                                        <p th:text="${tagObj.isActive == T(com.codenetworkz.blog.models.Status).YES  ? 'Active' : 'InActive'}"></p>
                                    </div>
                                <div class="form-group">
                                    <label>Admin Approve Status</label>
                                    <p th:text="${tagObj.isApproved == T(com.codenetworkz.blog.models.Status).YES ? 'Accept' :
                                    (tagObj.isApproved == T(com.codenetworkz.blog.models.Status).NO ? 'Denied' :
                                    'Pending')}"></p>
                                </div>
                        </div>
                        <!-- /.card -->
                    </div>
                    </div>
                </div>
                    <div class="row">
                        <div class="col-md-12">
                            <div class="card card-primary">
                                <div class="card-header">
                                    <h3 class="card-title">List Of Tags</h3>
                                    <div class="card-tools">
                                        <button type="button" class="btn btn-tool" data-card-widget="collapse" title="Collapse">
                                            <i class="fas fa-minus"></i>
                                        </button>
                                    </div>
                                </div>
                                <div class="card-body">
                                    <div class="row">
                                        <div class="col-12">
                                            <div class="card">
                                                <div class="card-header">
                                                    <div class="card-tools">
                                                        <div class="input-group input-group-sm" style="width: 150px;">
                                                            <input type="text" name="table_search" class="form-control float-right" placeholder="Search">
                                                            <div class="input-group-append">
                                                                <button type="submit" class="btn btn-default">
                                                                    <i class="fas fa-search"></i>
                                                                </button>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div> <!-- /.card-header -->
                                                <div class="card-body table-responsive p-0">
                                                    <table class="table table-hover text-nowrap display" id="example">
                                                        <thead>
                                                        <tr>
                                                            <th>ID</th>
                                                            <th>Name </th>
                                                            <th>Description </th>
                                                            <th>Date</th>
                                                            <th>Status</th>
                                                            <th>Admin Status</th>
                                                            <th>Action</th>
                                                        </tr>
                                                        </thead>
                                                        <tbody>
                                                        <tr  th:each="tag : ${tags}" >
                                                            <td th:text="${tag.tagId}"> </td>
                                                            <td th:text="${tag.name}"></td>
                                                            <td th:text="${tag.desc}"></td>
                                                            <td th:text="${tag.createdAt}"></td>
                                                            <td>
                                                                <span th:text="${tag.activeStatus == T(com.codenetworkz.blog.models.Status).YES  ? 'Active' : 'InActive'}"> </span>
                                                            </td>
                                                            <td>
                                                      <span th:text="${tag.adminStatus == T(com.codenetworkz.blog.models.Status).YES ? 'Accept' :
                                                                        (tag.activeStatus == T(com.codenetworkz.blog.models.Status).NO ? 'Denied' :
                                                                        'Pending')}">
                                                        </span>
                                                            </td>
                                                            <td class="project-actions text-left">
                                                                <a class="btn btn-primary btn-sm" th:href="@{'/admin/tags/view/'+${tag.slug}}"  title="View Tag">
                                                                    <i class="fas fa-folder">
                                                                    </i>
                                                                    View
                                                                </a>
                                                                <a class="btn btn-info btn-sm" th:href="@{'/admin/tags/update/'+${tag.slug}}" title="Edit Tag">
                                                                    <i class="fas fa-pencil-alt">
                                                                    </i>
                                                                    Edit
                                                                </a>
                                                                <form th:action="@{'/admin/tags/change-status/' + ${category.slug}}" method="post" style="display: inline;">
                                                                    <input type="hidden" name="slug" value="${category.slug}" />
                                                                    <button type="submit" class="btn btn-primary btn-sm" title="Admin Approved">
                                                                        <i class="fas fa-user-shield"></i>
                                                                        Change Status
                                                                    </button>
                                                                </form>

                                                                <form th:action="@{'/admin/tags/delete/' + ${tag.slug}}" method="post" style="display: inline;">
                                                                    <input type="hidden" name="slug" value="${tag.slug}" />
                                                                    <button type="submit" class="btn btn-danger btn-sm" title="delete">
                                                                        <i class="fas fa-trash" ></i>
                                                                        Delete
                                                                    </button>
                                                                </form>

                                                            </td>

                                                        </tr>
                                                        <tr th:if="${#lists.isEmpty(tags)}">
                                                            <td colspan="7" class="text-center">No tags found.</td>
                                                        </tr>
                                                        </tbody><!-- /.card-body -->
                                                    </table>
                                                </div>
                                                <div class="card-footer clearfix" th:if="${!#lists.isEmpty(tags)}">
                                                    <ul class="pagination pagination-sm m-0 float-right">
                                                        <li class="page-item">
                                                            <a class="page-link" th:if="${tags.hasPrevious()}" th:href="@{/admin/tags/list(page=${tags.number - 1}, size=${tags.size})}">«</a></li>
                                                        <li class="page-item" th:each="i : ${#numbers.sequence(0, tags.totalPages - 1)}">
                                                            <a class="page-link" th:href="@{/admin/tags/list(page=${i}, size=${tags.size})}" th:text="${i + 1}">1</a></li>
                                                        <li class="page-item">
                                                            <a class="page-link" th:if="${tags.hasNext()}" th:href="@{/admin/tags/list(page=${tags.number + 1}, size=${tags.size})}">»</a></li>
                                                    </ul>
                                                </div>
                                                <!-- /.card -->
                                            </div>
                                        </div>
                                    </div>
                                    <!-- /.col -->
                                </div><!-- /.row -->
                        </div>
                    </div>
                </div>
        </section>
<br />
</body>

</html>
