mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 09:03:12 +03:00
c41c184762
no issue - We have a need to create a member manually, this changeset solves this problem. - Added new member button to the member's screen - Needed to be able to perform add member action - Fixed inconsistent `createAt` naming. All models use consistent `createdAtUTC`, fixed it up so that members model follows the same pattern. If we want to change this pattern should probably happen for all models at once - Fixed member avatar when creating a new member. If the values are completely empty the screen ends up being filled with empty space. Added some dummy initials which are recalculated once the member enters the name or an email - Refactored DS naming for consistency. Nowhere else in the codebase 'DS' name is ever used, made this consistent - Added missing validations in members form - Simplified if conditions in the member list template. When using the if/esle statements unnecessary new-line symbols were inserted which made it hard to test. Also by using computed property view is much cleaner - Updated member's model default value for `subscribed` to "true". It is turned on by default in the model layer on the backend (ref: https://github.com/TryGhost/Ghost/blob/3.1.0/core/server/data/schema/schema.js#L330), this behavior is intended and should be the same on the frontend
60 lines
2.3 KiB
Handlebars
60 lines
2.3 KiB
Handlebars
<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>
|
||
{{#link-to "members" data-test-link="members-back"}}Members{{/link-to}}
|
||
<span>{{svg-jar "arrow-right"}}</span>
|
||
{{#if member.name}}
|
||
{{member.name}}
|
||
{{else}}
|
||
{{member.email}}
|
||
{{/if}}
|
||
</h2>
|
||
<section class="view-actions">
|
||
{{gh-task-button type="button" task=save class="gh-btn gh-btn-blue gh-btn-icon" data-test-button="save"}}
|
||
</section>
|
||
</GhCanvasHeader>
|
||
<div class="flex items-center mb10 bt b--lightgrey-d1 pt8">
|
||
<GhMemberAvatar @member={{member}} @sizeClass={{if member.name 'f-subheadline fw4 lh-zero tracked-1' 'f-headline fw4 lh-zero tracked-1'}} class="w18 h18 mr4" />
|
||
<div>
|
||
<h3 class="f2 fw5 ma0 pa0">
|
||
{{or member.name member.email}}
|
||
</h3>
|
||
<p class="f6 pa0 ma0 midlightgrey-d1">
|
||
{{#if (and member.name member.email)}}
|
||
<span class="darkgrey fw5">{{member.email}}</span> –
|
||
{{/if}}
|
||
Created on {{this.subscribedAt}}
|
||
</p>
|
||
</div>
|
||
</div>
|
||
{{gh-member-settings-form member=member
|
||
setProperty=(action "setProperty")
|
||
isLoading=this.isLoading
|
||
showDeleteTagModal=(action "toggleDeleteMemberModal")}}
|
||
</form>
|
||
|
||
<button
|
||
type="button"
|
||
class="gh-btn gh-btn-red gh-btn-icon mt3"
|
||
{{action (toggle "showDeleteMemberModal" this)}}
|
||
data-test-button="delete-member"
|
||
>
|
||
<span>Delete member</span>
|
||
</button>
|
||
</section>
|
||
|
||
{{#if showUnsavedChangesModal}}
|
||
{{gh-fullscreen-modal "leave-settings"
|
||
confirm=(action "leaveScreen")
|
||
close=(action "toggleUnsavedChangesModal")
|
||
modifier="action wide"}}
|
||
{{/if}}
|
||
|
||
{{#if showDeleteMemberModal}}
|
||
{{gh-fullscreen-modal "delete-member"
|
||
model=(hash member=member onSuccess=(action "finaliseDeletion"))
|
||
close=(action (toggle "showDeleteMemberModal" this))
|
||
modifier="action wide"}}
|
||
{{/if}}
|