summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan DeMasi <jrdemasi@gmail.com>2020-03-09 23:26:49 -0600
committerJonathan DeMasi <jrdemasi@gmail.com>2020-03-09 23:26:49 -0600
commit7328e3dfc4171d90fdb81ae5c352f175505c1eb2 (patch)
tree360345d6458358dc3a3a83246949da92893317cb
parent379267b1ef6849d49a2dfb2abaac0c4847b87022 (diff)
parent9ec179b02cc38233bdaf0c6e4c09744b858bc2b7 (diff)
downloadjthanio-7328e3dfc4171d90fdb81ae5c352f175505c1eb2.tar
jthanio-7328e3dfc4171d90fdb81ae5c352f175505c1eb2.tar.gz
jthanio-7328e3dfc4171d90fdb81ae5c352f175505c1eb2.tar.bz2
jthanio-7328e3dfc4171d90fdb81ae5c352f175505c1eb2.tar.lz
jthanio-7328e3dfc4171d90fdb81ae5c352f175505c1eb2.tar.xz
jthanio-7328e3dfc4171d90fdb81ae5c352f175505c1eb2.tar.zst
jthanio-7328e3dfc4171d90fdb81ae5c352f175505c1eb2.zip
Merge branch 'reindent' of git://github.com/amayer5125/jthanio into amayer5125-reindent
-rw-r--r--blog/templates/blog/blog_index_page.html86
-rw-r--r--blog/templates/blog/blog_post.html38
-rw-r--r--blog/templates/blog/blog_tag_index_page.html31
-rw-r--r--home/templates/home/home_page.html13
-rw-r--r--home/templates/home/tags/top_menu.html34
-rw-r--r--jthanio/templates/base.html77
-rw-r--r--jthanio/templates/navigation.html4
-rw-r--r--jthanio/templates/search.html28
-rw-r--r--search/templates/search/search.html77
9 files changed, 168 insertions, 220 deletions
diff --git a/blog/templates/blog/blog_index_page.html b/blog/templates/blog/blog_index_page.html
index d58d1a9..355dafd 100644
--- a/blog/templates/blog/blog_index_page.html
+++ b/blog/templates/blog/blog_index_page.html
@@ -7,65 +7,63 @@
{% block content %}
<div class="container">
-
<div class="row">
-
- <!-- Blog Entries Column -->
+ {# Blog Entries Column #}
<div class="col-md-8">
-
<h1 class="my-4">{{ page.title }}
<small class="text-muted">{{ page.intro }}</small>
</h1>
+
<hr>
{% for post in blogpages %}
- {% with post=post.specific %}
-
- <!-- Blog Post -->
- <div class="card mb-4">
- {% if post.main_image %}
- {% image post.main_image fill-750x300-c100 class="card-img-top" %}
- {% endif %}
- <div class="card-body">
- <h2 class="card-title">{{ post.title }}</h2>
- <p class="card-text">{{ post.intro }}</p>
- <a href="{% pageurl post %}">Read Post</a>
- </div>
- <div class="card-footer text-muted">
- Posted on {{ post.date }}
- </div>
- </div>
- {% endwith %}
+ {% with post=post.specific %}
+ {# Blog Post #}
+ <div class="card mb-4">
+ {% if post.main_image %}
+ {% image post.main_image fill-750x300-c100 class="card-img-top" %}
+ {% endif %}
+ <div class="card-body">
+ <h2 class="card-title">{{ post.title }}</h2>
+ <p class="card-text">{{ post.intro }}</p>
+ <a href="{% pageurl post %}">Read Post</a>
+ </div>
+ <div class="card-footer text-muted">
+ Posted on {{ post.date }}
+ </div>
+ </div>
+ {% endwith %}
{% endfor %}
- <!-- Pagination -->
+ {# Pagination #}
{% if blogpages.paginator.num_pages > 1 %}
- <ul class="pagination justify-content-center mb-4">
- {% if blogpages.has_previous %}
- <li class="page-item">
- <a class="page-link" href="?page={{ blogpages.previous_page_number }}">&larr; Newer</a>
- </li>
- {% else %}
- <li class="page-item disabled">
- <a class="page-link" href="#">&larr; Newer</a>
- </li>
- {% endif %}
- {% if blogpages.has_next %}
- <li class="page-item">
- <a class="page-link" href="?page={{ blogpages.next_page_number }}">Older &rarr;</a>
- </li>
- {% else %}
- <li class="page-item disabled">
- <a class="page-link" href="#">Older &rarr;</a>
- </li>
- {% endif %}
+ <ul class="pagination justify-content-center mb-4">
+ {% if blogpages.has_previous %}
+ <li class="page-item">
+ <a class="page-link" href="?page={{ blogpages.previous_page_number }}">&larr; Newer</a>
+ </li>
+ {% else %}
+ <li class="page-item disabled">
+ <a class="page-link" href="#">&larr; Newer</a>
+ </li>
+ {% endif %}
+ {% if blogpages.has_next %}
+ <li class="page-item">
+ <a class="page-link" href="?page={{ blogpages.next_page_number }}">Older &rarr;</a>
+ </li>
+ {% else %}
+ <li class="page-item disabled">
+ <a class="page-link" href="#">Older &rarr;</a>
+ </li>
+ {% endif %}
+ </ul>
{% endif %}
</div>
- <!-- Sidebar Widgets Column -->
+ {# Sidebar Widgets Column #}
<div class="col-md-4">
- {% include "search.html" %}
+ {% include "search.html" %}
</div>
- </div>
+ </div>
</div>
{% endblock %}
diff --git a/blog/templates/blog/blog_post.html b/blog/templates/blog/blog_post.html
index 6bd48f8..e328308 100644
--- a/blog/templates/blog/blog_post.html
+++ b/blog/templates/blog/blog_post.html
@@ -7,40 +7,34 @@
{% block body_class %}template-blogpage{% endblock %}
{% block content %}
-
<div class="container">
-
<div class="row">
-
- <!-- Post Content Column -->
+ {# Post Content Column #}
<div class="col-lg-8">
-
- <!-- Title -->
+ {# Title #}
<h1 class="mt-4">{{ page.title }}</h1>
- <!-- Date/Time -->
+ {# Date/Time #}
{% with categories=page.categories.all %}
- <p>Posted on {{ page.date }}{% if categories %} in {{ categories|join:", " }}{% endif %}</p>
+ <p>Posted on {{ page.date }}{% if categories %} in {{ categories|join:", " }}{% endif %}</p>
{% endwith %}
<hr>
- <!-- Preview Image -->
+ {# Preview Image #}
{% if page.main_image %}
- {% image page.main_image fill-900x300-c100 class="img-fluid rounded" %}
- <hr>
+ {% image page.main_image fill-900x300-c100 class="img-fluid rounded" %}
+ <hr>
{% endif %}
- <!-- Post Content -->
+ {# Post Content #}
<p class="lead">{{ page.intro }}</p>
{% include_block page.body %}
-
-
</div>
- <!-- Sidebar Widgets Column -->
+ {# Sidebar Widgets Column #}
<div class="col-md-4">
{% include "search.html" %}
- <!-- Tags Widget -->
+ {# Tags Widget #}
<div class="card my-4">
<h5 class="card-header">Tags</h5>
<div class="card-body">
@@ -48,20 +42,18 @@
<div class="col-lg-10">
<ul class="list-unstyled mb-0">
{% if page.tags.all.count %}
- {% for tag in page.tags.all %}
- <span class="badge badge-light"><a href="{% slugurl 'tags' %}?tag={{ tag }}">{{ tag }}</a></span>
- {% endfor %}
+ {% for tag in page.tags.all %}
+ <span class="badge badge-light"><a href="{% slugurl 'tags' %}?tag={{ tag }}">{{ tag }}</a></span>
+ {% endfor %}
{% else %}
- No tags for this post
+ No tags for this post
{% endif %}
+ </ul>
</div>
</div>
</div>
</div>
</div>
-
-
-
</div>
<p><a href="{{ request.META.HTTP_REFERER }}">Return to previous page</a></p>
diff --git a/blog/templates/blog/blog_tag_index_page.html b/blog/templates/blog/blog_tag_index_page.html
index fda427b..9a3ac8a 100644
--- a/blog/templates/blog/blog_tag_index_page.html
+++ b/blog/templates/blog/blog_tag_index_page.html
@@ -3,18 +3,15 @@
{% block content %}
<div class="container">
-
<div class="row">
-
- <!-- Blog Entries Column -->
+ {# Blog Entries Column #}
<div class="col-md-8">
+ {% if request.GET.tag|length %}
+ <h1 class="my-4">Showing pages tagged "{{ request.GET.tag }}"</h1>
- {% if request.GET.tag|length %}
- <h1 class="my-4">Showing pages tagged "{{ request.GET.tag }}"</h1>
-
- {% for post in blogpages %}
- {% with post=post.specific %}
- <!-- Blog Post -->
+ {% for post in blogpages %}
+ {% with post=post.specific %}
+ {# Blog Post #}
<div class="card mb-4">
<div class="card-body">
<h2 class="card-title">{{ post.title }}</h2>
@@ -25,19 +22,17 @@
Posted on {{ post.date }}
</div>
</div>
- {% endwith %}
- {% endfor %}
- {% else %}
- <h1 class="my-4">No pages with tag {{request.GET.tag }} available</h1>
- {% endif %}
- <p><a href="{{ request.META.HTTP_REFERER }}">Return to previous page</a></p>
+ {% endwith %}
+ {% endfor %}
+ {% else %}
+ <h1 class="my-4">No pages with tag {{request.GET.tag }} available</h1>
+ {% endif %}
+ <p><a href="{{ request.META.HTTP_REFERER }}">Return to previous page</a></p>
</div>
- <!-- Sidebar Widgets Column -->
+ {# Sidebar Widgets Column #}
<div class="col-md-4">
{% include "search.html" %}
</div>
-
</div>
</div>
-
{% endblock %}
diff --git a/home/templates/home/home_page.html b/home/templates/home/home_page.html
index d7cc373..d8e296c 100644
--- a/home/templates/home/home_page.html
+++ b/home/templates/home/home_page.html
@@ -6,28 +6,21 @@
{% block content %}
<div class="container">
-
<div class="row">
-
- <!-- Post Content Column -->
+ {# Post Content Column #}
<div class="col-lg-8">
-
- <!-- Title -->
+ {# Title #}
<h1 class="mt-4">{{ page.title }}</h1>
<hr>
{% include_block page.body %}
-
</div>
- <!-- Sidebar Widgets Column -->
+ {# Sidebar Widgets Column #}
<div class="col-md-4">
{% include "search.html" %}
</div>
-
</div>
</div>
-
{% endblock %}
-
diff --git a/home/templates/home/tags/top_menu.html b/home/templates/home/tags/top_menu.html
index 3b6697c..aac45df 100644
--- a/home/templates/home/tags/top_menu.html
+++ b/home/templates/home/tags/top_menu.html
@@ -2,23 +2,23 @@
{% get_site_root as site_root %}
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
- <div class="container">
- <a class="navbar-brand" href="/">jthan.io</a>
- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">
- <span class="navbar-toggler-icon"></span>
- </button>
-
- <div class="collapse navbar-collapse" id="navbarColor02" style="">
- <ul class="navbar-nav mr-auto">
- <li class="nav-item {% if request.path == '/' %}active{% endif %}">
- <a class="nav-link" href="/">Home{% if request.path == '/' %} <span class="sr-only">(current)</span>{% endif %}</a>
- </li>
+ <div class="container">
+ <a class="navbar-brand" href="/">jthan.io</a>
+ <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">
+ <span class="navbar-toggler-icon"></span>
+ </button>
+
+ <div class="collapse navbar-collapse" id="navbarColor02" style="">
+ <ul class="navbar-nav mr-auto">
+ <li class="nav-item {% if request.path == '/' %}active{% endif %}">
+ <a class="nav-link" href="/">Home{% if request.path == '/' %} <span class="sr-only">(current)</span>{% endif %}</a>
+ </li>
{% for menuitem in menuitems %}
- <li class="nav-item {% if menuitem.active %}active{% endif %}">
- <a class="nav-link" href="{% pageurl menuitem %}">{{ menuitem.title }}{% if menuitem.active %} <span class="sr-only">(current)</span>{% endif %}</a>
- </li>
+ <li class="nav-item {% if menuitem.active %}active{% endif %}">
+ <a class="nav-link" href="{% pageurl menuitem %}">{{ menuitem.title }}{% if menuitem.active %} <span class="sr-only">(current)</span>{% endif %}</a>
+ </li>
{% endfor %}
- </ul>
- </div>
+ </ul>
</div>
- </nav>
+ </div>
+</nav>
diff --git a/jthanio/templates/base.html b/jthanio/templates/base.html
index 242ded6..f4a49db 100644
--- a/jthanio/templates/base.html
+++ b/jthanio/templates/base.html
@@ -1,49 +1,48 @@
{% load static wagtailuserbar %}
<!DOCTYPE html>
<html class="no-js" lang="en">
- <head>
- <meta charset="utf-8" />
- <title>
- {% block title %}
- {% if self.seo_title %}{{ self.seo_title }}{% else %}{{ self.title }}{% endif %}
- {% endblock %}
- {% block title_suffix %}
- {% with self.get_site.site_name as site_name %}
- {% if site_name %}- {{ site_name }}{% endif %}
- {% endwith %}
- {% endblock %}
- </title>
- <meta name="description" content="" />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <head>
+ <meta charset="utf-8" />
+ <title>
+ {% block title %}
+ {% if self.seo_title %}{{ self.seo_title }}{% else %}{{ self.title }}{% endif %}
+ {% endblock %}
+ {% block title_suffix %}
+ {% with self.get_site.site_name as site_name %}
+ {% if site_name %}- {{ site_name }}{% endif %}
+ {% endwith %}
+ {% endblock %}
+ </title>
+ <meta name="description" content="" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
- {# Global stylesheets #}
- <link rel="stylesheet" type="text/css" href="{% static 'css/jthanio.css' %}">
- <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.css' %}">
+ {# Global stylesheets #}
+ <link rel="stylesheet" type="text/css" href="{% static 'css/jthanio.css' %}">
+ <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.css' %}">
-
- {% block extra_css %}
- {# Override this in templates to add extra stylesheets #}
- {% endblock %}
- </head>
- <body class="{% block body_class %}{% endblock %}">
+ {% block extra_css %}
+ {# Override this in templates to add extra stylesheets #}
+ {% endblock %}
+ </head>
+ <body class="{% block body_class %}{% endblock %}">
<div id="page-content">
- {% include "navigation.html" %}
+ {% include "navigation.html" %}
- {% wagtailuserbar %}
- {% block content %}{% endblock %}
+ {% wagtailuserbar %}
+ {% block content %}{% endblock %}
- {% block extra_js %}
- {# Override this in templates to add extra javascript #}
- {% endblock %}
- </div>
- <footer class="footer">
- <div class="text-center bg-dark">
- <span class="text-muted">Copyright &copy; jthan.io {% now "Y" %}</span>
- </div>
- </footer>
+ {% block extra_js %}
+ {# Override this in templates to add extra javascript #}
+ {% endblock %}
+ </div>
+ <footer class="footer">
+ <div class="text-center bg-dark">
+ <span class="text-muted">Copyright &copy; jthan.io {% now "Y" %}</span>
+ </div>
+ </footer>
- {# Global javascript #}
- <script src="{% static 'js/jquery-3.4.1.min.js' %}"></script>
- <script src="{% static 'js/bootstrap.js' %}"></script>
- </body>
+ {# Global javascript #}
+ <script src="{% static 'js/jquery-3.4.1.min.js' %}"></script>
+ <script src="{% static 'js/bootstrap.js' %}"></script>
+ </body>
</html>
diff --git a/jthanio/templates/navigation.html b/jthanio/templates/navigation.html
index 0b6026d..5424821 100644
--- a/jthanio/templates/navigation.html
+++ b/jthanio/templates/navigation.html
@@ -1,5 +1,5 @@
{% load navigation_tags %}
{% block menu %}
- {% get_site_root as site_root %}
- {% top_menu parent=site_root calling_page=self %}
+ {% get_site_root as site_root %}
+ {% top_menu parent=site_root calling_page=self %}
{% endblock %}
diff --git a/jthanio/templates/search.html b/jthanio/templates/search.html
index aea81d4..127a9f4 100644
--- a/jthanio/templates/search.html
+++ b/jthanio/templates/search.html
@@ -1,14 +1,14 @@
- <!-- Search Widget -->
- <div class="card my-4">
- <h5 class="card-header">Search</h5>
- <div class="card-body">
- <div class="input-group">
- <form class="form-inline my-2 my-lg-0" action="{% url 'search' %}" method="get">
- <input type="text" class="form-control mr-sm-2 btn-lg" placeholder="Search for..." name="query"{% if search_query %} value="{{ search_query }}"{% endif %}>
- <span class="input-group-btn">
- <input type="submit" value="Search" class="btn btn-secondary my-2 my-sm-0">
- </span>
- </form>
- </div>
- </div>
- </div>
+{# Search Widget #}
+<div class="card my-4">
+ <h5 class="card-header">Search</h5>
+ <div class="card-body">
+ <div class="input-group">
+ <form class="form-inline my-2 my-lg-0" action="{% url 'search' %}" method="get">
+ <input type="text" class="form-control mr-sm-2 btn-lg" placeholder="Search for..." name="query"{% if search_query %} value="{{ search_query }}"{% endif %}>
+ <span class="input-group-btn">
+ <input type="submit" value="Search" class="btn btn-secondary my-2 my-sm-0">
+ </span>
+ </form>
+ </div>
+ </div>
+</div>
diff --git a/search/templates/search/search.html b/search/templates/search/search.html
index e91c0d8..e5f5ab2 100644
--- a/search/templates/search/search.html
+++ b/search/templates/search/search.html
@@ -7,65 +7,36 @@
{% block content %}
<div class="container">
-
- <div class="row">
-
- <!-- Blog Entries Column -->
- <div class="col-md-8">
-
+ <div class="row">
+ {# Blog Entries Column #}
+ <div class="col-md-8">
{% if search_results %}
<h1 class="my-4">Showing search results for "{{ search_query }}"</h1>
{% for result in search_results %}
- {% with post=result.specific %}
- <!-- Blog Post -->
- <div class="card mb-4">
- <div class="card-body">
- <h2 class="card-title">{{ post.title }}</h2>
- <p class="card-text">{{ post.intro }}</p>
- <a href="{% pageurl post %}">Read Post</a>
- </div>
- <div class="card-footer text-muted">
- Posted on {{ post.date }}
- </div>
+ {% with post=result.specific %}
+ {# Blog Post #}
+ <div class="card mb-4">
+ <div class="card-body">
+ <h2 class="card-title">{{ post.title }}</h2>
+ <p class="card-text">{{ post.intro }}</p>
+ <a href="{% pageurl post %}">Read Post</a>
</div>
- {% endwith %}
- {% endfor %}
+ <div class="card-footer text-muted">
+ Posted on {{ post.date }}
+ </div>
+ </div>
+ {% endwith %}
+ {% endfor %}
{% elif search_query %}
- <h1 class="my-4">No results found</h1>
+ <h1 class="my-4">No results found</h1>
{% endif %}
- <!-- end of results -->
+ {# end of results #}
<p><a href="{{ request.META.HTTP_REFERER }}">Return to previous page</a></p>
- </div>
- <!-- Sidebar Widgets Column -->
- <div class="col-md-4">
- {% include "search.html" %}
- </div>
-
-
- <!--
- {% if search_results %}
- <ul>
- {% for result in search_results %}
- <li>
- <h4><a href="{% pageurl result %}">{{ result }}</a></h4>
- {% if result.search_description %}
- {{ result.search_description }}
- {% endif %}
- </li>
- {% endfor %}
- </ul>
-
- {% if search_results.has_previous %}
- <a href="{% url 'search' %}?query={{ search_query|urlencode }}&amp;page={{ search_results.previous_page_number }}">Previous</a>
- {% endif %}
-
- {% if search_results.has_next %}
- <a href="{% url 'search' %}?query={{ search_query|urlencode }}&amp;page={{ search_results.next_page_number }}">Next</a>
- {% endif %}
- {% elif search_query %}
- No results found
- {% endif %} -->
-</div>
-</div>
+ </div>
+ {# Sidebar Widgets Column #}
+ <div class="col-md-4">
+ {% include "search.html" %}
+ </div>
+ </div>
</div>
{% endblock %}