Ghost/ghost/admin/app/templates/members.hbs
Kevin Ansfield 7d997d5c2d Fixed member count after deleting a member
no issue

- the member count is automatically calculated via the length of the live members array so there's no need to manually decrement it - if we do manually decrement then the count is off by one because the auto calculation runs to get the new value before the manual decrement
2019-12-13 11:38:37 +00:00

93 lines
4.2 KiB
Handlebars

<section class="gh-canvas">
<GhCanvasHeader class="gh-canvas-header members-header">
<h2 class="gh-canvas-title" data-test-screen-title>Members</h2>
<section class="view-actions">
<span class="dropdown">
<GhDropdownButton
@dropdownName="members-actions-menu"
@classNames="gh-btn gh-btn-white gh-btn-icon only-has-icon gh-actions-cog"
@title="Members Actions"
@data-test-user-actions="true"
>
<span>
{{svg-jar "settings"}}
<span class="hidden">Members Actions</span>
</span>
</GhDropdownButton>
<GhDropdown
@name="members-actions-menu"
@tagName="ul"
@classNames="gh-member-actions-menu dropdown-menu dropdown-triangle-top-right"
>
<li>
<LinkTo @route="members.import" class="mr2" data-test-link="import-csv">
<span>Import CSV</span>
</LinkTo>
</li>
<li>
<a href="#" {{action 'exportData'}} class="mr2">
<span>Export CSV</span>
</a>
</li>
</GhDropdown>
</span>
<div class="relative gh-members-header-search">
{{svg-jar "search" class="gh-input-search-icon"}}
<GhTextInput
placeholder="Search members..."
@value={{this.searchText}}
@input={{action (mut this.searchText) value="target.value"}}
class="gh-members-list-searchfield {{if this.searchText "active"}}" />
</div>
<LinkTo @route="member.new" class="gh-btn gh-btn-green" data-test-new-member-button="true"><span>New member</span></LinkTo>
</section>
</GhCanvasHeader>
<section class="view-container">
<section class="content-list">
<ol class="members-list gh-list {{unless this.filteredMembers "no-posts"}}">
{{#if this.filteredMembers}}
<li class="gh-list-row header">
<div class="gh-list-header">
{{#if this.searchText}}
Search result
{{else}}
{{#if this.fetchMembers.lastSuccessful}}
{{pluralize this.members.length "member"}}
{{else}}
Loading...
{{/if}}
{{/if}}
</div>
<div class="gh-list-header gh-list-cellwidth-20 nowrap">Created</div>
<div class="gh-list-header gh-list-cellwidth-chevron"></div>
</li>
<VerticalCollection @items={{this.filteredMembers}} @key="id" @containerSelector=".gh-main" @estimateHeight=60 @bufferSize=20 as |member|>
<GhMembersListItem @member={{member}} @data-test-member-id={{member.id}} />
</VerticalCollection>
{{else}}
{{#if this.fetchMembers.isRunning}}
<div class="gh-content">
<GhLoadingSpinner />
</div>
{{else}}
<li class="no-posts-box">
<div class="no-posts">
{{svg-jar "members-placeholder" class="gh-members-placeholder"}}
{{#if this.searchText}}
<h3>No members found!</h3>
{{else}}
<h3>No members yet</h3>
<GhMembersNoMembers />
{{/if}}
</div>
</li>
{{/if}}
{{/if}}
</ol>
</section>
</section>
</section>
{{outlet}}