[Git][noosfero/noosfero][master] 2 commits: Merge branch 'graph-big-legends' into 'master-1.x'

Gabriel Silva gitlab at mg.gitlab.com
Thu May 10 17:15:15 BRT 2018


Gabriel Silva pushed to branch master at Noosfero / noosfero


Commits:
0cbda8cc by Gabriel Silva at 2018-05-10T13:34:49Z
Merge branch 'graph-big-legends' into 'master-1.x'

custom-forms: truncate big legends on graph

See merge request noosfero/noosfero!1457

(cherry picked from commit 35f6faa217bc0d0df9ad410882db62269450965c)

cf6794c7 custom-forms: truncate big legends on graph
- - - - -
9aa7568d by Gabriel Silva at 2018-05-10T20:15:11Z
Merge branch 'cherry-pick-35f6faa2' into 'master'

Merge branch 'graph-big-legends' into 'master-1.x'

See merge request noosfero/noosfero!1474
- - - - -


2 changed files:

- plugins/custom_forms/lib/custom_forms_plugin/graph.rb
- plugins/custom_forms/views/custom_forms_plugin_profile/_pizza.html.erb


Changes:

=====================================
plugins/custom_forms/lib/custom_forms_plugin/graph.rb
=====================================
--- a/plugins/custom_forms/lib/custom_forms_plugin/graph.rb
+++ b/plugins/custom_forms/lib/custom_forms_plugin/graph.rb
@@ -64,7 +64,9 @@ class CustomFormsPlugin::Graph
     end
 
     alternatives.map do |alternative|
-      answer_and_label.merge!({alternative.id.to_s => {alternative.label => 0}})
+      label = alternative.label
+      short_label = label.present? && label.length > 70 ? label[0..70] + '...' : label
+      answer_and_label.merge!({alternative.id.to_s => {short_label => 0}})
     end
     answer_and_label.merge!({ "show_as" => field.show_as,
                               "summary" => field.summary,


=====================================
plugins/custom_forms/views/custom_forms_plugin_profile/_pizza.html.erb
=====================================
--- a/plugins/custom_forms/views/custom_forms_plugin_profile/_pizza.html.erb
+++ b/plugins/custom_forms/views/custom_forms_plugin_profile/_pizza.html.erb
@@ -4,5 +4,5 @@
 
 <%= render partial: 'results_table', locals: { result: result } %>
 
-<%= pie_chart result["data"], donut: true, legend: 'left',
+<%= pie_chart result["data"], donut: true, legend: 'bottom',
               summary: (result['summary'] if current_person.try(:can_see_summary?, profile)) %>



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/4d49fecbb2c6ad7dcc7401ecea9c19e889c2a815...9aa7568dbb53d32c1fe5bdfb8d8979022351024c

-- 
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/4d49fecbb2c6ad7dcc7401ecea9c19e889c2a815...9aa7568dbb53d32c1fe5bdfb8d8979022351024c
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20180510/48240b14/attachment-0001.html>


More information about the Noosfero-dev mailing list