mirror of
https://github.com/discourse/discourse.git
synced 2025-03-22 18:15:30 +08:00
FEATURE: alows to add a description link to a report (#9065)
This commit adds a description link to users_per_trust_level report linking to our blog article on the subject https://blog.discourse.org/2018/06/understanding-discourse-trust-levels/
This commit is contained in:
parent
c11e5eb042
commit
11425f8adc
@ -21,6 +21,8 @@ const Report = EmberObject.extend({
|
|||||||
average: false,
|
average: false,
|
||||||
percent: false,
|
percent: false,
|
||||||
higher_is_better: true,
|
higher_is_better: true,
|
||||||
|
description_link: null,
|
||||||
|
description: null,
|
||||||
|
|
||||||
@discourseComputed("type", "start_date", "end_date")
|
@discourseComputed("type", "start_date", "end_date")
|
||||||
reportUrl(type, start_date, end_date) {
|
reportUrl(type, start_date, end_date) {
|
||||||
|
@ -23,9 +23,15 @@
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
{{#if model.description}}
|
{{#if model.description}}
|
||||||
<span class="info" data-tooltip="{{model.description}}">
|
{{#if model.description_link}}
|
||||||
{{d-icon "question-circle"}}
|
<a target="_blank" rel="noopener" href="{{model.description_link}}" class="info" data-tooltip="{{model.description}}">
|
||||||
</span>
|
{{d-icon "question-circle"}}
|
||||||
|
</a>
|
||||||
|
{{else}}
|
||||||
|
<span class="info" data-tooltip="{{model.description}}">
|
||||||
|
{{d-icon "question-circle"}}
|
||||||
|
</span>
|
||||||
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</li>
|
</li>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
@ -11,11 +11,13 @@ class Admin::ReportsController < Admin::AdminController
|
|||||||
reports = reports_methods.map do |name|
|
reports = reports_methods.map do |name|
|
||||||
type = name.to_s.gsub('report_', '')
|
type = name.to_s.gsub('report_', '')
|
||||||
description = I18n.t("reports.#{type}.description", default: '')
|
description = I18n.t("reports.#{type}.description", default: '')
|
||||||
|
description_link = I18n.t("reports.#{type}.description_link", default: '')
|
||||||
|
|
||||||
{
|
{
|
||||||
type: type,
|
type: type,
|
||||||
title: I18n.t("reports.#{type}.title"),
|
title: I18n.t("reports.#{type}.title"),
|
||||||
description: description.presence ? description : nil,
|
description: description.presence ? description : nil,
|
||||||
|
description_link: description_link.presence ? description_link : nil
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -99,12 +99,15 @@ class Report
|
|||||||
|
|
||||||
def as_json(options = nil)
|
def as_json(options = nil)
|
||||||
description = I18n.t("reports.#{type}.description", default: "")
|
description = I18n.t("reports.#{type}.description", default: "")
|
||||||
|
description_link = I18n.t("reports.#{type}.description_link", default: "")
|
||||||
|
|
||||||
{
|
{
|
||||||
type: type,
|
type: type,
|
||||||
title: I18n.t("reports.#{type}.title", default: nil),
|
title: I18n.t("reports.#{type}.title", default: nil),
|
||||||
xaxis: I18n.t("reports.#{type}.xaxis", default: nil),
|
xaxis: I18n.t("reports.#{type}.xaxis", default: nil),
|
||||||
yaxis: I18n.t("reports.#{type}.yaxis", default: nil),
|
yaxis: I18n.t("reports.#{type}.yaxis", default: nil),
|
||||||
description: description.presence ? description : nil,
|
description: description.presence ? description : nil,
|
||||||
|
description_link: description_link.presence ? description_link : nil,
|
||||||
data: data,
|
data: data,
|
||||||
start_date: start_date&.iso8601,
|
start_date: start_date&.iso8601,
|
||||||
end_date: end_date&.iso8601,
|
end_date: end_date&.iso8601,
|
||||||
|
@ -1175,6 +1175,7 @@ en:
|
|||||||
labels:
|
labels:
|
||||||
level: Level
|
level: Level
|
||||||
description: "Number of users grouped by trust level."
|
description: "Number of users grouped by trust level."
|
||||||
|
description_link: "https://blog.discourse.org/2018/06/understanding-discourse-trust-levels/"
|
||||||
users_by_type:
|
users_by_type:
|
||||||
title: "Users per Type"
|
title: "Users per Type"
|
||||||
xaxis: "Type"
|
xaxis: "Type"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user