Portfolio archiving
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
{% macro DeleteConfirmation(modal_id, delete_text, delete_action, form) %}
|
||||
<delete-confirmation inline-template name="{{ modal_id }}" key="{{ modal_id }}">
|
||||
{% macro DeleteConfirmation(modal_id, delete_text, delete_action, form, confirmation_text="delete") %}
|
||||
<delete-confirmation inline-template name="{{ modal_id }}" key="{{ modal_id }}" confirmation-text="{{ confirmation_text }}">
|
||||
<div>
|
||||
<div class="usa-input">
|
||||
<label for="{{ modal_id }}-deleted-text">
|
||||
<span class="usa-input__help">
|
||||
{{ "common.delete_confirm" | translate }}
|
||||
{{ "common.delete_confirm" | translate({"word": confirmation_text.upper()}) }}
|
||||
</span>
|
||||
</label>
|
||||
<input id="{{ modal_id }}-deleted-text" v-model="deleteText">
|
||||
|
42
templates/fragments/delete_portfolio.html
Normal file
42
templates/fragments/delete_portfolio.html
Normal file
@@ -0,0 +1,42 @@
|
||||
{% from "components/delete_confirmation.html" import DeleteConfirmation %}
|
||||
{% from "components/alert.html" import Alert %}
|
||||
{% from "components/modal.html" import Modal %}
|
||||
|
||||
<section id="primary-point-of-contact" class="panel">
|
||||
<div class="panel__content">
|
||||
<h2>{{ "fragments.delete_portfolio.title" | translate }}</h2>
|
||||
<p>{{ "fragments.delete_portfolio.subtitle" | translate }}</p>
|
||||
|
||||
|
||||
<div
|
||||
class="usa-button-primary {% if applications_count == 0 %}button-danger{% else %}usa-button-disabled{% endif %}"
|
||||
{% if applications_count == 0 %}v-on:click="openModal('delete_portfolio')"{% endif %}
|
||||
>
|
||||
{{ "common.delete" | translate }}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{% call Modal(name="delete_portfolio") %}
|
||||
<h1>
|
||||
{{ 'fragments.delete_portfolio.title' | translate }}
|
||||
</h1>
|
||||
|
||||
{{
|
||||
Alert(
|
||||
level="warning",
|
||||
title=('components.modal.destructive_title' | translate),
|
||||
message=('components.modal.destructive_message' | translate({"resource": "portfolio"})),
|
||||
)
|
||||
}}
|
||||
|
||||
{{
|
||||
DeleteConfirmation(
|
||||
modal_id='delete_portfolio',
|
||||
delete_text='Deactivate',
|
||||
delete_action=url_for('portfolios.delete_portfolio', portfolio_id=portfolio.id),
|
||||
form=portfolio_form,
|
||||
confirmation_text="deactivate",
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
@@ -44,6 +44,10 @@
|
||||
{% include "fragments/primary_point_of_contact.html" %}
|
||||
{% endif %}
|
||||
|
||||
{% if user_can(permissions.VIEW_PORTFOLIO_POC) %}
|
||||
{% include "fragments/delete_portfolio.html" %}
|
||||
{% endif %}
|
||||
|
||||
{% if user_can(permissions.VIEW_PORTFOLIO_USERS) %}
|
||||
{% include "fragments/admin/portfolio_members.html" %}
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user