use flask flash for notifications
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
{% from "components/text_input.html" import TextInput %}
|
||||
{% from "components/alert.html" import Alert %}
|
||||
|
||||
{% set title_text = 'Edit {} project'.format(project.name) if project else 'Add a new project' %}
|
||||
|
||||
|
9
templates/fragments/flash.html
Normal file
9
templates/fragments/flash.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{% from "components/alert.html" import Alert %}
|
||||
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message_config in messages %}
|
||||
{{ Alert(message_config["title"], message=message_config.get("message"), level=category) }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
@@ -1,6 +1,5 @@
|
||||
{% extends "base_public.html" %}
|
||||
{% from "components/sidenav_item.html" import SidenavItem %}
|
||||
{% from "components/alert.html" import Alert %}
|
||||
|
||||
{% block title %}Help | JEDI Cloud{% endblock %}
|
||||
|
||||
|
@@ -11,29 +11,14 @@
|
||||
<div class='col'>
|
||||
|
||||
<div class='login-banner'>
|
||||
{% if request.args.get("sessionExpired") %}
|
||||
{{ Alert('Session Expired',
|
||||
message='Your session expired due to inactivity. Please log in again to continue.',
|
||||
level='error'
|
||||
) }}
|
||||
{% endif %}
|
||||
<h1 class="login-banner__heading">Access the JEDI Cloud</h1>
|
||||
|
||||
<img class="login-banner__logo" src="{{url_for('static', filename='img/ccpo-logo.svg')}}" alt="Cloud Computing Program Office Logo">
|
||||
|
||||
<a class="usa-button usa-button-big login-banner__button" href='{{ redirect_url }}'><span>Sign in with CAC</span></a>
|
||||
|
||||
{% if False %}
|
||||
<a class="usa-button usa-button-big usa-button-secondary" href='{{ url_for("dev.login_dev", **request.args) }}'><span>DEV Login</span></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if redirect %}
|
||||
{{ Alert('Log in Required.',
|
||||
message='After you log in, you will be redirected to your destination page.',
|
||||
level='warning'
|
||||
) }}
|
||||
{% endif %}
|
||||
{% include "fragments/flash.html" %}
|
||||
|
||||
{{ Alert('Certificate Selection',
|
||||
message='When you are prompted to select a certificate, please select <strong>E-mail Certificate</strong> from the provided choices.',
|
||||
|
@@ -6,9 +6,7 @@
|
||||
|
||||
{% include 'requests/menu.html' %}
|
||||
|
||||
{% if review_comment %}
|
||||
{% include 'requests/comment.html' %}
|
||||
{% endif %}
|
||||
{% include "fragments/flash.html" %}
|
||||
|
||||
{% block form_action %}
|
||||
{% if request_id %}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% from "components/icon.html" import Icon %}
|
||||
{% from "components/alert.html" import Alert %}
|
||||
{% from "components/text_input.html" import TextInput %}
|
||||
{% from "components/phone_input.html" import PhoneInput %}
|
||||
|
||||
@@ -9,12 +8,7 @@
|
||||
|
||||
<article class='col col--grow request-approval'>
|
||||
|
||||
{% if review_form.errors or internal_comment_form.errors %}
|
||||
{{ Alert('There were some errors',
|
||||
message="<p>Please see below.</p>",
|
||||
level='error'
|
||||
) }}
|
||||
{% endif %}
|
||||
{% include "fragments/flash.html" %}
|
||||
|
||||
<section class='panel'>
|
||||
<header class='panel__heading panel__heading--divider request-approval__heading'>
|
||||
|
@@ -1,9 +0,0 @@
|
||||
{% from "components/alert.html" import Alert %}
|
||||
|
||||
{% call Alert('Changes Requested', level='warning') %}
|
||||
<p>CCPO has requested changes to your submission with the following notes:
|
||||
<br>
|
||||
{{ review_comment }}
|
||||
<br>
|
||||
Please contact info@jedi.cloud or 123-123-4567 for further discussion.</p>
|
||||
{% endcall %}
|
@@ -9,6 +9,8 @@
|
||||
|
||||
{% include 'requests/review_menu.html' %}
|
||||
|
||||
{% include "fragments/flash.html" %}
|
||||
|
||||
{% if saved_draft %}
|
||||
{% call Alert('Draft saved', level='success') %}
|
||||
{% endcall %}
|
||||
@@ -19,10 +21,6 @@
|
||||
{{ Alert('Pending Financial Verification', fragment="fragments/pending_financial_verification.html") }}
|
||||
{% endif %}
|
||||
|
||||
{% if review_comment %}
|
||||
{% include 'requests/comment.html' %}
|
||||
{% endif %}
|
||||
|
||||
<financial inline-template v-bind:initial-data='{{ f.data|mixedContentToJson }}'>
|
||||
<div class="col">
|
||||
{% if extended %}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% from "components/alert.html" import Alert %}
|
||||
{% from "components/modal.html" import Modal %}
|
||||
{% from "components/empty_state.html" import EmptyState %}
|
||||
{% from "components/icon.html" import Icon %}
|
||||
@@ -46,13 +45,7 @@
|
||||
>
|
||||
<div>
|
||||
|
||||
{% if num_action_required %}
|
||||
{% set title -%}
|
||||
Action required on {{ num_action_required }} requests.
|
||||
{%- endset %}
|
||||
|
||||
{{ Alert (title)}}
|
||||
{% endif %}
|
||||
{% include "fragments/flash.html" %}
|
||||
|
||||
{% if not requests %}
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
{% extends 'requests/_new.html' %}
|
||||
|
||||
{% from "components/alert.html" import Alert %}
|
||||
{% from "components/text_input.html" import TextInput %}
|
||||
{% from "components/options_input.html" import OptionsInput %}
|
||||
{% from "components/date_input.html" import DateInput %}
|
||||
@@ -11,12 +10,7 @@
|
||||
|
||||
{% block form %}
|
||||
|
||||
{% if f.errors %}
|
||||
{{ Alert('There were some errors',
|
||||
message="<p>Please see below.</p>",
|
||||
level='error'
|
||||
) }}
|
||||
{% endif %}
|
||||
{% include "fragments/flash.html" %}
|
||||
|
||||
<details-of-use inline-template v-bind:initial-data='{{ f.data|tojson }}'>
|
||||
<div>
|
||||
|
@@ -1,6 +1,5 @@
|
||||
{% extends 'requests/_new.html' %}
|
||||
|
||||
{% from "components/alert.html" import Alert %}
|
||||
{% from "components/text_input.html" import TextInput %}
|
||||
{% from "components/options_input.html" import OptionsInput %}
|
||||
{% from "components/date_input.html" import DateInput %}
|
||||
@@ -12,12 +11,7 @@
|
||||
|
||||
{% block form %}
|
||||
|
||||
{% if f.errors %}
|
||||
{{ Alert('There were some errors',
|
||||
message="<p>Please see below.</p>",
|
||||
level='error'
|
||||
) }}
|
||||
{% endif %}
|
||||
{% include "fragments/flash.html" %}
|
||||
|
||||
<p>Please tell us more about you.</p>
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
{% extends 'requests/_new.html' %}
|
||||
|
||||
{% from "components/alert.html" import Alert %}
|
||||
{% from "components/text_input.html" import TextInput %}
|
||||
{% from "components/checkbox_input.html" import CheckboxInput %}
|
||||
|
||||
@@ -10,12 +9,7 @@
|
||||
|
||||
{% block form %}
|
||||
|
||||
{% if f.errors %}
|
||||
{{ Alert('There were some errors',
|
||||
message="<p>Please see below.</p>",
|
||||
level='error'
|
||||
) }}
|
||||
{% endif %}
|
||||
{% include "fragments/flash.html" %}
|
||||
|
||||
<poc inline-template v-bind:initial-data='{{ f.data|tojson }}'>
|
||||
<div>
|
||||
|
@@ -4,7 +4,6 @@
|
||||
|
||||
{% extends 'requests/_new.html' %}
|
||||
|
||||
{% from "components/alert.html" import Alert %}
|
||||
{% from "components/text_input.html" import TextInput %}
|
||||
{% from "components/icon.html" import Icon %}
|
||||
|
||||
@@ -21,12 +20,7 @@
|
||||
|
||||
<p>Before you can submit your request, please take a moment to review the information entered in the form. You may make changes by clicking the edit link on each section. When all information looks right, go ahead and submit.</p>
|
||||
|
||||
{% if f.errors or not can_submit %}
|
||||
{{ Alert('Please complete all sections',
|
||||
message="<p>In order to submit your JEDI Cloud request, you'll need to complete all required sections of this form without error. Missing or invalid fields are noted below.</p>",
|
||||
level='error'
|
||||
) }}
|
||||
{% endif %}
|
||||
{% include "fragments/flash.html" %}
|
||||
|
||||
{% with editable=True %}
|
||||
{% include "requests/_review.html" %}
|
||||
|
@@ -1,26 +1,9 @@
|
||||
{% extends "base.html" %}
|
||||
{% from "components/alert.html" import Alert %}
|
||||
|
||||
{% block content %}
|
||||
<div class='col'>
|
||||
|
||||
{% if next is not none %}
|
||||
{{ Alert('You must complete your profile',
|
||||
message='<p>Before continuing, you must complete your profile</p>',
|
||||
level='info'
|
||||
) }}
|
||||
{% endif %}
|
||||
|
||||
{% if form.errors %}
|
||||
{{ Alert('There were some errors',
|
||||
message="<p>Please see below.</p>",
|
||||
level='error'
|
||||
) }}
|
||||
{% endif %}
|
||||
|
||||
{% if updated %}
|
||||
{{ Alert('User information updated.', level='success') }}
|
||||
{% endif %}
|
||||
{% include "fragments/flash.html" %}
|
||||
|
||||
<div class='panel'>
|
||||
<div class='panel__heading'>
|
||||
|
@@ -1,18 +1,11 @@
|
||||
{% extends "workspaces/base.html" %}
|
||||
|
||||
{% from "components/icon.html" import Icon %}
|
||||
{% from "components/alert.html" import Alert %}
|
||||
{% from "components/text_input.html" import TextInput %}
|
||||
|
||||
|
||||
{% block workspace_content %}
|
||||
|
||||
{% if form.errors %}
|
||||
{{ Alert('There were some errors',
|
||||
message="<p>Please see below.</p>",
|
||||
level='error'
|
||||
) }}
|
||||
{% endif %}
|
||||
{% include "fragments/flash.html" %}
|
||||
|
||||
<form method="POST" action="{{ url_for('workspaces.edit_workspace', workspace_id=workspace.id) }}" autocomplete="false">
|
||||
{{ form.csrf_token }}
|
||||
|
@@ -4,14 +4,11 @@
|
||||
{% from "components/modal.html" import Modal %}
|
||||
{% from "components/selector.html" import Selector %}
|
||||
{% from "components/options_input.html" import OptionsInput %}
|
||||
{% from "components/alert.html" import Alert %}
|
||||
{% from "components/confirmation_button.html" import ConfirmationButton %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if member.has_dod_id_error %}
|
||||
{{ Alert('CAC ID Error', message='The member attempted to accept this invite, but their CAC ID did not match the CAC ID you specified on the invite. Please confirm that the DOD ID is accurate.', level='error') }}
|
||||
{% endif %}
|
||||
{% include "fragments/flash.html" %}
|
||||
|
||||
<form method="POST" action="{{ url_for('workspaces.update_member', workspace_id=workspace.id, member_id=member.user_id) }}" autocomplete="false">
|
||||
{{ form.csrf_token }}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
{% extends "workspaces/base.html" %}
|
||||
|
||||
{% from "components/empty_state.html" import EmptyState %}
|
||||
{% from "components/alert.html" import Alert %}
|
||||
{% from "components/icon.html" import Icon %}
|
||||
|
||||
{% block workspace_content %}
|
||||
@@ -21,53 +20,7 @@
|
||||
|
||||
{% else %}
|
||||
|
||||
{% if new_member %}
|
||||
{% set message -%}
|
||||
<p>{{ new_member.user_name }} was successfully invited via email to this workspace. They do not yet have access to any environments.</p>
|
||||
<p><a href="{{ url_for('workspaces.update_member', workspace_id=workspace.id, member_id=new_member.user_id) }}">Add environment access.</a></p>
|
||||
{%- endset %}
|
||||
|
||||
{{ Alert('Member added successfully',
|
||||
message=message,
|
||||
level='success'
|
||||
) }}
|
||||
{% endif %}
|
||||
|
||||
{% if resent_invitation_to %}
|
||||
{% set message -%}
|
||||
<p>Successfully sent a new invitation to {{ resent_invitation_to }}.</p>
|
||||
{%- endset %}
|
||||
|
||||
{{ Alert('Invitation resent',
|
||||
message=message,
|
||||
level='success'
|
||||
) }}
|
||||
{% endif %}
|
||||
|
||||
{% if revoked_member_name %}
|
||||
{% set message -%}
|
||||
<p>Removed {{ revoked_member_name }} from this workspace.</p>
|
||||
{%- endset %}
|
||||
|
||||
{{ Alert('Removed workspace access',
|
||||
message=message,
|
||||
level='success'
|
||||
) }}
|
||||
{% endif %}
|
||||
|
||||
{% set member_name = request.args.get("memberName") %}
|
||||
{% set updated_role = request.args.get("updatedRole") %}
|
||||
{% if updated_role %}
|
||||
{% set message -%}
|
||||
<p>{{ member_name }}'s role was successfully updated to {{ updated_role }}</p>
|
||||
{%- endset %}
|
||||
|
||||
{{ Alert('Workspace role updated successfully',
|
||||
message=message,
|
||||
level='success'
|
||||
) }}
|
||||
{% endif %}
|
||||
|
||||
{% include "fragments/flash.html" %}
|
||||
|
||||
<members-list
|
||||
inline-template
|
||||
|
@@ -1,5 +1,4 @@
|
||||
{% from "components/icon.html" import Icon %}
|
||||
{% from "components/alert.html" import Alert %}
|
||||
{% from "components/empty_state.html" import EmptyState %}
|
||||
|
||||
{% extends "workspaces/base.html" %}
|
||||
|
@@ -8,14 +8,7 @@
|
||||
{% block workspace_content %}
|
||||
|
||||
{% set modalName = "newProjectConfirmation" %}
|
||||
{% if request.args.get("newWorkspace") %}
|
||||
{{ Alert('Workspace created!',
|
||||
message="\
|
||||
<p>You are now ready to create projects and environments within the JEDI Cloud.</p>
|
||||
",
|
||||
level='success'
|
||||
) }}
|
||||
{% endif %}
|
||||
{% include "fragments/flash.html" %}
|
||||
|
||||
<new-project inline-template v-bind:initial-data='{{ form.data|tojson }}' modal-name='{{ modalName }}'>
|
||||
<form method="POST" action="{{ url_for('workspaces.create_project', workspace_id=workspace.id) }}" v-on:submit="handleSubmit">
|
||||
|
Reference in New Issue
Block a user