From 3b01f1a47bbe525ca98a42bf1524042bb5d7e23b Mon Sep 17 00:00:00 2001 From: Deimos Date: Mon, 3 Sep 2018 23:08:04 -0600 Subject: [PATCH] Move search form to macro, remove button border --- tildes/tildes/templates/home.jinja2 | 9 +++------ tildes/tildes/templates/macros/forms.jinja2 | 15 +++++++++++++++ tildes/tildes/templates/search.jinja2 | 9 +++------ tildes/tildes/templates/topic_listing.jinja2 | 8 ++------ 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/tildes/tildes/templates/home.jinja2 b/tildes/tildes/templates/home.jinja2 index e8c9fd4..f22aa21 100644 --- a/tildes/tildes/templates/home.jinja2 +++ b/tildes/tildes/templates/home.jinja2 @@ -1,5 +1,7 @@ {% extends 'topic_listing.jinja2' %} +{% from 'macros/forms.jinja2' import search_form %} + {% block title_full %}Tildes{% endblock %} {% block header_context_link %}{% endblock %} @@ -17,12 +19,7 @@ {% endblock %} {% block sidebar %} - + {{ search_form() }}

Home

The home page shows topics from groups that you're subscribed to.

diff --git a/tildes/tildes/templates/macros/forms.jinja2 b/tildes/tildes/templates/macros/forms.jinja2 index c0922a5..69b4f7f 100644 --- a/tildes/tildes/templates/macros/forms.jinja2 +++ b/tildes/tildes/templates/macros/forms.jinja2 @@ -29,3 +29,18 @@ > {% endmacro %} + +{% macro search_form(existing_query=None) %} + +{% endmacro %} diff --git a/tildes/tildes/templates/search.jinja2 b/tildes/tildes/templates/search.jinja2 index 90e41f0..2536894 100644 --- a/tildes/tildes/templates/search.jinja2 +++ b/tildes/tildes/templates/search.jinja2 @@ -1,16 +1,13 @@ {% extends 'topic_listing.jinja2' %} +{% from 'macros/forms.jinja2' import search_form %} + {% block title %}Search results for "{{ search }}"{% endblock %} {% block header_context_link %}Search: "{{ search }}"{% endblock %} {% block sidebar %} - + {{ search_form(search) }}

Search results

diff --git a/tildes/tildes/templates/topic_listing.jinja2 b/tildes/tildes/templates/topic_listing.jinja2 index ec91068..75823dc 100644 --- a/tildes/tildes/templates/topic_listing.jinja2 +++ b/tildes/tildes/templates/topic_listing.jinja2 @@ -1,5 +1,6 @@ {% extends 'base.jinja2' %} +{% from 'macros/forms.jinja2' import search_form %} {% from 'macros/groups.jinja2' import render_group_subscription_box with context %} {% from 'macros/topics.jinja2' import render_topic_for_listing with context %} @@ -175,12 +176,7 @@ {% endblock %} {% block sidebar %} - + {{ search_form() }}

~{{ group.path }}