diff options
author | Jonathan DeMasi <jon.demasi@colorado.edu> | 2020-03-05 16:27:50 -0700 |
---|---|---|
committer | Jonathan DeMasi <jon.demasi@colorado.edu> | 2020-03-05 16:27:50 -0700 |
commit | 520c0a0b6b39732382387b8610f8910f8657cf7a (patch) | |
tree | 9331672fc37682ce156fd08b71f1108f828dcdcb | |
parent | 6a2022a18da024a41d6d583cec45b275b85a09c2 (diff) | |
download | jthanio-520c0a0b6b39732382387b8610f8910f8657cf7a.tar jthanio-520c0a0b6b39732382387b8610f8910f8657cf7a.tar.gz jthanio-520c0a0b6b39732382387b8610f8910f8657cf7a.tar.bz2 jthanio-520c0a0b6b39732382387b8610f8910f8657cf7a.tar.lz jthanio-520c0a0b6b39732382387b8610f8910f8657cf7a.tar.xz jthanio-520c0a0b6b39732382387b8610f8910f8657cf7a.tar.zst jthanio-520c0a0b6b39732382387b8610f8910f8657cf7a.zip |
search formatted, consistency across site
-rw-r--r-- | blog/templates/blog/blog_index_page.html | 4 | ||||
-rw-r--r-- | blog/templates/blog/blog_post.html | 2 | ||||
-rw-r--r-- | blog/templates/blog/blog_tag_index_page.html | 9 | ||||
-rw-r--r-- | search/templates/search/search.html | 45 |
4 files changed, 48 insertions, 12 deletions
diff --git a/blog/templates/blog/blog_index_page.html b/blog/templates/blog/blog_index_page.html index f36aa83..a53ce51 100644 --- a/blog/templates/blog/blog_index_page.html +++ b/blog/templates/blog/blog_index_page.html @@ -29,7 +29,7 @@ <div class="card-body"> <h2 class="card-title">{{ post.title }}</h2> <p class="card-text">{{ post.intro }}</p> - <a href="{% pageurl post %}" class="btn btn-primary">Read More</a> + <a href="{% pageurl post %}">Read Post</a> </div> <div class="card-footer text-muted"> Posted on {{ post.date }} @@ -64,4 +64,4 @@ </div> </div> -{% endblock %}
\ No newline at end of file +{% endblock %} diff --git a/blog/templates/blog/blog_post.html b/blog/templates/blog/blog_post.html index 7d12aa8..de52dc6 100644 --- a/blog/templates/blog/blog_post.html +++ b/blog/templates/blog/blog_post.html @@ -24,8 +24,8 @@ <!-- Preview Image --> {% if page.main_image %} {% image page.main_image fill-900x300-c100 class="img-fluid rounded" %} - {% endif %} <hr> + {% endif %} <!-- Post Content --> <p class="lead">{{ page.intro }}</p> diff --git a/blog/templates/blog/blog_tag_index_page.html b/blog/templates/blog/blog_tag_index_page.html index 4132420..fda427b 100644 --- a/blog/templates/blog/blog_tag_index_page.html +++ b/blog/templates/blog/blog_tag_index_page.html @@ -11,7 +11,6 @@ {% if request.GET.tag|length %} <h1 class="my-4">Showing pages tagged "{{ request.GET.tag }}"</h1> - {% endif %} {% for post in blogpages %} {% with post=post.specific %} @@ -20,7 +19,7 @@ <div class="card-body"> <h2 class="card-title">{{ post.title }}</h2> <p class="card-text">{{ post.intro }}</p> - <a href="{% pageurl post %}" class="btn btn-primary">Read More</a> + <a href="{% pageurl post %}">Read Post</a> </div> <div class="card-footer text-muted"> Posted on {{ post.date }} @@ -28,6 +27,10 @@ </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> </div> <!-- Sidebar Widgets Column --> <div class="col-md-4"> @@ -37,4 +40,4 @@ </div> </div> -{% endblock %}
\ No newline at end of file +{% endblock %} diff --git a/search/templates/search/search.html b/search/templates/search/search.html index 5f222e5..e91c0d8 100644 --- a/search/templates/search/search.html +++ b/search/templates/search/search.html @@ -6,13 +6,43 @@ {% block title %}Search{% endblock %} {% block content %} - <h1>Search</h1> +<div class="container"> - <form action="{% url 'search' %}" method="get"> - <input type="text" name="query"{% if search_query %} value="{{ search_query }}"{% endif %}> - <input type="submit" value="Search" class="button"> - </form> + <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> + </div> + {% endwith %} + {% endfor %} + {% elif search_query %} + <h1 class="my-4">No results found</h1> + {% endif %} + <!-- 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 %} @@ -34,5 +64,8 @@ {% endif %} {% elif search_query %} No results found - {% endif %} + {% endif %} --> +</div> +</div> +</div> {% endblock %} |