This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/templates/modal/invite.hbs
Sam b34b1b6fe3 FIX: invite to message was not allowing groups
Previously we were incorrectly checking mentionable instead of messageable

Also fix edge case where multiple groups sharing a name mean that exact match override is not working

Also cleans up params sent to user selector
2018-02-13 13:28:46 +11:00

53 lines
2.0 KiB
Handlebars
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{#d-modal-body id="invite-modal" title=title}}
{{#if model.error}}
<div class="alert alert-error">
<button class="close" data-dismiss="alert">×</button>
{{{errorMessage}}}
</div>
{{/if}}
{{#if model.finished}}
{{#if model.inviteLink}}
{{generated-invite-link link=model.inviteLink email=emailOrUsername}}
{{else}}
{{{successMessage}}}
{{/if}}
{{else}}
<label>{{inviteInstructions}}</label>
{{#if allowExistingMembers}}
{{user-selector
single=true
allowAny=true
excludeCurrentUser=true
includeMentionableGroups=includeMentionableGroups
includeMessageableGroups=isMessage
hasGroups=hasGroups
usernames=emailOrUsername
placeholderKey=placeholderKey
autocomplete="off"}}
{{else}}
{{text-field value=emailOrUsername placeholderKey="topic.invite_reply.email_placeholder"}}
{{/if}}
{{#if showGroups}}
<label><span class={{showGroupsClass}}>{{i18n 'topic.automatically_add_to_groups'}}</span></label>
{{group-selector groupFinder=groupFinder groupNames=model.groupNames placeholderKey="topic.invite_private.group_name"}}
{{/if}}
{{#if showCustomMessage}}
<br><label><span class='optional'>{{i18n 'invite.custom_message'}}</span> <a {{action "showCustomMessageBox"}}>{{i18n 'invite.custom_message_link'}}</a>.</label>
{{#if hasCustomMessage}}{{textarea value=customMessage placeholder=customMessagePlaceholder}}{{/if}}
{{/if}}
{{/if}}
{{/d-modal-body}}
<div class="modal-footer">
{{#if model.finished}}
{{d-button class="btn-primary" action="closeModal" label="close"}}
{{else}}
{{d-button icon=inviteIcon action="createInvite" class="btn-primary" disabled=disabled label=buttonTitle}}
{{#if showCopyInviteButton}}
{{d-button icon="link" action="generateInvitelink" class="btn-primary" disabled=disabledCopyLink label='user.invited.generate_link'}}
{{/if}}
{{/if}}
</div>