mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 01:42:29 +03:00
63b8127cfa
refs https://github.com/TryGhost/Ghost/issues/7131 - adds `disableMouseDown` flag to `{{gh-task-button}}` - uses flag for the send invite button so that the focus-out validation on the e-mail input is not triggered before the click event is triggered
60 lines
2.1 KiB
Handlebars
60 lines
2.1 KiB
Handlebars
<header class="modal-header">
|
|
<h1>Invite a New User</h1>
|
|
</header>
|
|
{{!-- disable mouseDown so it doesn't trigger focus-out validations --}}
|
|
<a class="close" href="" title="Close" {{action "closeModal"}} {{action (optional noop) on="mouseDown"}}>
|
|
{{svg-jar "close"}}<span class="hidden">Close</span>
|
|
</a>
|
|
|
|
<div class="modal-body">
|
|
<fieldset>
|
|
{{#gh-form-group errors=errors hasValidated=hasValidated property="email"}}
|
|
<label for="new-user-email">Email Address</label>
|
|
{{gh-text-input
|
|
class="email"
|
|
id="new-user-email"
|
|
type="email"
|
|
placeholder="Email Address"
|
|
name="email"
|
|
autofocus="autofocus"
|
|
autocapitalize="off"
|
|
autocorrect="off"
|
|
value=(readonly email)
|
|
input=(action (mut email) value="target.value")
|
|
keyEvents=(hash
|
|
Enter=(action "confirm")
|
|
)
|
|
focus-out=(action "validate" "email")
|
|
}}
|
|
{{gh-error-message errors=errors property="email"}}
|
|
{{/gh-form-group}}
|
|
|
|
|
|
{{#gh-form-group class="for-select" errors=errors hasValidated=hasValidated property="role"}}
|
|
<label for="new-user-role">Role</label>
|
|
<span class="gh-select">
|
|
{{one-way-select
|
|
id="new-user-role"
|
|
name="role"
|
|
options=(readonly roles)
|
|
optionValuePath="id"
|
|
optionLabelPath="name"
|
|
value=role
|
|
update=(action "setRole")
|
|
}}
|
|
{{svg-jar "arrow-down-small"}}
|
|
</span>
|
|
{{gh-error-message errors=errors property="role"}}
|
|
{{/gh-form-group}}
|
|
</fieldset>
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
{{gh-task-button "Send invitation now"
|
|
successText="Sent"
|
|
task=sendInvitation
|
|
class="gh-btn gh-btn-green gh-btn-icon"
|
|
disabled=fetchRoles.isRunning
|
|
disableMouseDown=true}}
|
|
</div>
|