Skip to content

Commit be8331d

Browse files
committed
Added empty list error messages
1 parent ff0e631 commit be8331d

File tree

7 files changed

+34
-27
lines changed

7 files changed

+34
-27
lines changed

bloggy/templates/pages/archive/articles.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
{% categories_widget count=99 content_type="article" widgetStyle="list" %}
1313
<div class="flex-grow-1">
1414
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-1 latest-feed-container">
15+
{% if articles|length <= 0 %}
16+
<p class="lead my-3 text-muted">No contents found!</p>
17+
{% endif %}
18+
1519
{% for article in articles %}
1620
<div class="col mb-3">
1721
{% include "partials/article_row_grid.html" with article=article cssClass="card-rounded" %}

bloggy/templates/pages/archive/categories.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends "base-with-header-footer.html" %}
22
{% load static %}
33
{% spaceless %}
4-
{# {% block base_css_class %}bg-light{% endblock base_css_class %}#}
4+
{# {% block base_css_class %}bg-light{% endblock base_css_class %}#}
55
{% block content %}
66
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/masonry.pkgd.min.js"
77
integrity="sha384-GNFwBvfVxBkLMJpYMOABq3c+d3KnQxudP/mGPkzpZSTYykLBNsZEnG2D9G/X/+7D"
@@ -24,6 +24,10 @@ <h1 class="display-1">
2424
</div>
2525
<div class="container">
2626
<div class="row row-eq-height archive-grid pb-4" data-masonry='{"percentPosition": true }'>
27+
{% if categories|length <= 0 %}
28+
<p class="lead my-3 text-muted">No contents found!</p>
29+
{% endif %}
30+
2731
{% for category in categories %}
2832
<div class="col-md-3">
2933
<div class="py-2 h-100">

bloggy/templates/pages/archive/courses.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ <h1 class="display-1 px-lg-5">Courses</h1>
1616
</div>
1717
</div>
1818
<div class="row row-cols-1 row-cols-md-3 row-cols-lg-4 g-4 gy-3 mb-5">
19+
{% if courses|length <= 0 %}
20+
<p class="lead my-3 text-muted">No contents found!</p>
21+
{% endif %}
22+
1923
{% for course in courses %}
2024
{% include 'partials/course_grid_column.html' %}
2125
{% endfor %}

bloggy/templates/pages/archive/quizzes.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ <h1 class="display-1">
1515
</div>
1616
</div>
1717
<div class="container pb-4 d-flex">
18+
{% if posts|length <= 0 %}
19+
<p class="lead my-3 text-muted">No contents found!</p>
20+
{% endif %}
21+
1822
<div class="row">
1923
<div class="container">
2024
<div class="row row-cols-1 row-cols-md-3 row-cols-lg-4 g-4 gy-3">

bloggy/templates/partials/section_home_courses.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22
<section class="homeCourses__section pb-2 pt-md-3 pb-lg-3">
33
{% load static %}
44
<div class="container">
5-
<div class="d-flex py-3">
6-
<div class="flex-shrink-0 pe-2">
7-
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"
8-
fill="rgb(51, 65, 85)">
9-
<path d="M480-72 170-240v-273L-19-618l499-273 500 273v366H874v-308l-84 47v273L480-72Zm0-394 280-152-280-151-279 151 279 152Zm0 273 204-110v-155L480-345 276-458v155l204 110Zm1-273Zm-1 113Zm0 0Z"/>
10-
</svg>
11-
</div>
12-
<h2 class="h2">Free Courses</h2>
5+
<div class="py-3">
6+
<h2 class="h2">Courses</h2>
137
</div>
148

159
<div class="row row-cols-1 row-cols-md-3 row-cols-lg-4 g-4 gy-3">
10+
{% if courses|length <= 0 %}
11+
<p class="lead my-3 text-muted">No contents found!</p>
12+
{% endif %}
13+
1614
{% for course in courses %}
1715
{% include 'partials/course_grid_column.html' %}
1816
{% endfor %}

bloggy/templates/partials/section_home_quizs.html

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,15 @@
44
<section id="homeQuizzes_section" class="homeQuizzes py-3 py-md-5">
55
<div class="container">
66

7-
<div class="d-flex pt-3">
8-
<div class="flex-shrink-0 pe-2">
9-
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"
10-
fill="rgb(51, 65, 85)">
11-
<path d="M569-344q21 0 35.5-14.5T619-394q0-21-14.5-35.5T569-444q-21 0-35.5 14.5T519-394q0 21 14.5 35.5T569-344Zm-39-140h77q-1-32 4.647-46.051Q617.294-544.102 638-567q33-34 43.5-53t10.5-45.772q0-48.189-34.263-78.708Q623.474-775 568-775q-45.824 0-79.912 26Q454-723 443-679l68 27q7-25 22.196-39 15.196-14 34.804-14 22 0 35 12.5t13 32.5q0 15-8.5 27.5T582-605q-39 35-45.5 51t-6.5 70ZM329-210q-43.725 0-74.863-31.137Q223-272.275 223-316v-488q0-43.725 31.137-74.862Q285.275-910 329-910h488q43.725 0 74.862 31.138Q923-847.725 923-804v488q0 43.725-31.138 74.863Q860.725-210 817-210H329Zm0-106h488v-488H329v488ZM143-24q-43.725 0-74.862-31.138Q37-86.275 37-130v-594h106v594h594v106H143Zm186-780v488-488Z"/>
12-
</svg>
13-
</div>
7+
<div class="pt-3">
148
<h2 class="h2">Interactive quizzes</h2>
159
</div>
16-
<p class="w-lg-50 mb-5 text-muted">Test your knowledge and learning progress with our quizzes!</p>
1710

1811
<div class="row">
1912
<div class="quizzes-bg">
20-
{% if quizzes|length > 0 %}
13+
{% if quizzes|length <= 0 %}
14+
<p class="lead my-3 text-muted">No contents found!</p>
15+
{% else %}
2116
<div class="row row-cols-1 row-cols-md-3 row-cols-lg-4 g-3">
2217
{% for quiz in quizzes %}
2318
<div class="col">
@@ -26,7 +21,8 @@ <h2 class="h2">Interactive quizzes</h2>
2621
<div class="highlight-container">
2722
<h3 class="mb-1 h4">
2823
<span class="quiz-title">
29-
<a href="{% url 'quiz_single' slug=quiz.slug %}" class="quiz-link">{{ quiz.title }}</a>
24+
<a href="{% url 'quiz_single' slug=quiz.slug %}"
25+
class="quiz-link">{{ quiz.title }}</a>
3026
</span>
3127
</h3>
3228
<small class="quiz-meta mb-0">

bloggy/templates/partials/section_home_recent_articles.html

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,19 @@
33
{% load custom_widgets %}
44
<section class="recent-articles py-3">
55
<div class="container">
6-
<div class="d-flex py-2">
7-
<div class="flex-shrink-0 pe-2">
8-
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"
9-
fill="rgb(51, 65, 85)">
10-
<path d="m123-213-74-76 328-328 164 164 191-191h-88v-106h268v270H806v-90L541-303 377-467 123-213Z"/>
11-
</svg>
12-
</div>
6+
<div class="py-2">
137
<h2 class="h2">Recent posts</h2>
148
</div>
159

1610
<div class="row row-cols-1 row-cols-md-1 row-cols-lg-2 g-3">
11+
{% if articles|length <= 0 %}
12+
<p class="lead my-3 text-muted">No contents found!</p>
13+
{% endif %}
14+
1715
{% for article in articles %}
1816
<div class="col">
1917
{% include "partials/article_row_grid.html" with article=article cssClass="card-rounded" %}
2018
</div>
21-
2219
{% endfor %}
2320
</div>
2421
<div class="text-center mt-5">

0 commit comments

Comments
 (0)