Use ConfirmationPopover rather than custom form
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
{% macro ConfirmationButton(btn_text, action, confirm_msg="Are you sure?", confirm_btn="Confirm", cancel_btn="Cancel") -%}
|
||||
{% macro ConfirmationButton(
|
||||
btn_text,
|
||||
action,
|
||||
btn_icon=None,
|
||||
btn_class=None,
|
||||
confirm_msg="Are you sure?",
|
||||
confirm_btn="Confirm",
|
||||
cancel_btn="Cancel")
|
||||
-%}
|
||||
<confirmation-popover
|
||||
btn_text='{{ btn_text }}'
|
||||
btn_icon='{{ btn_icon }}'
|
||||
btn_class='{{ btn_class }}'
|
||||
action='{{ action }}'
|
||||
csrf_token='{{ csrf_token() }}'
|
||||
confirm_msg='{{ confirm_msg }}'
|
||||
|
@@ -5,6 +5,7 @@
|
||||
{% from "components/checkbox_input.html" import CheckboxInput %}
|
||||
{% from "components/icon.html" import Icon %}
|
||||
{% from "components/text_input.html" import TextInput %}
|
||||
{% from "components/confirmation_button.html" import ConfirmationButton %}
|
||||
|
||||
|
||||
{% macro Link(text, icon_name, onClick=None, url='#', classes='') %}
|
||||
@@ -96,15 +97,21 @@
|
||||
</div>
|
||||
<div class="officer__actions">
|
||||
{{ Link("Update", "edit", onClick="edit") }}
|
||||
{% set invite_type = [prefix + "_invite"] %}
|
||||
|
||||
<form method='POST' action="{{ url_for("portfolios.resend_invite", portfolio_id=portfolio.id, task_order_id=task_order.id) }}" class="inline-form">
|
||||
{{ form.csrf_token }}
|
||||
<input name="invite_type" value="{{ prefix }}_invite" type="hidden" />
|
||||
<button class="icon-link">
|
||||
{{ Icon('avatar') }}
|
||||
Resend Invitation
|
||||
</button>
|
||||
</form>
|
||||
{{
|
||||
ConfirmationButton(
|
||||
btn_text="Resend Invitation",
|
||||
action=url_for(
|
||||
"portfolios.resend_invite",
|
||||
portfolio_id=portfolio.id,
|
||||
task_order_id=task_order.id,
|
||||
invite_type=invite_type,
|
||||
),
|
||||
btn_icon=Icon('avatar'),
|
||||
btn_class="icon-link",
|
||||
)
|
||||
}}
|
||||
|
||||
{{ Link("Remove", "trash", classes="remove") }}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user