From 81290d7f180d84f7c198dc799dfbc80b0236d205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 15 Jun 2015 18:53:53 +0200 Subject: [PATCH 1/3] UX: sort staff members by username --- app/models/about.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/about.rb b/app/models/about.rb index dedf9a0ea..34fb8eadf 100644 --- a/app/models/about.rb +++ b/app/models/about.rb @@ -27,11 +27,13 @@ class About def moderators @moderators ||= User.where(moderator: true, admin: false) .where.not(id: Discourse::SYSTEM_USER_ID) + .order(:username_lower) end def admins @admins ||= User.where(admin: true) .where.not(id: Discourse::SYSTEM_USER_ID) + .order(:username_lower) end def stats From 76a14cd279252083d531d7a5de9b22e764a91453 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Mon, 15 Jun 2015 13:16:23 -0400 Subject: [PATCH 2/3] FIX: user visit stats on admin dashboard should show sum of values for 7 day and 30 day columns --- app/assets/javascripts/admin/templates/dashboard.hbs | 2 +- app/models/report.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/admin/templates/dashboard.hbs b/app/assets/javascripts/admin/templates/dashboard.hbs index 32ce15f9c..1d4dcf674 100644 --- a/app/assets/javascripts/admin/templates/dashboard.hbs +++ b/app/assets/javascripts/admin/templates/dashboard.hbs @@ -54,7 +54,7 @@ {{#unless loading}} - {{admin-report-per-day-counts report=visits}} + {{admin-report-counts report=visits}} {{admin-report-counts report=signups}} {{admin-report-counts report=topics}} {{admin-report-counts report=posts}} diff --git a/app/models/report.rb b/app/models/report.rb index 37df62e23..76f5952d5 100644 --- a/app/models/report.rb +++ b/app/models/report.rb @@ -76,6 +76,7 @@ class Report def self.report_visits(report) basic_report_about report, UserVisit, :by_day, report.start_date, report.end_date + add_counts report, UserVisit, 'visited_at' end def self.report_signups(report) From 357d4e3dd3e68210f8dade35946670e1facecb84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 15 Jun 2015 23:44:39 +0200 Subject: [PATCH 3/3] FIX: support for more than 1 emojis in the title --- app/assets/javascripts/discourse/models/topic.js.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/models/topic.js.es6 b/app/assets/javascripts/discourse/models/topic.js.es6 index 189db8720..60b40fe63 100644 --- a/app/assets/javascripts/discourse/models/topic.js.es6 +++ b/app/assets/javascripts/discourse/models/topic.js.es6 @@ -9,7 +9,7 @@ const Topic = RestModel.extend({ let title = this.get("fancy_title"); if (Discourse.SiteSettings.enable_emoji && title.indexOf(":") >= 0) { - title = title.replace(/:\S+:?/, function(m) { + title = title.replace(/:\S+:?/g, function(m) { const emoji = Discourse.Emoji.translations[m] ? Discourse.Emoji.translations[m] : m.slice(1, m.length - 1), url = Discourse.Emoji.urlFor(emoji); return url ? "" + emoji + "" : m;