A bug was caused by using the MemberManagementTemplate macro and not supplying all of the necessary kwargs. Intially, this bug was fixed by supplying the kwargs used by the macro at the time, but in this refactor, we simply remove those kwargs and refer to the permissions directly in the template by importing the macro with context.
122 lines
4.1 KiB
HTML
122 lines
4.1 KiB
HTML
{% extends "applications/base.html" %}
|
|
|
|
{% from "components/alert.html" import Alert %}
|
|
{% from "components/delete_confirmation.html" import DeleteConfirmation %}
|
|
{% from "fragments/environments.html" import EnvironmentManagementTemplate %}
|
|
{% from "fragments/members.html" import MemberManagementTemplate with context %}
|
|
{% 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 %}
|
|
|
|
{% 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 %}
|
|
<!-- TODO: use new spacing styling to add in bottom margin here -->
|
|
<div class="">
|
|
<p>
|
|
{{ "fragments.edit_application_form.explain" | translate }}
|
|
</p>
|
|
<div class="usa-input usa-input__title__view-only">
|
|
{{ application_form.name.label() }}
|
|
</div>
|
|
<p>
|
|
{{ application_form.name.data }}
|
|
</p>
|
|
<div class="usa-input usa-input__title__view-only">
|
|
{{ application_form.description.label() }}
|
|
</div>
|
|
<p>
|
|
{{ application_form.description.data }}
|
|
</p>
|
|
</div>
|
|
{% endif %}
|
|
<hr>
|
|
|
|
{{ MemberManagementTemplate(
|
|
application,
|
|
members,
|
|
new_member_form,
|
|
"applications.create_member") }}
|
|
|
|
{{ EnvironmentManagementTemplate(
|
|
application,
|
|
environments_obj,
|
|
new_env_form,
|
|
user_can_create_environment=user_can(permissions.CREATE_ENVIRONMENT)
|
|
) }}
|
|
|
|
{% 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 %}
|
|
|
|
<h3>
|
|
{{ "portfolios.applications.delete.subheading" | translate }}
|
|
</h3>
|
|
<div class="form-row">
|
|
<div class="form-col form-col--two-thirds">
|
|
{{ "portfolios.applications.delete.text" | translate({"application_name": application.name}) | 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--outline button-danger-outline'
|
|
value="{{ 'portfolios.applications.delete.button' | translate }}"
|
|
>
|
|
</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 %}
|
|
|
|
<hr>
|
|
|
|
{% if user_can(permissions.VIEW_APPLICATION_ACTIVITY_LOG) and config.get("USE_AUDIT_LOG", False) %}
|
|
{% include "fragments/audit_events_log.html" %}
|
|
{{ Pagination(audit_events, url=url_for('applications.settings', application_id=application.id)) }}
|
|
{% endif %}
|
|
|
|
{% endblock %}
|