2019-01-24 22:34:32 +03:00
|
|
|
<section class="gh-canvas">
|
2021-02-12 16:29:44 +03:00
|
|
|
<GhCanvasHeader class="gh-canvas-header break tablet members-header">
|
2019-01-24 22:34:32 +03:00
|
|
|
<h2 class="gh-canvas-title" data-test-screen-title>Members</h2>
|
2019-10-03 13:56:31 +03:00
|
|
|
<section class="view-actions">
|
2021-02-12 16:29:44 +03:00
|
|
|
<div class="view-actions-bottom-row">
|
2021-07-23 17:05:22 +03:00
|
|
|
{{#unless (feature "membersFiltering")}}
|
2021-02-12 16:29:44 +03:00
|
|
|
<GhMembersFilter
|
2021-08-06 19:47:26 +03:00
|
|
|
@selectedLabel={{this.selectedLabel}}
|
|
|
|
@availableLabels={{this.availableLabels}}
|
|
|
|
@onLabelChange={{this.changeLabel}}
|
|
|
|
@onLabelAdd={{this.addLabel}}
|
|
|
|
@onLabelEdit={{this.editLabel}}
|
|
|
|
@selectedPaidParam={{this.selectedPaidParam}}
|
|
|
|
@availablePaidParams={{this.paidParams}}
|
|
|
|
@onPaidParamChange={{this.changePaidParam}}
|
|
|
|
@availableOrders={{this.availableOrders}}
|
|
|
|
@selectedOrder={{this.selectedOrder}}
|
|
|
|
@onOrderChange={{this.changeOrder}}
|
2021-02-12 16:29:44 +03:00
|
|
|
/>
|
2021-07-23 17:05:22 +03:00
|
|
|
{{/unless}}
|
2021-02-12 16:29:44 +03:00
|
|
|
<div class="relative gh-members-header-search">
|
|
|
|
{{svg-jar "search" class="gh-input-search-icon"}}
|
|
|
|
<GhTextInput
|
|
|
|
placeholder="Search members..."
|
|
|
|
@value={{this.searchText}}
|
|
|
|
@input={{this.search}}
|
|
|
|
class="gh-members-list-searchfield {{if this.searchText "active"}}" />
|
|
|
|
</div>
|
2020-02-14 12:34:01 +03:00
|
|
|
</div>
|
2020-05-22 14:47:03 +03:00
|
|
|
|
2021-02-12 16:29:44 +03:00
|
|
|
<div class="view-actions-top-row">
|
2021-07-23 17:05:22 +03:00
|
|
|
{{#if (feature "membersFiltering")}}
|
2021-08-06 19:47:26 +03:00
|
|
|
<GhMembersFilterLabs
|
2021-08-05 16:52:16 +03:00
|
|
|
@onApplyFilter={{this.applyFilter}}
|
2021-08-12 15:21:18 +03:00
|
|
|
@onLabelEdit={{this.editLabel}}
|
2021-07-23 17:05:22 +03:00
|
|
|
/>
|
|
|
|
{{/if}}
|
2021-02-12 16:29:44 +03:00
|
|
|
<span class="dropdown">
|
2021-04-08 14:06:27 +03:00
|
|
|
<GhDropdownButton
|
|
|
|
@dropdownName="members-actions-menu"
|
2021-07-23 17:05:22 +03:00
|
|
|
@classNames="gh-btn gh-btn-icon icon-only gh-btn-action-icon"
|
2021-04-08 14:06:27 +03:00
|
|
|
@title="Members Actions"
|
|
|
|
data-test-button="members-actions"
|
|
|
|
>
|
2021-02-12 16:29:44 +03:00
|
|
|
<span>
|
|
|
|
{{svg-jar "settings"}}
|
|
|
|
<span class="hidden">Actions</span>
|
|
|
|
</span>
|
|
|
|
</GhDropdownButton>
|
2021-04-08 14:06:27 +03:00
|
|
|
<GhDropdown
|
|
|
|
@name="members-actions-menu"
|
|
|
|
@tagName="ul"
|
|
|
|
@classNames="gh-member-actions-menu dropdown-menu dropdown-triangle-top-right"
|
|
|
|
>
|
2021-02-12 16:29:44 +03:00
|
|
|
<li>
|
|
|
|
<LinkTo @route="members.import" class="mr2" data-test-link="import-csv">
|
|
|
|
<span>Import members</span>
|
|
|
|
</LinkTo>
|
|
|
|
</li>
|
|
|
|
<li class="{{if this.members.length "" "disabled"}}">
|
|
|
|
{{#if this.members.length}}
|
|
|
|
<button class="mr2" {{on "click" this.exportData}}>
|
|
|
|
{{#if this.showingAll}}
|
|
|
|
<span>Export all members</span>
|
|
|
|
{{else}}
|
|
|
|
<span>Export selected members ({{this.members.length}})</span>
|
|
|
|
{{/if}}
|
|
|
|
</button>
|
|
|
|
{{else}}
|
|
|
|
<button class="mr2" disabled="true">
|
|
|
|
<span>Export selected members (0)</span>
|
|
|
|
</button>
|
|
|
|
{{/if}}
|
|
|
|
</li>
|
2021-04-08 14:06:27 +03:00
|
|
|
{{#if (and this.members.length this.isFiltered)}}
|
2021-08-13 14:41:34 +03:00
|
|
|
{{#if (feature "membersFiltering")}}
|
|
|
|
<li>
|
|
|
|
<button class="mr2" {{on "click" this.toggleAddMembersLabelModal}} data-test-button="add-label-selected">
|
|
|
|
<span>Add label for selected members ({{this.members.length}})</span>
|
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<button class="mr2" {{on "click" this.toggleRemoveMembersLabelModal}} data-test-button="remove-label-selected">
|
|
|
|
<span>Remove label for selected members ({{this.members.length}})</span>
|
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<button class="mr2" {{on "click" this.toggleUnsubscribeMembersModal}} data-test-button="remove-label-selected">
|
|
|
|
<span>Unsubscribe selected members ({{this.members.length}})</span>
|
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
{{/if}}
|
2021-04-08 14:06:27 +03:00
|
|
|
<li>
|
|
|
|
<button class="mr2" {{on "click" this.toggleDeleteMembersModal}} data-test-button="delete-selected">
|
|
|
|
<span class="red">Delete selected members ({{this.members.length}})</span>
|
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
{{/if}}
|
2021-02-12 16:29:44 +03:00
|
|
|
</GhDropdown>
|
|
|
|
</span>
|
|
|
|
<LinkTo @route="member.new" class="gh-btn gh-btn-primary" data-test-new-member-button="true"><span>New member</span></LinkTo>
|
|
|
|
</div>
|
2019-10-03 13:56:31 +03:00
|
|
|
</section>
|
2019-06-18 13:47:21 +03:00
|
|
|
</GhCanvasHeader>
|
2020-05-20 18:39:06 +03:00
|
|
|
|
2020-05-22 14:47:03 +03:00
|
|
|
{{#unless this.members.loading}}
|
2020-04-21 11:12:17 +03:00
|
|
|
<section class="view-container">
|
2021-07-22 16:47:01 +03:00
|
|
|
{{#if (feature "membersFiltering")}}
|
2021-08-10 15:11:22 +03:00
|
|
|
<div class="gh-list-scrolling">
|
|
|
|
<table class="gh-list">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>{{this.listHeader}}</th>
|
|
|
|
<th>Open rate</th>
|
|
|
|
<th>Location</th>
|
|
|
|
<th>Created</th>
|
|
|
|
{{#each this.filterColumnLabels as |filterColumn|}}
|
|
|
|
<th>{{filterColumn}}</th>
|
|
|
|
{{/each}}
|
|
|
|
{{!-- <th>Open rate</th>
|
|
|
|
<th>Location</th>
|
|
|
|
<th>Created</th>
|
|
|
|
<th>Open rate</th>
|
|
|
|
<th>Location</th>
|
|
|
|
<th>Created</th> --}}
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<VerticalCollection @tagName="tbody" @items={{this.members}} @key="id" @containerSelector=".gh-main" @estimateHeight={{69}} @staticHeight={{true}} @bufferSize={{20}} as |member|>
|
|
|
|
<GhMembersListItemLabs
|
|
|
|
@member={{member}}
|
|
|
|
@filterColumns={{this.filterColumns}}
|
|
|
|
data-test-member={{member.id}}
|
|
|
|
/>
|
|
|
|
</VerticalCollection>
|
|
|
|
</table>
|
|
|
|
</div>
|
2021-07-22 16:47:01 +03:00
|
|
|
{{else}}
|
2021-02-08 23:16:41 +03:00
|
|
|
<section class="content-list">
|
2020-05-20 18:39:06 +03:00
|
|
|
<ol class="members-list gh-list {{unless this.members "no-posts"}}">
|
|
|
|
{{#if this.members}}
|
2020-06-18 13:05:03 +03:00
|
|
|
<li class="gh-list-row header relative">
|
2020-06-19 20:14:14 +03:00
|
|
|
<div class="gh-list-header" data-test-list-header>{{this.listHeader}}</div>
|
2020-12-08 22:23:57 +03:00
|
|
|
{{#if (feature "emailAnalytics")}}
|
|
|
|
<div class="gh-list-header gh-members-list-open-rate nowrap">Open rate</div>
|
|
|
|
{{/if}}
|
|
|
|
<div class="gh-list-header gh-members-list-geolocation nowrap">Location</div>
|
|
|
|
<div class="gh-list-header gh-members-list-subscribed-at nowrap">Created</div>
|
2020-07-23 16:56:49 +03:00
|
|
|
<div class="gh-list-header gh-members-list-chevron gh-list-cellwidth-chevron"></div>
|
2020-04-21 11:12:17 +03:00
|
|
|
</li>
|
2020-05-21 12:00:14 +03:00
|
|
|
<VerticalCollection @items={{this.members}} @key="id" @containerSelector=".gh-main" @estimateHeight={{69}} @staticHeight={{true}} @bufferSize={{20}} as |member|>
|
2020-06-18 13:05:03 +03:00
|
|
|
<GhMembersListItem
|
|
|
|
@member={{member}}
|
2021-07-09 00:44:52 +03:00
|
|
|
data-test-member={{member.id}}
|
2020-06-18 13:05:03 +03:00
|
|
|
/>
|
2020-02-14 12:34:01 +03:00
|
|
|
</VerticalCollection>
|
2019-10-02 06:59:47 +03:00
|
|
|
{{else}}
|
2020-06-19 20:14:14 +03:00
|
|
|
<li class="no-posts-box" data-test-no-members>
|
2019-10-03 13:56:31 +03:00
|
|
|
<div class="no-posts">
|
|
|
|
{{svg-jar "members-placeholder" class="gh-members-placeholder"}}
|
2020-02-14 12:34:01 +03:00
|
|
|
{{#if this.showingAll}}
|
2019-12-03 08:04:04 +03:00
|
|
|
<h3>No members yet</h3>
|
2020-06-05 10:49:56 +03:00
|
|
|
<GhMembersNoMembers @afterCreate={{this.refreshData}} />
|
2020-02-14 12:34:01 +03:00
|
|
|
{{else}}
|
|
|
|
<h3>No members match the current filter</h3>
|
2019-10-03 13:56:31 +03:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</li>
|
2019-10-02 06:59:47 +03:00
|
|
|
{{/if}}
|
2020-04-21 11:12:17 +03:00
|
|
|
</ol>
|
|
|
|
</section>
|
2021-07-22 16:47:01 +03:00
|
|
|
{{/if}}
|
2019-10-03 13:56:31 +03:00
|
|
|
</section>
|
2020-05-20 18:39:06 +03:00
|
|
|
{{else}}
|
|
|
|
<div class="gh-content">
|
|
|
|
<GhLoadingSpinner />
|
|
|
|
</div>
|
2020-05-22 14:47:03 +03:00
|
|
|
{{/unless}}
|
2019-10-04 12:33:10 +03:00
|
|
|
</section>
|
2019-12-12 16:35:52 +03:00
|
|
|
|
2020-02-14 12:34:01 +03:00
|
|
|
{{outlet}}
|
|
|
|
|
2021-08-13 14:41:34 +03:00
|
|
|
{{#if this.showAddMembersLabelModal}}
|
|
|
|
<GhFullscreenModal
|
|
|
|
@modal="add-label-members"
|
|
|
|
@model={{hash memberCount=this.members.length}}
|
|
|
|
@confirm={{this.addLabelToMembers}}
|
|
|
|
@close={{this.toggleAddMembersLabelModal}}
|
|
|
|
@modifier="action wide"
|
|
|
|
/>
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{#if this.showRemoveMembersLabelModal}}
|
|
|
|
<GhFullscreenModal
|
|
|
|
@modal="remove-label-members"
|
|
|
|
@model={{hash memberCount=this.members.length}}
|
|
|
|
@confirm={{this.removeLabelFromMembers}}
|
|
|
|
@close={{this.toggleRemoveMembersLabelModal}}
|
|
|
|
@modifier="action wide"
|
|
|
|
/>
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{#if this.showUnsubscribeMembersModal}}
|
|
|
|
<GhFullscreenModal
|
|
|
|
@modal="unsubscribe-members"
|
|
|
|
@model={{hash memberCount=this.members.length}}
|
|
|
|
@confirm={{this.unsubscribeMembers}}
|
|
|
|
@close={{this.toggleUnsubscribeMembersModal}}
|
|
|
|
@modifier="action wide"
|
|
|
|
/>
|
|
|
|
{{/if}}
|
|
|
|
|
2020-06-19 16:14:39 +03:00
|
|
|
{{#if this.showDeleteMembersModal}}
|
|
|
|
<GhFullscreenModal
|
|
|
|
@modal="delete-members"
|
2020-07-23 16:56:49 +03:00
|
|
|
@model={{hash memberCount=this.members.length}}
|
2020-06-19 16:14:39 +03:00
|
|
|
@confirm={{this.deleteMembers}}
|
|
|
|
@close={{this.toggleDeleteMembersModal}}
|
|
|
|
@modifier="action wide"
|
|
|
|
/>
|
|
|
|
{{/if}}
|
|
|
|
|
2020-02-14 12:34:01 +03:00
|
|
|
{{#if this.showLabelModal}}
|
|
|
|
<GhFullscreenModal
|
|
|
|
@modal="members-label-form"
|
|
|
|
@model={{this.labelModalData}}
|
2020-05-20 16:55:41 +03:00
|
|
|
@close={{this.toggleLabelModal}}
|
2020-02-14 12:34:01 +03:00
|
|
|
@modifier="action wide"
|
|
|
|
/>
|
2021-08-04 09:50:34 +03:00
|
|
|
{{/if}}
|