Ghost/ghost/admin/app/templates/member.hbs
Rishabh 942ad319e8 Updated complimentary subscription assignment to member
no refs

With custom products, we added a new modal to add a complimentary price to a member. Since we want to handle the comp prices implicitly with new changes, this change updates the comp subscription assignment to a member directly without opening a modal, by using the old `comped` flag in API. The `comped` flag takes care of creating the right complimentary subscription for member.

In case a member already has a comped subscription, we hide the option to add another subscription.
2021-05-19 22:36:02 +05:30

79 lines
2.6 KiB
Handlebars

<section class="gh-canvas">
<GhCanvasHeader class="gh-canvas-header">
<h2 class="gh-canvas-title" data-test-screen-title>
<LinkTo @route="members" data-test-link="members-back">Members</LinkTo>
<span>{{svg-jar "arrow-right"}}</span>
{{#if this.member.isNew}}
New member
{{else}}
{{or this.member.name this.member.email}}
{{/if}}
</h2>
<section class="view-actions">
{{#if this.session.user.isOwnerOrAdmin}}
{{#unless this.member.isNew}}
<button
class="gh-btn gh-btn-white gh-btn-icon mr2"
{{on "click" this.toggleImpersonateMemberModal}}>
<span>Impersonate</span>
</button>
{{/unless}}
{{/if}}
<GhTaskButton @class="gh-btn gh-btn-primary gh-btn-icon" @type="button" @task={{this.saveTask}} @data-test-button="save" />
</section>
</GhCanvasHeader>
<div>
<form class="member-basic-info-form">
<GhMemberSettingsFormCp
@member={{this.member}}
@scratchMember={{this.scratchMember}}
@setProperty={{this.setProperty}}
@saveMember={{this.save}}
@isLoading={{this.isLoading}} />
</form>
{{#unless this.member.isNew}}
<div class="gh-main-section">
<div class="gh-main-section-block">
<button
type="button"
class="gh-btn gh-btn-red gh-btn-icon"
{{on "click" this.toggleDeleteMemberModal}}
data-test-button="delete-member"
>
<span>Delete member</span>
</button>
</div>
</div>
{{/unless}}
</div>
</section>
{{#if this.showUnsavedChangesModal}}
<GhFullscreenModal
@modal="leave-settings"
@confirm={{this.leaveScreen}}
@close={{this.toggleUnsavedChangesModal}}
@modifier="action wide" />
{{/if}}
{{#if this.showDeleteMemberModal}}
<GhFullscreenModal
@modal="delete-member"
@model={{this.member}}
@confirm={{this.deleteMember}}
@close={{this.toggleDeleteMemberModal}}
@modifier="action wide" />
{{/if}}
{{#if this.showImpersonateMemberModal}}
<GhFullscreenModal
@modal="impersonate-member"
@model={{this.member}}
@close={{this.toggleImpersonateMemberModal}}
@modifier="action wide" />
{{/if}}