Remove Portfolio User

This commit is contained in:
George Drummond
2019-03-26 15:45:32 -04:00
parent 575cfce5e4
commit 6f1eb43de4
8 changed files with 145 additions and 1 deletions

View File

@@ -1,6 +1,9 @@
{% from "components/icon.html" import Icon %}
{% from "components/options_input.html" import OptionsInput %}
{% from "components/modal.html" import Modal %}
{% from "components/alert.html" import Alert %}
<section class="member-list" id="portfolio-members">
<div class='responsive-table-wrapper panel'>
{% if g.matchesPath("portfolio-members") %}
@@ -51,6 +54,34 @@
{% endif %}
</form>
{% if user_can(permissions.EDIT_PORTFOLIO_USERS) %}
{% for member in portfolio.members %}
{% set modal_id = "portfolio_id_{}_user_id_{}".format(portfolio.id, user.id) %}
{% call Modal(name=modal_id, dismissable=False) %}
<h1>Are you sure you want to archive this user?</h1>
{{
Alert(
title="Warning! You are about to archive a user from the portfolio admin.",
message="User will be removed from the portfolio, but their log history will be retained.",
level="warning"
)
}}
<div class="action-group">
<form method="POST" action="{{ url_for('portfolios.remove_member', portfolio_id=portfolio.id, member_id=member.user_id) }}">
{{ member_perms_form.csrf_token }}
<button class="usa-button usa-button-danger">
{{ "portfolios.members.archive_button" | translate }}
</button>
</form>
<a v-on:click="closeModal('d')">Cancel</a>
</div>
{% endcall %}
{% endfor %}
{% endif %}
<div class="members-table-footer">
<div class="action-group">
{% if user_can(permissions.EDIT_PORTFOLIO_USERS) %}