mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-06 21:48:25 -04:00
Add a page to set organisation and branding option
Platform admin only. Adds radio buttons to choose one of: - three hard-coded branding options - organisations from a list provided by the API
This commit is contained in:
committed by
Leo Hemsted
parent
20c39d24b7
commit
6b5e64479a
@@ -21,3 +21,43 @@
|
||||
</fieldset>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
{% macro branding_radios(
|
||||
field,
|
||||
hint=None,
|
||||
branding_dict={}
|
||||
) %}
|
||||
<div class="form-group {% if field.errors %} error{% endif %}">
|
||||
<fieldset>
|
||||
<legend class="form-label">
|
||||
{{ field.label }}
|
||||
{% if field.errors %}
|
||||
<span class="error-message">
|
||||
{{ field.errors[0] }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</legend>
|
||||
{% for value, option, checked in field.iter_choices() %}
|
||||
<label class="block-label" for="{{ field.name }}-{{ loop.index }}">
|
||||
<input
|
||||
type="radio"
|
||||
name="{{ field.name }}"
|
||||
id="{{ field.name }}-{{ loop.index }}"
|
||||
{% if checked %}checked="checked"{% endif %}
|
||||
/>
|
||||
{% if branding_dict.get(value, {}).get('colour') %}
|
||||
<span style="background: {{ branding_dict[value].colour }}; display: inline-block; width: 3px; height: 27px"></span>
|
||||
{% endif %}
|
||||
{% if branding_dict.get(value, {}).get('logo') %}
|
||||
<img
|
||||
src="{{ branding_dict[value].logo }}"
|
||||
height="27"
|
||||
/>
|
||||
{% endif %}
|
||||
{{option}}
|
||||
</label>
|
||||
{% endfor %}
|
||||
</fieldset>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
Reference in New Issue
Block a user