diff --git a/Pearlception/Gemfile b/Pearlception/Gemfile index 882f710..9db7abe 100644 --- a/Pearlception/Gemfile +++ b/Pearlception/Gemfile @@ -38,6 +38,8 @@ gem 'bcrypt', '~> 3.1.7' gem 'devise' #for pagination gem 'kaminari' +#for popovers and tooltips +gem 'bootstrap-popover-rails' group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console diff --git a/Pearlception/Gemfile.lock b/Pearlception/Gemfile.lock index e375e40..e1dd0bc 100644 --- a/Pearlception/Gemfile.lock +++ b/Pearlception/Gemfile.lock @@ -47,6 +47,7 @@ GEM bcrypt (3.1.11) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) + bootstrap-popover-rails (0.1.0) builder (3.2.2) byebug (9.0.6) coderay (1.1.1) @@ -206,6 +207,7 @@ PLATFORMS DEPENDENCIES awesome_rails_console bcrypt (~> 3.1.7) + bootstrap-popover-rails byebug coffee-rails (~> 4.2) devise diff --git a/Pearlception/app/assets/javascripts/application.js b/Pearlception/app/assets/javascripts/application.js index 159326e..fe47c91 100644 --- a/Pearlception/app/assets/javascripts/application.js +++ b/Pearlception/app/assets/javascripts/application.js @@ -13,3 +13,5 @@ //= require jquery //= require jquery_ujs //= require turbolinks +//= require bootstrap/bootstrap-rails-tooltip +//= require bootstrap/bootstrap-rails-popover diff --git a/Pearlception/app/assets/javascripts/oysters.coffee b/Pearlception/app/assets/javascripts/oysters.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/Pearlception/app/assets/javascripts/oysters.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/Pearlception/app/assets/javascripts/oysters.js b/Pearlception/app/assets/javascripts/oysters.js new file mode 100644 index 0000000..7208817 --- /dev/null +++ b/Pearlception/app/assets/javascripts/oysters.js @@ -0,0 +1,3 @@ +$(function () { + $('[data-toggle="popover"]').popover(); +}) diff --git a/Pearlception/app/assets/stylesheets/application.css b/Pearlception/app/assets/stylesheets/application.css index 0ebd7fe..a75d597 100644 --- a/Pearlception/app/assets/stylesheets/application.css +++ b/Pearlception/app/assets/stylesheets/application.css @@ -12,4 +12,6 @@ * *= require_tree . *= require_self + *= require bootstrap/bootstrap-rails-tooltip + *= require bootstrap/bootstrap-rails-popover */ diff --git a/Pearlception/app/assets/stylesheets/oysters.scss b/Pearlception/app/assets/stylesheets/oysters.scss new file mode 100644 index 0000000..fd42caa --- /dev/null +++ b/Pearlception/app/assets/stylesheets/oysters.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Oysters controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/Pearlception/app/controllers/oysters_controller.rb b/Pearlception/app/controllers/oysters_controller.rb new file mode 100644 index 0000000..a62305a --- /dev/null +++ b/Pearlception/app/controllers/oysters_controller.rb @@ -0,0 +1,10 @@ +class OystersController < ApplicationController + def show + end + + def index + @oysters = Oyster.where(:run_id => params[:result_id]) + @oysters_count = @oysters.count + @oysters = @oysters.page(params[:page]).per(5) + end +end diff --git a/Pearlception/app/helpers/oysters_helper.rb b/Pearlception/app/helpers/oysters_helper.rb new file mode 100644 index 0000000..9b44a08 --- /dev/null +++ b/Pearlception/app/helpers/oysters_helper.rb @@ -0,0 +1,2 @@ +module OystersHelper +end diff --git a/Pearlception/app/models/oyster.rb b/Pearlception/app/models/oyster.rb index 3514394..cfe3ccb 100644 --- a/Pearlception/app/models/oyster.rb +++ b/Pearlception/app/models/oyster.rb @@ -8,4 +8,5 @@ class Oyster < ApplicationRecord :password => ENV['STATS_DB_PASS'], :database => "main" ) + scope :run_id, -> (id) { where run_id: id.to_i } end diff --git a/Pearlception/app/views/dashboard/index.html.erb b/Pearlception/app/views/dashboard/index.html.erb index accc7ef..150e22e 100644 --- a/Pearlception/app/views/dashboard/index.html.erb +++ b/Pearlception/app/views/dashboard/index.html.erb @@ -89,127 +89,138 @@ <% else %>
| Company | - <% end %> -Run Date | -Location | -Harvest Time | -Supplier | -Distributor | -Total Processed | -Other | -
|---|---|---|---|---|---|---|---|
| - <%= #company.company_name - "Fake Industries" %> - | - - -- <%= run.runDate %> - | - - -- <%= run.location ? run.location : "" %> - | - - -- <%= "" %> - | - - -- - <%= run.supplier ? run.supplier : "" %> - | - - -- <%= run.distributor ? run.distributor : "" %> - | - - -- <%= result.total %> - | - - -- <%= run.other ? run.other : "" %> - | - <% end %> -
| - <%= run.runDate %> - | - - -- <%= run.location ? run.location : "" %> - | - - -- <%= "" %> - | - - -- - <%= run.supplier ? run.supplier : "" %> - | - - -- <%= run.distributor ? run.distributor : "" %> - | - - -- <%= result.total %> - | - - -- <%= run.other ? run.other : "" %> - | - <% end %> -