Skip to content

Business intelligence made simple

Show friendly names on dashboards

Andrew Kane361c54d50ac0
diff --git a/app/models/blazer/query.rb b/app/models/blazer/query.rb
index 9abce275..fab87b1b 100644
--- a/app/models/blazer/query.rb
+++ b/app/models/blazer/query.rb
@@ -9,5 +9,9 @@ module Blazer
def to_param
[id, name.gsub("'", "").parameterize].join("-")
end
+
+ def friendly_name
+ name.gsub(/\[.+\]/, "").strip
+ end
end
end
diff --git a/app/views/blazer/dashboards/show.html.erb b/app/views/blazer/dashboards/show.html.erb
index 9761e46a..a087a6b4 100644
--- a/app/views/blazer/dashboards/show.html.erb
+++ b/app/views/blazer/dashboards/show.html.erb
@@ -130,7 +130,7 @@
<% @queries.each_with_index do |query, i| %>
<div style="margin-top: 40px;">
- <h4 style="text-align: center;"><%= link_to query.name, query_path(query, variable_params), style: "color: inherit;" %></h4>
+ <h4 style="text-align: center;"><%= link_to query.friendly_name, query_path(query, variable_params), style: "color: inherit;" %></h4>
<div id="chart-<%= i %>" style="height: 300px; text-align: center; line-height: 300px;">Loading...</div>
</div>
<script>