|
3 | 3 | {% block title %}Posts{% endblock %} |
4 | 4 |
|
5 | 5 | {% block content %} |
6 | | - <header class="mb-4 pb-3 border-bottom"> |
7 | | - <span class="text-uppercase text-muted small fw-bold d-block mb-1">Blog</span> |
8 | | - <h1 class="display-6 fw-bold text-dark mb-0">Latest Articles</h1> |
9 | | - </header> |
10 | | - <div class="row g-4 py-4"> |
11 | | - |
12 | | - {{ include('@partial/left-menu.html.twig') }} |
13 | | - |
14 | | - <main class="col-lg-9 col-md-8"> |
15 | | - <div class="posts d-flex flex-column gap-3"> |
16 | | - {% for article in data.items %} |
17 | | - <article class="card border-0 shadow-sm rounded-3"> |
18 | | - <div class="card-body p-4"> |
19 | | - <div class="mb-3"> |
20 | | - <a href="{{ url('page::category-resource', {slug: article.category.slug}) }}" |
21 | | - class="badge bg-primary-subtle text-primary text-uppercase fw-bold text-decoration-none px-3 py-2 rounded-pill"> |
22 | | - {{ article.category.name }} |
23 | | - </a> |
24 | | - </div> |
25 | | - |
26 | | - <h2 class="h5 fw-bold mb-2"> |
27 | | - <a href="{{ url('page::blog-resource', {categorySlug: article.category.slug, slug: article.slug}) }}" class="link-dark text-decoration-none"> |
28 | | - {{ article.title }} |
29 | | - </a> |
30 | | - </h2> |
31 | | - |
32 | | - <p class="text-muted small mb-3">{{ article.excerpt }}</p> |
33 | | - |
34 | | - <div class="d-flex flex-wrap align-items-center justify-content-between gap-2 pt-3 border-top"> |
35 | | - <span class="text-muted small"> |
36 | | - By <a href="{{ path('page::author-resource', {slug: article.author.slug}) }}" class="fw-bold link-dark text-decoration-none">{{ article.author.name }}</a> |
37 | | - · {{ article.postDate|date('M d, Y') }} |
38 | | - </span> |
39 | | - |
40 | | - <a href="{{ url('page::blog-resource', {categorySlug: article.category.slug, slug: article.slug}) }}" |
41 | | - class="btn btn-outline-primary btn-sm rounded-pill px-3"> |
42 | | - Read more <i class="bi bi-arrow-right ms-1"></i> |
43 | | - </a> |
44 | | - </div> |
| 6 | +<header class="mb-4 pb-3 border-bottom"> |
| 7 | + <span class="text-uppercase text-muted small fw-bold d-block mb-1">Blog</span> |
| 8 | + <h1 class="display-6 fw-bold text-dark mb-0">Latest Articles</h1> |
| 9 | +</header> |
| 10 | +<div class="row g-4 py-4"> |
| 11 | + {{ include('@partial/left-menu.html.twig') }} |
| 12 | + <main class="col-lg-9 col-md-8"> |
| 13 | + <div class="posts d-flex flex-column gap-3"> |
| 14 | + {% for article in data.items %} |
| 15 | + <article class="card border-0 shadow-sm rounded-3"> |
| 16 | + <div class="card-body p-4"> |
| 17 | + <div class="mb-3"> |
| 18 | + <a href="{{ url('page::category-resource', {slug: article.category.slug}) }}" |
| 19 | + class="badge bg-primary-subtle text-primary text-uppercase fw-bold text-decoration-none px-3 py-2 rounded-pill"> |
| 20 | + {{ article.category.name }} |
| 21 | + </a> |
45 | 22 | </div> |
46 | | - </article> |
47 | | - {% else %} |
48 | | - <div class="text-center py-5 bg-white rounded-3 border shadow-sm"> |
49 | | - <i class="bi bi-newspaper display-4 text-muted d-block mb-3"></i> |
50 | | - <p class="text-muted mb-0">No articles found.</p> |
51 | | - </div> |
52 | | - {% endfor %} |
53 | | - </div> |
54 | | - |
55 | | - {% if data.lastPage > 1 %} |
56 | | - <nav class="mt-4 d-flex justify-content-center"> |
57 | | - <ul class="pagination pagination-sm"> |
58 | 23 |
|
59 | | - <li class="page-item {% if data.isFirstPage %}disabled{% endif %}"> |
60 | | - <a class="page-link rounded-start-3" href="?page={{ data.previousPage }}"> |
61 | | - <i class="fas fa-chevron-left"></i> |
| 24 | + <h2 class="h5 fw-bold mb-2"> |
| 25 | + <a href="{{ url('page::blog-resource', {categorySlug: article.category.slug, slug: article.slug}) }}" class="link-dark text-decoration-none"> |
| 26 | + {{ article.title }} |
62 | 27 | </a> |
63 | | - </li> |
64 | | - |
65 | | - {% for p in data.pages %} |
66 | | - <li class="page-item {% if p == data.currentPage %}active{% endif %}"> |
67 | | - <a class="page-link" href="?page={{ p }}">{{ p }}</a> |
68 | | - </li> |
69 | | - {% endfor %} |
70 | | - |
71 | | - <li class="page-item {% if data.isLastPage %}disabled{% endif %}"> |
72 | | - <a class="page-link rounded-end-3" href="?page={{ data.nextPage }}"> |
73 | | - <i class="fas fa-chevron-right"></i> |
| 28 | + </h2> |
| 29 | + <p class="text-muted small mb-3">{{ article.excerpt }}</p> |
| 30 | + <div class="d-flex flex-wrap align-items-center justify-content-between gap-2 pt-3 border-top"> |
| 31 | + <span class="text-muted small"> |
| 32 | + By <a href="{{ path('page::author-resource', {slug: article.author.slug}) }}" class="fw-bold link-dark text-decoration-none">{{ article.author.name }}</a> |
| 33 | + · {{ article.postDate|date('M d, Y') }} |
| 34 | + </span> |
| 35 | + |
| 36 | + <a href="{{ url('page::blog-resource', {categorySlug: article.category.slug, slug: article.slug}) }}" |
| 37 | + class="btn btn-outline-primary btn-sm rounded-pill px-3"> |
| 38 | + Read more <i class="bi bi-arrow-right ms-1"></i> |
74 | 39 | </a> |
| 40 | + </div> |
| 41 | + </div> |
| 42 | + </article> |
| 43 | + {% else %} |
| 44 | + <div class="text-center py-5 bg-white rounded-3 border shadow-sm"> |
| 45 | + <i class="bi bi-newspaper display-4 text-muted d-block mb-3"></i> |
| 46 | + <p class="text-muted mb-0">No articles found.</p> |
| 47 | + </div> |
| 48 | + {% endfor %} |
| 49 | + </div> |
| 50 | + {% if data.lastPage > 1 %} |
| 51 | + <nav class="mt-4 d-flex justify-content-center"> |
| 52 | + <ul class="pagination pagination-sm"> |
| 53 | + <li class="page-item {% if data.isFirstPage %}disabled{% endif %}"> |
| 54 | + <a class="page-link rounded-start-3" href="?page={{ data.previousPage }}"> |
| 55 | + <i class="fas fa-chevron-left"></i> |
| 56 | + </a> |
| 57 | + </li> |
| 58 | + |
| 59 | + {% for p in data.pages %} |
| 60 | + <li class="page-item {% if p == data.currentPage %}active{% endif %}"> |
| 61 | + <a class="page-link" href="?page={{ p }}">{{ p }}</a> |
75 | 62 | </li> |
76 | | - |
77 | | - </ul> |
78 | | - </nav> |
79 | | - |
80 | | - <p class="text-center text-muted small mt-2"> |
81 | | - Page {{ data.currentPage }} of {{ data.lastPage }} |
82 | | - · |
83 | | - {{ data.count }} articles total |
84 | | - </p> |
85 | | - {% endif %} |
86 | | - |
87 | | - </main> |
88 | | - |
89 | | - </div> |
| 63 | + {% endfor %} |
| 64 | + |
| 65 | + <li class="page-item {% if data.isLastPage %}disabled{% endif %}"> |
| 66 | + <a class="page-link rounded-end-3" href="?page={{ data.nextPage }}"> |
| 67 | + <i class="fas fa-chevron-right"></i> |
| 68 | + </a> |
| 69 | + </li> |
| 70 | + </ul> |
| 71 | + </nav> |
| 72 | + <p class="text-center text-muted small mt-2"> |
| 73 | + Page {{ data.currentPage }} of {{ data.lastPage }} |
| 74 | + · |
| 75 | + {{ data.count }} articles total |
| 76 | + </p> |
| 77 | + {% endif %} |
| 78 | + </main> |
| 79 | +</div> |
90 | 80 | {% endblock %} |
0 commit comments