- @page_title = t('workarea.admin.dashboards.marketing.marketing_dashboards') .view .view__header .view__heading = link_to "↑ #{t('workarea.admin.dashboards.main_dashboard')}", root_path %h1= t('workarea.admin.dashboards.marketing.marketing') .view__container %ul.secondary-nav %li= link_to t('workarea.admin.dashboards.marketing.discounts'), pricing_discounts_path %li= link_to t('workarea.admin.dashboards.marketing.promo_codes'), pricing_discount_code_lists_path %li= link_to t('workarea.admin.dashboards.marketing.transactional_emails'), content_emails_path %li= link_to t('workarea.admin.dashboards.marketing.email_signups'), email_signups_path = append_partials('admin.marketing_dashboard_navigation') .view__container .dashboard-graphs .browsing-controls.browsing-controls--center.browsing-controls--filters-displayed = form_tag request.path, method: 'get', class: 'browsing-controls__form' do = render 'workarea/admin/shared/date_selector', starts_at: @dashboard.starts_at, ends_at: @dashboard.ends_at .grid.grid--huge .grid__cell.grid__cell--33 .dashboard-graphs__box .dashboard-graphs__info %h6.heading.heading--no-margin= t('workarea.admin.dashboards.marketing.discounts') = link_to sales_over_time_report_path(starts_at: @dashboard.starts_at.to_s(:date_only), ends_at: @dashboard.ends_at.to_s(:date_only), group_by: 'day'), class: 'heading heading--1 heading--no-margin' do = number_to_currency @dashboard.discounts - if @dashboard.discounts_percent_change.present? %p = insights_trend_icon(@dashboard.discounts_percent_change) = t('workarea.admin.dashboards.marketing.from_previous', percentage: insights_number_to_percentage(@dashboard.discounts_percent_change)) .dashboard-graphs__chart= area_chart @dashboard.discounts_graph_data, Workarea.config.default_chartkick_options .grid__cell.grid__cell--33 .dashboard-graphs__box .dashboard-graphs__info %h6.heading.heading--no-margin= t('workarea.admin.dashboards.marketing.referrers_by_revenue') = link_to sales_by_traffic_referrer_report_path(starts_at: @dashboard.starts_at.to_s(:date_only), ends_at: @dashboard.ends_at.to_s(:date_only)), class: 'heading heading--1 heading--no-margin' do = t('workarea.admin.dashboards.marketing.days', count: ((@dashboard.ends_at - @dashboard.starts_at) / 1.day).ceil) .dashboard-graphs__chart= column_chart @dashboard.traffic_referrer_graph_data, Workarea.config.default_chartkick_options.merge(prefix: Money.default_currency.symbol) .grid__cell.grid__cell--33 .dashboard-graphs__box .dashboard-graphs__info %h6.heading.heading--no-margin= t('workarea.admin.dashboards.marketing.email_signups') = link_to email_signups_path, class: 'heading heading--1 heading--no-margin' do = number_with_delimiter @dashboard.email_signups - if @dashboard.email_signups_percent_change.present? %p = insights_trend_icon(@dashboard.email_signups_percent_change) = t('workarea.admin.dashboards.marketing.from_previous', percentage: insights_number_to_percentage(@dashboard.email_signups_percent_change)) .dashboard-graphs__chart= area_chart @dashboard.email_signups_graph_data, Workarea.config.default_chartkick_options .view__container.view__container--narrow .section - @dashboard.insights.each do |insight| = render "workarea/admin/insights/#{insight.slug}", insight: insight