Set max width on ccpo admin pages

This commit is contained in:
leigh-mil 2020-02-04 14:43:59 -05:00
parent 68c7a70082
commit e7487aa114
5 changed files with 119 additions and 109 deletions

View File

@ -47,3 +47,4 @@
@import "sections/application_edit"; @import "sections/application_edit";
@import "sections/reports"; @import "sections/reports";
@import "sections/task_order"; @import "sections/task_order";
@import "sections/ccpo";

View File

@ -0,0 +1,3 @@
.ccpo-panel-container {
max-width: $max-panel-width;
}

View File

@ -4,21 +4,23 @@
{% from "components/text_input.html" import TextInput %} {% from "components/text_input.html" import TextInput %}
{% block content %} {% block content %}
<base-form inline-template> <div class="ccpo-panel-container">
<form id="add-ccpo-user-form" action="{{ url_for('ccpo.submit_new_user') }}" method="POST"> <base-form inline-template>
{{ form.csrf_token }} <form id="add-ccpo-user-form" action="{{ url_for('ccpo.submit_new_user') }}" method="POST">
<h1>{{ "ccpo.form.add_user_title" | translate }}</h1> {{ form.csrf_token }}
<div class='form-row'> <h1>{{ "ccpo.form.add_user_title" | translate }}</h1>
<div class='form-col form-col--two-thirds'> <div class='form-row'>
{{ TextInput(form.dod_id, validation='dodId', optional=False) }} <div class='form-col form-col--two-thirds'>
</div> {{ TextInput(form.dod_id, validation='dodId', optional=False) }}
<div class="form-col form-col--third"> </div>
<div class='action-group'> <div class="form-col form-col--third">
{{ SaveButton(text="common.next"|translate, element="input", additional_classes="action-group__action", form="add-ccpo-user-form") }} <div class='action-group'>
<a class='action-group__action icon-link icon-link--default' href="{{ url_for('ccpo.users') }}">{{ "common.cancel" | translate }}</a> {{ SaveButton(text="common.next"|translate, element="input", additional_classes="action-group__action", form="add-ccpo-user-form") }}
<a class='action-group__action icon-link icon-link--default' href="{{ url_for('ccpo.users') }}">{{ "common.cancel" | translate }}</a>
</div>
</div> </div>
</div> </div>
</div> </form>
</form> </base-form>
</base-form> </div>
{% endblock %} {% endblock %}

View File

@ -3,31 +3,33 @@
{% from "components/text_input.html" import TextInput %} {% from "components/text_input.html" import TextInput %}
{% block content %} {% block content %}
{% if new_user %} <div class="ccpo-panel-container">
<h3>{{ 'ccpo.form.confirm_user_title' | translate }}</h3> {% if new_user %}
<form id="add-ccpo-user-form" action="{{ url_for('ccpo.confirm_new_user') }}" method="POST"> <h3>{{ 'ccpo.form.confirm_user_title' | translate }}</h3>
{{ form.csrf_token }} <form id="add-ccpo-user-form" action="{{ url_for('ccpo.confirm_new_user') }}" method="POST">
<input type="hidden" name="dod_id" value="{{ form.dod_id.data }}"> {{ form.csrf_token }}
<div> <input type="hidden" name="dod_id" value="{{ form.dod_id.data }}">
<p> <div>
{{ "ccpo.form.confirm_user_text" | translate }} <p>
</p> {{ "ccpo.form.confirm_user_text" | translate }}
<p> </p>
{{ new_user.full_name }} <p>
</p> {{ new_user.full_name }}
<p> </p>
{{ new_user.email }} <p>
</p> {{ new_user.email }}
</div> </p>
<div class='action-group'> </div>
<input <div class='action-group'>
type='submit' <input
class='action-group__action usa-button' type='submit'
value='{{ "ccpo.form.confirm_button" | translate }}'> class='action-group__action usa-button'
<a class='action-group__action icon-link icon-link--default' href="{{ url_for('ccpo.users') }}"> value='{{ "ccpo.form.confirm_button" | translate }}'>
{{ "common.cancel" | translate }} <a class='action-group__action icon-link icon-link--default' href="{{ url_for('ccpo.users') }}">
</a> {{ "common.cancel" | translate }}
</div> </a>
</form> </div>
{% endif %} </form>
{% endif %}
</div>
{% endblock %} {% endblock %}

View File

