diff --git a/app/assets/javascripts/admin/models/report.js.es6 b/app/assets/javascripts/admin/models/report.js.es6 index 24b2b1ab3e5..70cfd7c2514 100644 --- a/app/assets/javascripts/admin/models/report.js.es6 +++ b/app/assets/javascripts/admin/models/report.js.es6 @@ -439,7 +439,7 @@ const Report = Discourse.Model.extend({ case "high-trending-down": return higherIsBetter ? "angle-double-down" : "angle-double-up"; default: - return null; + return "minus"; } } }); diff --git a/app/assets/javascripts/admin/templates/components/admin-report-counters.hbs b/app/assets/javascripts/admin/templates/components/admin-report-counters.hbs index 605119360c6..9f3882a3b49 100644 --- a/app/assets/javascripts/admin/templates/components/admin-report-counters.hbs +++ b/app/assets/javascripts/admin/templates/components/admin-report-counters.hbs @@ -16,5 +16,9 @@
- {{number model.lastThirtyDaysCount}} {{d-icon model.thirtyDaysTrendIcon}} + {{number model.lastThirtyDaysCount}} + + {{#if model.prev30Days}} + {{d-icon model.thirtyDaysTrendIcon}} + {{/if}}
diff --git a/app/assets/stylesheets/common/admin/admin_report.scss b/app/assets/stylesheets/common/admin/admin_report.scss index 9bed7a769d5..d0a8b3ce089 100644 --- a/app/assets/stylesheets/common/admin/admin_report.scss +++ b/app/assets/stylesheets/common/admin/admin_report.scss @@ -59,6 +59,9 @@ &.no-change { color: $primary-medium; + i { + display: none; + } } .value { diff --git a/app/assets/stylesheets/common/admin/admin_report_counters.scss b/app/assets/stylesheets/common/admin/admin_report_counters.scss index 74f2f64be21..a984cee8183 100644 --- a/app/assets/stylesheets/common/admin/admin_report_counters.scss +++ b/app/assets/stylesheets/common/admin/admin_report_counters.scss @@ -34,6 +34,13 @@ } } + &.no-change { + i { + color: $primary-medium; + font-size: $font-down-3; + } + } + &.high-trending-up, &.trending-up { i { diff --git a/app/models/report.rb b/app/models/report.rb index 8e5e797d240..454f52bf03d 100644 --- a/app/models/report.rb +++ b/app/models/report.rb @@ -217,8 +217,9 @@ class Report report.icon = 'user' basic_report_about report, UserVisit, :by_day, report.start_date, report.end_date, report.group_id - add_counts report, UserVisit, 'visited_at' + + report.prev30Days = UserVisit.where(mobile: true).where("visited_at >= ? and visited_at < ?", report.start_date - 30.days, report.start_date).count end def self.report_mobile_visits(report)