As part of this, the empty placeholder span was removed from the text input macro and the span will now be conditionall rendered if there is an error message
238 lines
9.0 KiB
HTML
238 lines
9.0 KiB
HTML
{% extends "applications/base.html" %}
|
|
|
|
{% from "components/alert.html" import Alert %}
|
|
{% from "components/delete_confirmation.html" import DeleteConfirmation %}
|
|
{% from "components/icon.html" import Icon %}
|
|
{% import "applications/fragments/new_member_modal_content.html" as member_steps %}
|
|
{% from "fragments/members.html" import MemberManagementTemplate %}
|
|
{% from "components/modal.html" import Modal %}
|
|
{% from "components/pagination.html" import Pagination %}
|
|
{% from "components/save_button.html" import SaveButton %}
|
|
{% from "components/text_input.html" import TextInput %}
|
|
{% from "components/toggle_list.html" import ToggleButton, ToggleSection %}
|
|
{% from "components/icon.html" import Icon %}
|
|
{% from "components/text_input.html" import TextInput %}
|
|
{% from "components/checkbox_input.html" import CheckboxInput %}
|
|
{% from "components/phone_input.html" import PhoneInput %}
|
|
|
|
{% set secondary_breadcrumb = 'portfolios.applications.existing_application_title' | translate({ "application_name": application.name }) %}
|
|
|
|
{% block application_content %}
|
|
|
|
<h3>{{ 'portfolios.applications.settings.name_description' | translate }}</h3>
|
|
|
|
{% if user_can(permissions.EDIT_APPLICATION) %}
|
|
<base-form inline-template>
|
|
<form method="POST" action="{{ url_for('applications.update', application_id=application.id) }}" class="col col--half">
|
|
{{ application_form.csrf_token }}
|
|
{{ TextInput(application_form.name, optional=False) }}
|
|
{{ TextInput(application_form.description, paragraph=True, optional=True, showOptional=False) }}
|
|
<div class="action-group action-group--tight">
|
|
{{ SaveButton('common.save_changes'|translate) }}
|
|
</div>
|
|
</form>
|
|
</base-form>
|
|
{% else %}
|
|
<div class="panel">
|
|
<div class="panel__content">
|
|
<p>
|
|
{{ "fragments.edit_application_form.explain" | translate }}
|
|
</p>
|
|
<div class="form-row">
|
|
<div class="form-col">
|
|
<div class="usa-input usa-input__title__view-only">
|
|
{{ application_form.name.label() }}
|
|
</div>
|
|
<p>
|
|
{{ application_form.name.data }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="form-row">
|
|
<div class="form-col">
|
|
<div class="usa-input usa-input__title__view-only">
|
|
{{ application_form.description.label() }}
|
|
</div>
|
|
<p>
|
|
{{ application_form.description.data }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
<hr>
|
|
|
|
{{ MemberManagementTemplate(
|
|
application,
|
|
members,
|
|
new_member_form,
|
|
"applications.create_member",
|
|
user_can_create_app_member=user_can(permissions.CREATE_APPLICATION_MEMBER),
|
|
user_can_edit_app_member=user_can(permissions.EDIT_APPLICATION_MEMBER),
|
|
user_can_delete_app_member=user_can(permissions.DELETE_APPLICATION_MEMBER),
|
|
) }}
|
|
|
|
<div class="subheading">
|
|
{{ 'common.resource_names.environments' | translate }}
|
|
</div>
|
|
<div class="panel">
|
|
{% if g.matchesPath("application-environments") %}
|
|
{% include "fragments/flash.html" %}
|
|
{% endif %}
|
|
<div class="panel__content">
|
|
<div class="accordion-table accordion-table-list">
|
|
<ul class="accordion-table__items">
|
|
{% for env in environments_obj %}
|
|
{% set edit_form = env['edit_form'] %}
|
|
<toggler inline-template>
|
|
<li class="accordion-table__item">
|
|
<div class="accordion-table__item-content form-row">
|
|
<div class="form-col form-col--two-thirds">
|
|
<div class="environment-list__item">
|
|
<span>
|
|
{{ env['name'] }}
|
|
</span>
|
|
{% if env['pending'] %}
|
|
<span class='usa-label'>PROCESSING</span>
|
|
{% endif %}
|
|
{% if env['pending'] %}
|
|
<span class="icon-link">
|
|
{% set edit_environment_button %}
|
|
{{ Icon('edit') }}
|
|
{% endset %}
|
|
|
|
{{
|
|
ToggleButton(
|
|
open_html=edit_environment_button,
|
|
close_html=edit_environment_button,
|
|
section_name="edit"
|
|
)
|
|
}}
|
|
</span>
|
|
{% endif %}
|
|
<span class="accordion-table__item__toggler icon-link">
|
|
{% set members_button = "portfolios.applications.member_count" | translate({'count': env['member_count']}) %}
|
|
{{
|
|
ToggleButton(
|
|
open_html=members_button,
|
|
close_html=members_button,
|
|
section_name="members"
|
|
)
|
|
}}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="form-col form-col--third">
|
|
{% if env['pending'] %}
|
|
<em>Cloud service provider link unavailable</em>
|
|
{% else %}
|
|
<a href='{{ url_for("applications.access_environment", environment_id=env.id)}}' target='_blank' rel='noopener noreferrer' class='application-list-item__environment__csp_link icon-link'>
|
|
<span>{{ "portfolios.applications.csp_link" | translate }} {{ Icon('link', classes="icon--tiny") }}</span>
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
{% call ToggleSection(section_name="members") %}
|
|
<ul>
|
|
{% for member in env['members'] %}
|
|
<li class="accordion-table__item__expanded">
|
|
{{ member }}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endcall %}
|
|
|
|
{% call ToggleSection(section_name="edit") %}
|
|
<ul>
|
|
<li class="accordion-table__item__expanded">
|
|
<form action="{{ url_for('applications.update_environment', environment_id=env['id']) }}" method="post" v-on:submit="handleSubmit">
|
|
{{ edit_form.csrf_token }}
|
|
{{ TextInput(edit_form.name, validation='requiredField') }}
|
|
{{
|
|
SaveButton(
|
|
text=("common.save" | translate)
|
|
)
|
|
}}
|
|
</form>
|
|
</li>
|
|
</ul>
|
|
{% endcall %}
|
|
</li>
|
|
</toggler>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
{% if user_can(permissions.CREATE_ENVIRONMENT) %}
|
|
<div class='subheading'>
|
|
{% include "applications/fragments/add_new_environment.html" %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
{% if user_can(permissions.DELETE_APPLICATION) %}
|
|
{% set env_count = application.environments | length %}
|
|
{% if env_count == 1 %}
|
|
{% set pluralized_env = "environment" %}
|
|
{% else %}
|
|
{% set pluralized_env = "environments" %}
|
|
{% endif %}
|
|
|
|
<div class='subheading'>
|
|
{{ "portfolios.applications.delete.subheading" | translate }}
|
|
</div>
|
|
|
|
<div class="panel">
|
|
<div class="panel__content">
|
|
<div class="form-row">
|
|
<div class="form-col form-col--two-thirds">
|
|
{{ "portfolios.applications.delete.panel_text" | translate({"name": application.name, "env_count": env_count , "pluralized_env": pluralized_env}) | safe }}
|
|
</div>
|
|
<div class="form-col form-col--third">
|
|
<div class="usa-input">
|
|
<input
|
|
id="delete-application"
|
|
type="button"
|
|
v-on:click="openModal('delete-application')"
|
|
class='usa-button button-danger-outline'
|
|
value="{{ 'portfolios.applications.delete.button' | translate }}"
|
|
>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% call Modal(name="delete-application") %}
|
|
<h1>{{ "portfolios.applications.delete.header" | translate }}</h1>
|
|
<hr>
|
|
{{
|
|
Alert(
|
|
title=("components.modal.destructive_title" | translate),
|
|
message=("portfolios.applications.delete.alert.message" | translate),
|
|
level="warning"
|
|
)
|
|
}}
|
|
|
|
{{
|
|
DeleteConfirmation(
|
|
modal_id="delete_application",
|
|
delete_text=('portfolios.applications.delete.button' | translate),
|
|
delete_action= url_for('applications.delete', application_id=application.id),
|
|
form=application_form
|
|
)
|
|
}}
|
|
{% endcall %}
|
|
{% endif %}
|
|
|
|
{% if user_can(permissions.VIEW_APPLICATION_ACTIVITY_LOG) %}
|
|
{% include "fragments/audit_events_log.html" %}
|
|
{{ Pagination(audit_events, url=url_for('applications.settings', application_id=application.id)) }}
|
|
{% endif %}
|
|
|
|
{% endblock %}
|