@ -6,78 +6,80 @@
{% from "components/modal.html" import Modal %} {% from "components/modal.html" import Modal %}
{% block content %} {% block content %}
<div class='col'> <div class="ccpo-panel-container">
<div class="h2"> <div class='col'>
{{ "ccpo.users_title" | translate }} <div class="h2">
</div> {{ "ccpo.users_title" | translate }}
</div>
{% include "fragments/flash.html" %} {% include "fragments/flash.html" %}
<table>
<thead>
<tr>
<th>{{ "common.name" | translate }}</th>
<th>{{ "common.email" | translate }}</th>
<th>{{ "common.dod_id" | translate }}</th>
{% if user_can(permissions.DELETE_CCPO_USER) %}
<th></th>
{% endif %}
</tr>
</thead>
<tbody>
{% for user, form in users_info %}
{% set modal_id = "disable_ccpo_user_{}".format(user.dod_id) %}
{% set disable_button_class = 'button-danger-outline' %}
{% if user == g.current_user %}
{% set disable_button_class = "usa-button-disabled" %}
{% endif %}
<table>
<thead>
<tr> <tr>
<td>{{ user.full_name }}</td> <th>{{ "common.name" | translate }}</th>
<td>{{ user.email }}</td> <th>{{ "common.email" | translate }}</th>
<td>{{ user.dod_id }}</td> <th>{{ "common.dod_id" | translate }}</th>
{% if user_can(permissions.DELETE_CCPO_USER) %} {% if user_can(permissions.DELETE_CCPO_USER) %}
<td> <th></th>
<a v-on:click="openModal('{{ modal_id }}')" class='usa-button {{ disable_button_class }}'>
{{ "common.disable" | translate }}
</a>
</td>
{% endif %} {% endif %}
</tr> </tr>
{% endfor %} </thead>
</tbody> <tbody>
</table> {% for user, form in users_info %}
{% set modal_id = "disable_ccpo_user_{}".format(user.dod_id) %}
{% set disable_button_class = 'button-danger-outline' %}
{% if user == g.current_user %}
{% set disable_button_class = "usa-button-disabled" %}
{% endif %}
<tr>
<td>{{ user.full_name }}</td>
<td>{{ user.email }}</td>
<td>{{ user.dod_id }}</td>
{% if user_can(permissions.DELETE_CCPO_USER) %}
<td>
<a v-on:click="openModal('{{ modal_id }}')" class='usa-button {{ disable_button_class }}'>
{{ "common.disable" | translate }}
</a>
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% if user_can(permissions.CREATE_CCPO_USER) %}
<a class="icon-link" href="{{ url_for('ccpo.add_new_user')}}">
{{ "ccpo.add_user" | translate }} {{ Icon("plus") }}
</a>
{% endif %}
{% if user_can(permissions.DELETE_CCPO_USER) %}
{% for user, form in users_info %}
{% set modal_id = "disable_ccpo_user_{}".format(user.dod_id) %}
{% call Modal(name=modal_id) %}
<h1>Disable CCPO User</h1>
<hr>
{{
Alert(
title=("components.modal.destructive_title" | translate),
message=("ccpo.disable_user.alert_message" | translate({"user_name": user.full_name})),
level="warning"
)
}}
{{
DeleteConfirmation(
modal_id=modal_id,
delete_text='Remove Access',
delete_action=(url_for('ccpo.remove_access', user_id=user.id)),
form=form,
confirmation_text='remove'
)
}}
{% endcall %}
{% endfor %}
{% endif %}
</div> </div>
{% if user_can(permissions.CREATE_CCPO_USER) %}
<a class="icon-link" href="{{ url_for('ccpo.add_new_user')}}">
{{ "ccpo.add_user" | translate }} {{ Icon("plus") }}
</a>
{% endif %}
{% if user_can(permissions.DELETE_CCPO_USER) %}
{% for user, form in users_info %}
{% set modal_id = "disable_ccpo_user_{}".format(user.dod_id) %}
{% call Modal(name=modal_id) %}
<h1>Disable CCPO User</h1>
<hr>
{{
Alert(
title=("components.modal.destructive_title" | translate),
message=("ccpo.disable_user.alert_message" | translate({"user_name": user.full_name})),
level="warning"
)
}}
{{
DeleteConfirmation(
modal_id=modal_id,
delete_text='Remove Access',
delete_action=(url_for('ccpo.remove_access', user_id=user.id)),
form=form,
confirmation_text='remove'
)
}}
{% endcall %}
{% endfor %}
{% endif %}
{% endblock %} {% endblock %}