diff --git a/app/templates/components/live-search.html b/app/templates/components/live-search.html
new file mode 100644
index 000000000..f60b8f60c
--- /dev/null
+++ b/app/templates/components/live-search.html
@@ -0,0 +1,21 @@
+{% from "components/textbox.html" import textbox %}
+
+{% macro live_search(
+ target_selector=None,
+ show=False,
+ form=None,
+ label=None
+) %}
+ {%- set search_label = label or form.search.label.text %}
+ {% if show %}
+
+
+ {{ textbox(
+ form.search,
+ width='1-1',
+ label=search_label
+ ) }}
+
+
+ {% endif %}
+{% endmacro %}
diff --git a/app/templates/views/manage-users.html b/app/templates/views/manage-users.html
index d625d8e5a..d7503a4c9 100644
--- a/app/templates/views/manage-users.html
+++ b/app/templates/views/manage-users.html
@@ -3,6 +3,7 @@
{% from "components/page-footer.html" import page_footer %}
{% from "components/tick-cross.html" import tick_cross %}
{% from "components/textbox.html" import textbox %}
+{% from "components/live-search.html" import live_search %}
{% set table_options = {
'field_headings': [
@@ -33,12 +34,7 @@
{% if show_search_box %}
-
- {{ textbox(
- form.search,
- width='1-1'
- ) }}
-
+ {{ live_search(target_selector='.user-list-item', show=True, form=form) }}
{% endif %}
diff --git a/app/templates/views/organisations/organisation/users/index.html b/app/templates/views/organisations/organisation/users/index.html
index 896be8dc4..f2a4d7b10 100644
--- a/app/templates/views/organisations/organisation/users/index.html
+++ b/app/templates/views/organisations/organisation/users/index.html
@@ -3,6 +3,7 @@
{% from "components/page-footer.html" import page_footer %}
{% from "components/tick-cross.html" import tick_cross %}
{% from "components/textbox.html" import textbox %}
+{% from "components/live-search.html" import live_search %}
{% block org_page_title %}
Team members
@@ -23,12 +24,7 @@
{% if show_search_box %}
-
- {{ textbox(
- form.search,
- width='1-1'
- ) }}
-
+ {{ live_search(target_selector='.user-list-item', show=True, form=form) }}
{% endif %}
diff --git a/app/templates/views/pricing.html b/app/templates/views/pricing.html
index 20d612d93..7171b15fb 100644
--- a/app/templates/views/pricing.html
+++ b/app/templates/views/pricing.html
@@ -1,5 +1,6 @@
{% from "components/table.html" import mapping_table, row, text_field, field, row_heading %}
{% from "components/textbox.html" import textbox %}
+{% from "components/live-search.html" import live_search %}
{% extends "withoutnav_template.html" %}
@@ -62,13 +63,7 @@
International text message rates
-
- {{ textbox(
- search_form.search,
- width='1-1',
- label='Search by country name or code'
- ) }}
-
+ {{ live_search(target_selector='#international-pricing .table-row', show=True, form=search_form, label='Search by country name or code') }}
{% call mapping_table(
diff --git a/app/templates/views/templates/_search-box.html b/app/templates/views/templates/_search-box.html
deleted file mode 100644
index d150ebebe..000000000
--- a/app/templates/views/templates/_search-box.html
+++ /dev/null
@@ -1,10 +0,0 @@
- {% if show_search_box %}
-
-
- {{ textbox(
- search_form.search,
- width='1-1'
- ) }}
-
-
- {% endif %}
\ No newline at end of file
diff --git a/app/templates/views/templates/choose-reply.html b/app/templates/views/templates/choose-reply.html
index 07706038a..d95b06e13 100644
--- a/app/templates/views/templates/choose-reply.html
+++ b/app/templates/views/templates/choose-reply.html
@@ -1,6 +1,7 @@
{% from "components/pill.html" import pill %}
{% from "components/message-count-label.html" import message_count_label %}
{% from "components/textbox.html" import textbox %}
+{% from "components/live-search.html" import live_search %}
{% extends "withnav_template.html" %}
@@ -28,7 +29,7 @@
{% else %}
- {% include "views/templates/_search-box.html" %}
+ {{ live_search(target_selector='#template-list .column-whole', show=show_search_box, form=search_form) }}
{% endif %}
- {% include "views/templates/_search-box.html" %}
+ {{ live_search(target_selector='#template-list .column-whole', show=show_search_box, form=search_form) }}