mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 07:46:23 -04:00
Add org select and manage pages
This commit is contained in:
@@ -49,6 +49,18 @@
|
||||
<li>
|
||||
<a href="{{ url_for('main.platform_admin') }}">Platform admin</a>
|
||||
</li>
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
<li>
|
||||
<a href="{{ url_for('main.view_providers') }}">Providers</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ url_for('main.organisations') }}">Organisations</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ url_for('main.letter_jobs') }}">Letter jobs</a>
|
||||
</li>
|
||||
>>>>>>> Add org select and manage pages
|
||||
{% endif %}
|
||||
<li>
|
||||
<a href="{{ url_for('main.sign_out')}}">Sign out</a>
|
||||
|
||||
@@ -6,12 +6,13 @@
|
||||
secondary_link=False,
|
||||
secondary_link_text=None,
|
||||
delete_link=False,
|
||||
delete_link_text="delete"
|
||||
delete_link_text="delete",
|
||||
button_disabled=False
|
||||
) %}
|
||||
<div class="page-footer">
|
||||
{% if button_text %}
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
<input type="submit" class="button{% if destructive %}-destructive{% endif %}" value="{{ button_text }}" />
|
||||
<input type="submit" class="button{% if destructive %}-destructive{% endif %}" value="{{ button_text }}"{% if button_disabled %} disabled{% endif %}/>
|
||||
{% endif %}
|
||||
{% if back_link %}
|
||||
<a class="page-footer-back-link" href="{{ back_link }}">{{ back_link_text }}</a>
|
||||
|
||||
@@ -79,16 +79,19 @@
|
||||
{% macro branding_radios(
|
||||
field,
|
||||
hint=None,
|
||||
branding_dict={}
|
||||
branding_dict={},
|
||||
show_header=True
|
||||
) %}
|
||||
<div class="form-group {% if field.errors %} form-group-error{% endif %}">
|
||||
<fieldset>
|
||||
<legend class="form-label">
|
||||
{{ field.label.text }}
|
||||
{% if show_header %}
|
||||
{{ field.label.text }}
|
||||
{% endif %}
|
||||
{% if field.errors %}
|
||||
<span class="error-message">
|
||||
{{ field.errors[0] }}
|
||||
</span>
|
||||
<span class="error-message">
|
||||
{{ field.errors[0] }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</legend>
|
||||
{% for value, option, checked in field.iter_choices() %}
|
||||
@@ -102,7 +105,7 @@
|
||||
/>
|
||||
<label class="block-label" for="{{ field.name }}-{{ loop.index }}">
|
||||
{% if branding_dict.get(value, {}).get('colour') %}
|
||||
<span style="background: {{ branding_dict[value].colour }}; display: inline-block; width: 3px; height: 27px"></span>
|
||||
<span style="background: {{ branding_dict[value].colour }}; display: inline-block; width: 3px; height: 27px;"></span>
|
||||
{% endif %}
|
||||
{% if branding_dict.get(value, {}).get('logo') %}
|
||||
<img
|
||||
|
||||
55
app/templates/views/organisations/manage-org.html
Normal file
55
app/templates/views/organisations/manage-org.html
Normal file
@@ -0,0 +1,55 @@
|
||||
{% extends "withoutnav_template.html" %}
|
||||
{% from "components/file-upload.html" import file_upload %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
{% from "components/textbox.html" import textbox %}
|
||||
|
||||
{% block service_page_title %}
|
||||
{{ '{} an organisations logo'.format('Update' if organisation else 'Create')}}
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<h1 class="heading-large">{{ '{} an organisations logo'.format('Update' if organisation else 'Create')}}</h1>
|
||||
<div class="grid-row">
|
||||
<div class="column-three-quarters">
|
||||
|
||||
{% if logo %}
|
||||
<div id="logo-img">
|
||||
<img src="https://{{ cdn_url }}/{{ logo }}"/>
|
||||
</div>
|
||||
{% endif %}
|
||||
{{
|
||||
file_upload(
|
||||
form.file,
|
||||
button_text='{} logo'.format('Update' if organisation else 'Upload')
|
||||
) }}
|
||||
<form method="post">
|
||||
<div class="form-group">
|
||||
<div style='margin-top:15px;'>{{textbox(form.name)}}</div>
|
||||
<div>{{textbox(form.colour, width='1-4')}}
|
||||
<span id='colour_span' style="background: {{ organisation.colour }}; {% if not organisation.colour %}visibility:hidden; {% endif %}border:1px black solid; width: 3px; height: 25px;position:absolute;margin-top:138px;margin-left:185px;display:block;"></span>
|
||||
</div>
|
||||
{{ page_footer(
|
||||
'Save',
|
||||
back_link=url_for('.organisations', organisation_id=organisation.id if organisation else 'None'),
|
||||
back_link_text='Back to organisation selection',
|
||||
button_disabled=True if not logo else False
|
||||
) }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function update_colour_span() {
|
||||
if (document.getElementById('colour').value) {
|
||||
document.getElementById('colour_span').style.visibility = 'visible';
|
||||
document.getElementById('colour_span').style.background = document.getElementById('colour').value;
|
||||
}
|
||||
else {
|
||||
document.getElementById('colour_span').style.visibility = 'hidden';
|
||||
document.getElementById('colour_span').style.background = '';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
26
app/templates/views/organisations/select-org.html
Normal file
26
app/templates/views/organisations/select-org.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% extends "withoutnav_template.html" %}
|
||||
{% from "components/radios.html" import radios, branding_radios %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
|
||||
{% block service_page_title %}
|
||||
Select organisation
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<h1 class="heading-large">
|
||||
<div>Select an organisation to update</div>
|
||||
<div>or create a new organisation</div>
|
||||
</h1>
|
||||
<div class="grid-row">
|
||||
<div class="column-three-quarters">
|
||||
<form method="post">
|
||||
{{ branding_radios(form.organisation, branding_dict=branding_dict, show_header=False) }}
|
||||
{{ page_footer(
|
||||
'Next'
|
||||
) }}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user