Merge pull request #2681 from alphagov/show-domains-against-brands

Show domains, not owners against brands
This commit is contained in:
Chris Hill-Scott
2019-01-29 09:48:27 +00:00
committed by GitHub
3 changed files with 17 additions and 16 deletions

View File

@@ -22,7 +22,7 @@ def email_branding():
return render_template(
'views/email-branding/select-branding.html',
email_brandings=_add_domain_info(brandings),
email_brandings=brandings,
search_form=SearchTemplatesForm(),
show_search_box=len(brandings) > 9,
agreement_info=AgreementInfo,
@@ -129,11 +129,3 @@ def create_email_branding(logo=None):
cdn_url=get_logo_cdn_domain(),
logo=logo
)
def _add_domain_info(email_brands):
for brand in email_brands:
yield dict(
domain_owner=AgreementInfo(brand.get('domain') or '').owner,
**brand
)

View File

@@ -26,11 +26,13 @@
{{ brand.name or 'Unnamed' }}
</a>
</div>
{% if brand.domain_owner %}
<p class="message-type">
Default for {{ brand.domain_owner }}
</p>
{% endif %}
<p class="message-type">
{% if brand.domain %}
Default for {{ brand.domain }}
{% else %}
{% endif %}
</p>
</div>
{% endfor %}
</nav>