From e1adf28081ef5e106d46aabea74422c28109ba7b Mon Sep 17 00:00:00 2001 From: Stella Rouzi Date: Tue, 13 Feb 2018 16:11:52 +0200 Subject: [PATCH] Show charts for survey replies --- Gemfile | 1 + Gemfile.lock | 2 ++ app/assets/javascripts/application.js | 1 - app/views/admin/conferences/index.html.haml | 1 + app/views/admin/conferences/show.html.haml | 2 ++ app/views/admin/events/index.html.haml | 2 ++ app/views/admin/physical_tickets/index.html.haml | 2 ++ app/views/admin/registrations/index.html.haml | 2 ++ app/views/admin/surveys/_survey_question_body.html.haml | 0 config/initializers/assets.rb | 1 + 10 files changed, 13 insertions(+), 1 deletion(-) delete mode 100644 app/views/admin/surveys/_survey_question_body.html.haml diff --git a/Gemfile b/Gemfile index c95902d6..142ff1ef 100644 --- a/Gemfile +++ b/Gemfile @@ -125,6 +125,7 @@ gem 'jquery-datatables-rails', '~> 2.2.1' # for charts gem 'chart-js-rails' +gem 'chartkick' # for displaying maps gem 'leaflet-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 831909b1..b37b09d8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -113,6 +113,7 @@ GEM fastimage chart-js-rails (0.0.6) railties (> 3.1) + chartkick (2.2.5) chronic (0.10.2) chunky_png (1.3.8) climate_control (0.2.0) @@ -590,6 +591,7 @@ DEPENDENCIES carrierwave carrierwave-bombshelter chart-js-rails + chartkick climate_control cloudinary cocoon diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 34bd66a7..a3a9ecc1 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -20,7 +20,6 @@ //= require dataTables/bootstrap/3/jquery.dataTables.bootstrap //= require cocoon //= require bootstrap -//= require Chart //= require osem //= require osem-dashboard //= require ahoy diff --git a/app/views/admin/conferences/index.html.haml b/app/views/admin/conferences/index.html.haml index 2fde1575..b81cfa26 100644 --- a/app/views/admin/conferences/index.html.haml +++ b/app/views/admin/conferences/index.html.haml @@ -1,3 +1,4 @@ += javascript_include_tag 'Chart' .row .col-sm-3.col-xs-3 .dashbox.text-center diff --git a/app/views/admin/conferences/show.html.haml b/app/views/admin/conferences/show.html.haml index ca59d8d9..ad4cef31 100644 --- a/app/views/admin/conferences/show.html.haml +++ b/app/views/admin/conferences/show.html.haml @@ -1,3 +1,5 @@ += javascript_include_tag 'Chart' + %h1 %span.fa.fa-tachometer Dashboard for #{@conference.title} diff --git a/app/views/admin/events/index.html.haml b/app/views/admin/events/index.html.haml index 3e3f2e7a..f06c6483 100644 --- a/app/views/admin/events/index.html.haml +++ b/app/views/admin/events/index.html.haml @@ -1,3 +1,5 @@ += javascript_include_tag 'Chart' + .row .col-md-12 .page-header diff --git a/app/views/admin/physical_tickets/index.html.haml b/app/views/admin/physical_tickets/index.html.haml index 0d71efe2..cdc372fe 100644 --- a/app/views/admin/physical_tickets/index.html.haml +++ b/app/views/admin/physical_tickets/index.html.haml @@ -1,3 +1,5 @@ += javascript_include_tag 'Chart' + .container .row .col-md-12.page-header diff --git a/app/views/admin/registrations/index.html.haml b/app/views/admin/registrations/index.html.haml index 8e5528bf..f82c660c 100644 --- a/app/views/admin/registrations/index.html.haml +++ b/app/views/admin/registrations/index.html.haml @@ -1,3 +1,5 @@ += javascript_include_tag 'Chart' + .row .col-md-12 .page-header diff --git a/app/views/admin/surveys/_survey_question_body.html.haml b/app/views/admin/surveys/_survey_question_body.html.haml deleted file mode 100644 index e69de29b..00000000 diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 01ef3e66..ea148d49 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -9,3 +9,4 @@ Rails.application.config.assets.version = '1.0' # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # Rails.application.config.assets.precompile += %w( search.js ) +Rails.application.config.assets.precompile += %w( Chart.js )