2022-04-01 18:05:26 +03:00
|
|
|
<div class="gh-main-section gh-newsletters">
|
|
|
|
<div class="flex justify-between items-center">
|
|
|
|
<h4 class="gh-main-section-header small bn">Newsletters</h4>
|
|
|
|
{{#if this.archivedNewsletters}}
|
|
|
|
<div>
|
2022-04-06 15:18:07 +03:00
|
|
|
<div>
|
|
|
|
<PowerSelect
|
|
|
|
@selected={{this.statusFilter}}
|
|
|
|
@options={{this.statusFilters}}
|
2022-04-01 18:05:26 +03:00
|
|
|
@searchEnabled={{false}}
|
2022-04-06 15:18:07 +03:00
|
|
|
@onChange={{this.changeStatusFilter}}
|
2022-04-01 18:05:26 +03:00
|
|
|
@triggerComponent="gh-power-select/trigger"
|
2022-04-18 12:57:23 +03:00
|
|
|
@triggerClass="gh-dropdown-archived ember-power-select-inline"
|
2022-04-01 18:05:26 +03:00
|
|
|
@dropdownClass="gh-contentfilter-menu-dropdown"
|
2022-04-20 13:06:05 +03:00
|
|
|
@horizontalPosition="right"
|
2022-04-01 18:05:26 +03:00
|
|
|
@matchTriggerWidth={{false}}
|
2022-04-06 15:18:07 +03:00
|
|
|
as |status|
|
2022-04-01 18:05:26 +03:00
|
|
|
>
|
2022-04-06 15:18:07 +03:00
|
|
|
{{titleize status}}
|
|
|
|
</PowerSelect>
|
2022-04-01 18:05:26 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
<section class="gh-expandable">
|
|
|
|
<div class="gh-expandable-block">
|
2022-04-04 21:26:49 +03:00
|
|
|
{{#if this.loadNewslettersTask.isRunning}}
|
|
|
|
<div class="gh-main-content">... loading</div>
|
|
|
|
{{else}}
|
2022-04-18 12:57:23 +03:00
|
|
|
{{#unless this.displayingDefault}}
|
2022-04-18 13:11:51 +03:00
|
|
|
{{#if (eq this.statusFilter "archived")}}
|
2022-04-18 12:57:23 +03:00
|
|
|
<h4 class="gh-expandable-title">Archived newsletters</h4>
|
2022-04-20 11:14:17 +03:00
|
|
|
<p class="gh-expandable-description">The newsletters below are no longer visible to members.</p>
|
2022-04-18 12:57:23 +03:00
|
|
|
{{else}}
|
|
|
|
<h4 class="gh-expandable-title">Active newsletters</h4>
|
2022-04-19 14:31:16 +03:00
|
|
|
<p class="gh-expandable-description">Drag to set the order viewed by members on your site.</p>
|
2022-04-18 12:57:23 +03:00
|
|
|
{{/if}}
|
|
|
|
{{/unless}}
|
2022-04-07 18:42:43 +03:00
|
|
|
<SortableObjects
|
|
|
|
@sortableObjectList={{this.filteredNewsletters}}
|
|
|
|
@useSwap={{false}}
|
|
|
|
@sortEndAction={{perform this.reorderNewslettersTask}}
|
|
|
|
>
|
|
|
|
{{#each this.filteredNewsletters as |newsletter|}}
|
|
|
|
<DraggableObject
|
2022-04-07 19:04:08 +03:00
|
|
|
class="gh-main-content-card gh-newsletter-card {{if (and (eq newsletter.status "active") (not this.displayingDefault)) "gh-newsletter-card-draggable"}} {{unless this.displayingDefault "multiple"}}"
|
2022-04-07 18:42:43 +03:00
|
|
|
@content={{newsletter}}
|
|
|
|
@dragHandle=".grab-newsletter"
|
|
|
|
@isSortable={{true}}
|
|
|
|
>
|
|
|
|
{{svg-jar "grab" class="grab-newsletter"}}
|
|
|
|
|
2022-04-19 14:31:16 +03:00
|
|
|
{{#if this.displayingDefault}}
|
|
|
|
<div class="gh-newsletter-card-block title-block">
|
|
|
|
<h3 class="gh-newsletter-card-name">
|
|
|
|
{{newsletter.name}}
|
|
|
|
</h3>
|
|
|
|
<p class="gh-newsletter-card-description">
|
|
|
|
{{newsletter.description}}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
{{else}}
|
|
|
|
<LinkTo @route="settings.members-email-labs.edit-newsletter" @model={{newsletter.id}} class="gh-newsletter-card-block title-block">
|
|
|
|
<h3 class="gh-newsletter-card-name">
|
|
|
|
{{newsletter.name}}
|
|
|
|
</h3>
|
|
|
|
<p class="gh-newsletter-card-description">
|
|
|
|
{{newsletter.description}}
|
|
|
|
</p>
|
|
|
|
</LinkTo>
|
|
|
|
{{/if}}
|
2022-04-07 18:42:43 +03:00
|
|
|
<div class="gh-newsletter-card-block stats-block {{unless this.displayingDefault "multiple"}}">
|
|
|
|
<div>
|
|
|
|
<h3 class="gh-newsletter-card-name">{{newsletter.members.total}}</h3>
|
|
|
|
<p class="gh-newsletter-card-description">Subscribers</p>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<h3 class="gh-newsletter-card-name">{{newsletter.posts.total}}</h3>
|
|
|
|
<p class="gh-newsletter-card-description">Posts sent</p>
|
|
|
|
</div>
|
2022-04-01 18:05:26 +03:00
|
|
|
</div>
|
2022-04-07 18:42:43 +03:00
|
|
|
<div class="gh-newsletter-card-block cta-block">
|
|
|
|
{{#if this.displayingDefault}}
|
|
|
|
<LinkTo @route="settings.members-email-labs.edit-newsletter" @model={{newsletter.id}} class="gh-btn gh-btn-green"><span>Customize →</span></LinkTo>
|
|
|
|
{{else}}
|
2022-04-20 13:06:05 +03:00
|
|
|
<GhBasicDropdown @verticalPosition="below" @horizontalPosition="right" @renderInPlace={{true}} as |dd|>
|
2022-04-20 12:50:01 +03:00
|
|
|
<dd.Trigger class="gh-btn gh-btn-action-icon gh-btn-icon gh-btn-outline gh-product-card-actions-button icon-only">
|
2022-04-07 18:42:43 +03:00
|
|
|
<span>
|
|
|
|
{{svg-jar "dotdotdot"}}
|
|
|
|
<span class="hidden">Actions</span>
|
|
|
|
</span>
|
2022-04-20 12:50:01 +03:00
|
|
|
</dd.Trigger>
|
|
|
|
<dd.Content class="relative-dropdown-menu gh-newsletter-actions-menu">
|
|
|
|
<ul class="dropdown-menu dropdown-triangle-top-right" role="listbox" {{css-transition "anim-fade-in-scale"}}>
|
2022-04-07 18:42:43 +03:00
|
|
|
<li>
|
2022-04-20 12:50:01 +03:00
|
|
|
<LinkTo @route="settings.members-email-labs.edit-newsletter" @model={{newsletter.id}} class="mr2"><span>Edit</span></LinkTo>
|
2022-04-07 18:42:43 +03:00
|
|
|
</li>
|
2022-04-20 12:50:01 +03:00
|
|
|
{{#if (eq newsletter.status "active")}}
|
|
|
|
<li>
|
2022-04-20 13:08:48 +03:00
|
|
|
<button class="mr2" type="button" {{on "click" (fn this.archiveNewsletter newsletter)}}>
|
2022-04-20 12:50:01 +03:00
|
|
|
<span>Archive</span>
|
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
{{/if}}
|
|
|
|
{{#if (eq newsletter.status "archived")}}
|
|
|
|
<li>
|
|
|
|
<button class="mr2" type="button" {{on "click" (perform this.unarchiveNewsletterTask newsletter)}}>
|
|
|
|
<span>Reactivate</span>
|
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
{{/if}}
|
|
|
|
</ul>
|
|
|
|
</dd.Content>
|
|
|
|
</GhBasicDropdown>
|
2022-04-07 18:42:43 +03:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</DraggableObject>
|
|
|
|
{{else}}
|
|
|
|
<div class="gh-main-content">No newsletters found</div>
|
|
|
|
{{/each}}
|
|
|
|
</SortableObjects>
|
2022-04-04 21:26:49 +03:00
|
|
|
{{/if}}
|
2022-04-01 18:05:26 +03:00
|
|
|
</div>
|
|
|
|
</section>
|
2022-04-04 21:26:49 +03:00
|
|
|
<LinkTo @route="settings.members-email-labs.new-newsletter" class="gh-add-newsletter">{{svg-jar "add-stroke"}}Add newsletter</LinkTo>
|
2022-04-01 18:05:26 +03:00
|
|
|
</div>
|