Ghost/ghost/admin/app/templates/member.hbs
Kevin Ansfield 5585a781b9 Unified tag and member screen code
no issue

The tag and member screens share the same underlying UI/UX patterns but were using different code patterns. This brings both in line so that we have consistent code patterns that can be re-used for other screens.

- fixed cleanup of new tags by adding the `deactivate` hook to the `tag` route
- updated `member` and `member.new` route/controller setup to match tag route/controller setup
  - added `save` action to member controller so that Ctrl/Cmd+S works on member screen
  - updated tag route/controller to utilise the same instant display w/background refresh when accessing the tag details screen
- completed transition of non-component tag/members templates over to angle bracket component syntax
2019-12-12 13:59:46 +00:00

80 lines
3.1 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.

<section class="gh-canvas">
<form class="mb10 member-basic-info-form">
<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">
<GhTaskButton @class="gh-btn gh-btn-blue gh-btn-icon" @type="button" @task={{save}} @data-test-button="save" />
</section>
</GhCanvasHeader>
<div class="flex items-center mb10 bt b--lightgrey-d1 pt8">
{{#if (or member.name member.email)}}
<GhMemberAvatar
@member={{this.member}}
@sizeClass={{if this.member.name 'f-subheadline fw4 lh-zero tracked-1' 'f-headline fw4 lh-zero tracked-1'}}
@containerClass="w18 h18 mr4 gh-member-detail-avatar"
/>
{{else}}
<div class="flex items-center justify-center br-100 w18 h18 mr4 gh-new-member-avatar">
<span class="gh-member-avatar-label f-subheadline fw4 lh-zero tracked-1">N</span>
</div>
{{/if}}
<div>
<h3 class="f2 fw5 ma0 pa0">
{{or this.member.name this.member.email}}
</h3>
<p class="f6 pa0 ma0 midlightgrey-d1">
{{#if (and this.member.name this.member.email)}}
<span class="darkgrey fw5">{{this.member.email}}</span>
{{/if}}
{{#unless this.member.isNew}}
{{if (and member.name member.email) ""}}
Created on {{this.subscribedAt}}
{{/unless}}
</p>
</div>
</div>
<GhMemberSettingsForm
@member={{this.member}}
@setProperty={{action "setProperty"}}
@isLoading={{this.isLoading}}
@showDeleteTagModal={{action "toggleDeleteMemberModal"}} />
</form>
{{#unless this.member.isNew}}
<button
type="button"
class="gh-btn gh-btn-red gh-btn-icon mt3"
{{on "click" (action "toggleDeleteMemberModal")}}
data-test-button="delete-member"
>
<span>Delete member</span>
</button>
{{/unless}}
</section>
{{#if this.showUnsavedChangesModal}}
<GhFullscreenModal
@modal="leave-settings"
@confirm={{action "leaveScreen"}}
@close={{action "toggleUnsavedChangesModal"}}
@modifier="action wide" />
{{/if}}
{{#if this.showDeleteMemberModal}}
<GhFullscreenModal
@modal="delete-member"
@model={{hash member=this.member onSuccess=(action "finaliseDeletion")}}
@close={{action "toggleDeleteMemberModal"}}
@modifier="action wide" />
{{/if}}