Revoke invitation #160300315
This commit is contained in:
dandds
2018-11-08 10:23:22 -05:00
committed by GitHub
8 changed files with 91 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
{% macro ConfirmationButton(btn_text, action, csrf_token, confirm_msg="Are you sure?", confirm_btn="Confirm", cancel_btn="Cancel") -%}
<v-popover placement='top-start'>
<template slot="popover">
<p>{{ confirm_msg }}</p>
<div class='action-group'>
<form method="POST" action="{{ action }}">
{{ csrf_token }}
<button class='usa-button usa-button-primary' type='submit'>
{{ confirm_btn }}
</button>
</form>
<button class='usa-button usa-button-secondary' v-close-popover>
{{ cancel_btn }}
</button>
</div>
</template>
<button class="tooltip-target" type="button">{{ btn_text }}</button>
</v-popover>
{%- endmacro %}

View File

@@ -5,6 +5,7 @@
{% 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 %}
@@ -38,6 +39,13 @@
{% if editable %}
<a href='{{ url_for("users.user") }}' class='icon-link'>edit account details</a>
{% endif %}
{% if member.latest_invitation.is_pending %}
{{ ConfirmationButton(
"Revoke Invitation",
url_for("workspaces.revoke_invitation", workspace_id=workspace.id, token=member.latest_invitation.token),
form.csrf_token
) }}
{% endif %}
</div>
</div>