mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 08:18:18 +08:00
FIX: better handling of no prev30Days (#6301)
This commit is contained in:
parent
f01169d6ff
commit
c08dea386b
|
@ -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";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -16,5 +16,9 @@
|
|||
</div>
|
||||
|
||||
<div class="cell value thirty-days-count {{model.thirtyDaysTrend}}" title={{model.thirtyDaysCountTitle}}>
|
||||
{{number model.lastThirtyDaysCount}} {{d-icon model.thirtyDaysTrendIcon}}
|
||||
{{number model.lastThirtyDaysCount}}
|
||||
|
||||
{{#if model.prev30Days}}
|
||||
{{d-icon model.thirtyDaysTrendIcon}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
|
@ -59,6 +59,9 @@
|
|||
|
||||
&.no-change {
|
||||
color: $primary-medium;
|
||||
i {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.value {
|
||||
|
|
|
@ -34,6 +34,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
&.no-change {
|
||||
i {
|
||||
color: $primary-medium;
|
||||
font-size: $font-down-3;
|
||||
}
|
||||
}
|
||||
|
||||
&.high-trending-up,
|
||||
&.trending-up {
|
||||
i {
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user