Merge branch 'master' into add-brand-type-to-email-branding

This commit is contained in:
Rebecca Law
2018-08-24 11:09:31 +01:00
18 changed files with 246 additions and 141 deletions

View File

@@ -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 %}
<div data-module="autofocus">
<div class="live-search" data-module="live-search" data-targets="{{ target_selector }}">
{{ textbox(
form.search,
width='1-1',
label=search_label
) }}
</div>
</div>
{% endif %}
{% endmacro %}

View File

@@ -10,7 +10,7 @@
{% block platform_admin_content %}
<h1 class="heading-large">{{ '{} email branding'.format('Update' if email_branding else 'Create')}}</h1>
<h1 class="heading-large">{{ '{} email branding'.format('Update' if email_branding else 'Add')}}</h1>
<div class="grid-row">
<div class="column-three-quarters">
{% if logo %}

View File

@@ -1,26 +1,31 @@
{% extends "views/platform-admin/_base_template.html" %}
{% from "components/radios.html" import radios %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/live-search.html" import live_search %}
{% block service_page_title %}
Select email branding
Email branding
{% endblock %}
{% block platform_admin_content %}
<h1 class="heading-large">
<div>Select an email branding to update</div>
<div>or create a new email branding</div>
</h1>
<div class="grid-row">
<div class="column-three-quarters">
<form method="post">
{{ radios(form.email_branding) }}
{{ page_footer(
'Next'
) }}
</form>
<div class="grid-row bottom-gutter-2-3">
<div class="column-two-thirds">
<h1 class="heading-large">Email branding</h1>
</div>
<div class="column-one-third">
<a href="{{ url_for('.create_email_branding') }}" class="button align-with-heading">Add new brand</a>
</div>
</div>
{{ live_search(target_selector='.message-name', show=show_search_box, form=search_form) }}
<nav>
{% for id, name in email_brandings %}
<div class="message-name">
<a href="{{ url_for('.update_email_branding', branding_id=id) }}">
{{name}}
</a>
</div>
{% endfor %}
</nav>
{% endblock %}

View File

@@ -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 %}
<div data-module="autofocus">
<div class="live-search" data-module="live-search" data-targets=".user-list-item">
{{ textbox(
form.search,
width='1-1'
) }}
</div>
{{ live_search(target_selector='.user-list-item', show=True, form=form) }}
</div>
{% endif %}

View File

@@ -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 %}
<div data-module="autofocus">
<div class="live-search" data-module="live-search" data-targets=".user-list-item">
{{ textbox(
form.search,
width='1-1'
) }}
</div>
{{ live_search(target_selector='.user-list-item', show=True, form=form) }}
</div>
{% endif %}

View File

@@ -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 @@
<details>
<summary>International text message rates</summary>
<div class="live-search" data-module="live-search" data-targets="#international-pricing .table-row">
{{ textbox(
search_form.search,
width='1-1',
label='Search by country name or code'
) }}
</div>
{{ live_search(target_selector='#international-pricing .table-row', show=True, form=search_form, label='Search by country name or code') }}
<div id="international-pricing" class="bottom-gutter-3-2">
{% call mapping_table(

View File

@@ -1,6 +1,7 @@
{% extends "withnav_template.html" %}
{% from "components/radios.html" import radios %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/live-search.html" import live_search %}
{% block service_page_title %}
Set email branding
@@ -10,11 +11,16 @@
<h1 class="heading-large">Set email branding</h1>
<form method="post">
<div class="grid-row">
<div class="column-one-whole">
</div>
</div>
<div class="grid-row">
<div class="column-one-half">
{{ radios(form.branding_type) }}
</div>
<div class="column-one-half">
<div class="column-one-half brand_styles">
{{ live_search(target_selector='.brand_styles .multiple-choice', show=show_search_box, form=search_form, label='Search branding styles by name') }}
{{ radios(form.branding_style) }}
</div>
</div>

View File

@@ -1,10 +0,0 @@
{% if show_search_box %}
<div data-module="autofocus">
<div class="live-search" data-module="live-search" data-targets="#template-list .column-whole">
{{ textbox(
search_form.search,
width='1-1'
) }}
</div>
</div>
{% endif %}

View File

@@ -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) }}
<nav class="grid-row" id=template-list>
{% for template in templates %}

View File

@@ -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" %}
@@ -55,7 +56,7 @@
</div>
{% endif %}
{% include "views/templates/_search-box.html" %}
{{ live_search(target_selector='#template-list .column-whole', show=show_search_box, form=search_form) }}
<nav class="grid-row" id=template-list>
{% for template in templates %}