Ghost-Admin/app/components/dashboard/v5/chart-anchor.hbs

52 lines
2.3 KiB
Handlebars

<div class="gh-dashboard5-stats" {{did-insert this.loadCharts}}>
<button class="gh-dashboard5-stats-button {{if this.chartShowingTotal 'is-selected'}}" type="button" {{on "click" (fn this.changeChartDisplay "total")}}>
<Dashboard::v5::parts::ChartMetric
@label={{gh-pluralize this.totalMembers "Total member" without-count=true}}
@value={{format-number this.totalMembers}}
@trends={{this.hasTrends}}
@percentage={{this.totalMembersTrend}}
@large={{true}} />
<div class="gh-dashboard5-stats-highlight"></div>
</button>
{{#if this.hasPaidTiers}}
<button class="gh-dashboard5-stats-button {{if this.chartShowingMonthly 'is-selected'}}" type="button" {{on "click" (fn this.changeChartDisplay "monthly")}}>
<Dashboard::v5::parts::ChartMetric
@label={{gh-pluralize this.paidMembers "Paid member" without-count=true}}
@value={{format-number this.paidMembers}}
@trends={{this.hasTrends}}
@percentage={{this.paidMembersTrend}}
@large={{true}} />
<div class="gh-dashboard5-stats-highlight"></div>
</button>
<button class="gh-dashboard5-stats-button {{if this.chartShowingPaid 'is-selected'}}" type="button" {{on "click" (fn this.changeChartDisplay "paid")}}>
<Dashboard::v5::parts::ChartMetric
@label="Monthly revenue (MRR)"
@value="${{gh-price-amount this.currentMRR}}"
@trends={{this.hasTrends}}
@percentage={{this.mrrTrend}}
@large={{true}} />
<div class="gh-dashboard5-stats-highlight"></div>
</button>
{{/if}}
</div>
<div class="gh-dashboard5-chart">
{{#if this.loading}}
<div class="gh-dashboard5-chart-loading" style={{html-safe (concat "height: " this.chartHeight "px;")}}/>
{{else}}
<div class="gh-dashboard5-chart-ticks">
<span>1,000</span>
<span>750</span>
<span>500</span>
<span>250</span>
</div>
<div class="gh-dashboard5-chart-container">
<EmberChart
@type={{this.chartType}}
@data={{this.chartData}}
@options={{this.chartOptions}}
@height={{this.chartHeight}} />
</div>
{{/if}}
</div>