best_boy 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/README.md +3 -1
 - data/app/controllers/best_boy/events_controller.rb +1 -47
 - data/app/views/best_boy/events/monthly_details.html.erb +0 -13
 - data/app/views/layouts/best_boy/best_boy.html.erb +1 -2
 - data/config/routes.rb +1 -2
 - data/lib/best_boy.rb +0 -1
 - data/lib/best_boy/version.rb +1 -1
 - metadata +4 -19
 - data/app/views/best_boy/events/charts.html.erb +0 -33
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: '038bc7a714f4480b375ca6e33d188654b6a5cd5c'
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 7f9fc59aab7775c415de1ecf36900e5862c8f697
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 2af5962f5d32ab6334ce2bf7b77651015ede4e746350d29d62f48fd2c4aab15bdcdd1aaf46831d7a4a4611f379e9155ba3c48104d13c54678b739d97c0a7e056
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: e616b58f2b2b87ad0596674be65c382f32087c54d23bd91bb18d37218c6446978b02b8a4bec862b410de894f11aa22801a8d71bbd7eb0851eabb0d7ff9424fa7
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -136,6 +136,9 @@ Changelog 
     | 
|
| 
       136 
136 
     | 
    
         
             
            ---------
         
     | 
| 
       137 
137 
     | 
    
         
             
            #### HEAD (not released yet)
         
     | 
| 
       138 
138 
     | 
    
         | 
| 
      
 139 
     | 
    
         
            +
            #### 3.3.0
         
     | 
| 
      
 140 
     | 
    
         
            +
            * Remove google_visualizr charts
         
     | 
| 
      
 141 
     | 
    
         
            +
             
     | 
| 
       139 
142 
     | 
    
         
             
            #### 3.2.0
         
     | 
| 
       140 
143 
     | 
    
         
             
            * Fix date-parsing issue
         
     | 
| 
       141 
144 
     | 
    
         
             
            * Add frozen_string_literal magic comments
         
     | 
| 
         @@ -190,7 +193,6 @@ Used gems and resources 
     | 
|
| 
       190 
193 
     | 
    
         
             
            -----------------------
         
     | 
| 
       191 
194 
     | 
    
         
             
            * [Twitter Bootstrap](http://twitter.github.com/bootstrap/) in its version 3
         
     | 
| 
       192 
195 
     | 
    
         
             
            * [Stefan Petre](http://www.eyecon.ro/bootstrap-datepicker) for Datepicker in Twitter Bootstrap style
         
     | 
| 
       193 
     | 
    
         
            -
            * [Winston Teo Yong Wei](https://github.com/winston/google_visualr) Google_Visualr in its version 2.1.2
         
     | 
| 
       194 
196 
     | 
    
         | 
| 
       195 
197 
     | 
    
         | 
| 
       196 
198 
     | 
    
         
             
            Contributors in alphabetic order
         
     | 
| 
         @@ -13,7 +13,7 @@ module BestBoy 
     | 
|
| 
       13 
13 
     | 
    
         
             
                helper BestBoy::BestBoyViewHelper
         
     | 
| 
       14 
14 
     | 
    
         
             
                helper_method :available_owner_types, :available_events, :available_event_sources, :available_event_sources?, :available_years,
         
     | 
| 
       15 
15 
     | 
    
         
             
                              :current_owner_type, :current_event, :current_event_source, :current_month, :current_year, :collection,
         
     | 
| 
       16 
     | 
    
         
            -
                              :days_of, : 
     | 
| 
      
 16 
     | 
    
         
            +
                              :days_of, :month_name_array, :detail_count
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
18 
     | 
    
         
             
                def stats
         
     | 
| 
       19 
19 
     | 
    
         
             
                  collect_occurrences
         
     | 
| 
         @@ -31,11 +31,6 @@ module BestBoy 
     | 
|
| 
       31 
31 
     | 
    
         | 
| 
       32 
32 
     | 
    
         
             
                def monthly_details
         
     | 
| 
       33 
33 
     | 
    
         
             
                  collect_occurrences_for_month current_month
         
     | 
| 
       34 
     | 
    
         
            -
                  monthly_details_chart
         
     | 
| 
       35 
     | 
    
         
            -
                end
         
     | 
| 
       36 
     | 
    
         
            -
             
     | 
| 
       37 
     | 
    
         
            -
                def charts
         
     | 
| 
       38 
     | 
    
         
            -
                  build_chart
         
     | 
| 
       39 
34 
     | 
    
         
             
                end
         
     | 
| 
       40 
35 
     | 
    
         | 
| 
       41 
36 
     | 
    
         
             
                private
         
     | 
| 
         @@ -142,40 +137,10 @@ module BestBoy 
     | 
|
| 
       142 
137 
     | 
    
         
             
                  (reference.beginning_of_month..reference.end_of_month)
         
     | 
| 
       143 
138 
     | 
    
         
             
                end
         
     | 
| 
       144 
139 
     | 
    
         | 
| 
       145 
     | 
    
         
            -
                def render_chart(chart, dom)
         
     | 
| 
       146 
     | 
    
         
            -
                  chart.to_js(dom).html_safe
         
     | 
| 
       147 
     | 
    
         
            -
                end
         
     | 
| 
       148 
     | 
    
         
            -
             
     | 
| 
       149 
     | 
    
         
            -
                def chart_for(data)
         
     | 
| 
       150 
     | 
    
         
            -
                  @chart = GoogleVisualr::Interactive::AreaChart.new(data, { width: 1100, height: 300, title: "" })
         
     | 
| 
       151 
     | 
    
         
            -
                end
         
     | 
| 
       152 
     | 
    
         
            -
             
     | 
| 
       153 
140 
     | 
    
         
             
                def row_values_for(day)
         
     | 
| 
       154 
141 
     | 
    
         
             
                  available_event_sources.collect{ |event_source| @selected_month_occurrences[event_source][day] } + [@selected_month_occurrences["All"][day]]
         
     | 
| 
       155 
142 
     | 
    
         
             
                end
         
     | 
| 
       156 
143 
     | 
    
         | 
| 
       157 
     | 
    
         
            -
                def monthly_details_chart
         
     | 
| 
       158 
     | 
    
         
            -
                  data_table = GoogleVisualr::DataTable.new
         
     | 
| 
       159 
     | 
    
         
            -
                  data_table.new_column('string', 'time')
         
     | 
| 
       160 
     | 
    
         
            -
             
     | 
| 
       161 
     | 
    
         
            -
                  labels = available_event_sources.to_a + ["All"]
         
     | 
| 
       162 
     | 
    
         
            -
                  labels.each { |label| data_table.new_column('number', label.to_s) }
         
     | 
| 
       163 
     | 
    
         
            -
             
     | 
| 
       164 
     | 
    
         
            -
                  days_of(params[:month]).each { |day| data_table.add_row( [day.strftime("%d")] + row_values_for(day) ) }
         
     | 
| 
       165 
     | 
    
         
            -
                  chart_for data_table
         
     | 
| 
       166 
     | 
    
         
            -
                end
         
     | 
| 
       167 
     | 
    
         
            -
             
     | 
| 
       168 
     | 
    
         
            -
                def build_chart
         
     | 
| 
       169 
     | 
    
         
            -
                  data_table = GoogleVisualr::DataTable.new
         
     | 
| 
       170 
     | 
    
         
            -
                  data_table.new_column('string', 'time')
         
     | 
| 
       171 
     | 
    
         
            -
                  data_table.new_column('number', current_owner_type.to_s)
         
     | 
| 
       172 
     | 
    
         
            -
             
     | 
| 
       173 
     | 
    
         
            -
                  time_periode_range.each do |periode|
         
     | 
| 
       174 
     | 
    
         
            -
                    data_table.add_row([chart_legend_time_name(periode), custom_data_count(current_event_source, calculated_point_in_time(periode))])
         
     | 
| 
       175 
     | 
    
         
            -
                  end
         
     | 
| 
       176 
     | 
    
         
            -
                  chart_for data_table
         
     | 
| 
       177 
     | 
    
         
            -
                end
         
     | 
| 
       178 
     | 
    
         
            -
             
     | 
| 
       179 
144 
     | 
    
         
             
                def week_name_array
         
     | 
| 
       180 
145 
     | 
    
         
             
                  %w(Mon Tue Wed Thu Fri Sat Sun)
         
     | 
| 
       181 
146 
     | 
    
         
             
                end
         
     | 
| 
         @@ -215,17 +180,6 @@ module BestBoy 
     | 
|
| 
       215 
180 
     | 
    
         
             
                  end
         
     | 
| 
       216 
181 
     | 
    
         
             
                end
         
     | 
| 
       217 
182 
     | 
    
         | 
| 
       218 
     | 
    
         
            -
                def chart_legend_time_name(periode)
         
     | 
| 
       219 
     | 
    
         
            -
                  case current_time_interval
         
     | 
| 
       220 
     | 
    
         
            -
                  when "year"
         
     | 
| 
       221 
     | 
    
         
            -
                    month_name_array[periode]
         
     | 
| 
       222 
     | 
    
         
            -
                  when "week"
         
     | 
| 
       223 
     | 
    
         
            -
                    week_name_array[periode]
         
     | 
| 
       224 
     | 
    
         
            -
                  else
         
     | 
| 
       225 
     | 
    
         
            -
                    (periode + 1).to_s
         
     | 
| 
       226 
     | 
    
         
            -
                  end
         
     | 
| 
       227 
     | 
    
         
            -
                end
         
     | 
| 
       228 
     | 
    
         
            -
             
     | 
| 
       229 
183 
     | 
    
         
             
                def current_date
         
     | 
| 
       230 
184 
     | 
    
         
             
                  @current_date ||= Date.strptime(params[:date], "%d-%m-%Y") if params[:date] rescue nil
         
     | 
| 
       231 
185 
     | 
    
         
             
                end
         
     | 
| 
         @@ -1,7 +1,3 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            <% content_for :javascripts do %>
         
     | 
| 
       2 
     | 
    
         
            -
              <%= javascript_include_tag "https://www.google.com/jsapi" %>
         
     | 
| 
       3 
     | 
    
         
            -
            <% end %>
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
1 
     | 
    
         
             
            <div class="row">
         
     | 
| 
       6 
2 
     | 
    
         
             
              <div class="col-md-12">
         
     | 
| 
       7 
3 
     | 
    
         
             
                <div class="well">
         
     | 
| 
         @@ -56,12 +52,3 @@ 
     | 
|
| 
       56 
52 
     | 
    
         
             
                </div>
         
     | 
| 
       57 
53 
     | 
    
         
             
              </div>
         
     | 
| 
       58 
54 
     | 
    
         
             
            </div>
         
     | 
| 
       59 
     | 
    
         
            -
             
     | 
| 
       60 
     | 
    
         
            -
            <div class="row">
         
     | 
| 
       61 
     | 
    
         
            -
              <div class="col-md-12">
         
     | 
| 
       62 
     | 
    
         
            -
                <div class="well">
         
     | 
| 
       63 
     | 
    
         
            -
                  <div id='chart'></div>
         
     | 
| 
       64 
     | 
    
         
            -
                  <%= render_chart @chart, 'chart' %>
         
     | 
| 
       65 
     | 
    
         
            -
                </div>
         
     | 
| 
       66 
     | 
    
         
            -
              </div>
         
     | 
| 
       67 
     | 
    
         
            -
            </div>
         
     | 
| 
         @@ -25,7 +25,6 @@ 
     | 
|
| 
       25 
25 
     | 
    
         
             
                      <ul class="nav navbar-nav">
         
     | 
| 
       26 
26 
     | 
    
         
             
                        <li class="<%= action_name == 'stats' ? 'active' : nil %>"><%= link_to "Statistics", stats_events_path %></li>
         
     | 
| 
       27 
27 
     | 
    
         
             
                        <li class="<%= action_name == 'lists' ? 'active' : nil %>"><%= link_to "List & Logs", lists_events_path %></li>
         
     | 
| 
       28 
     | 
    
         
            -
                        <li class="<%= action_name == 'charts' ? 'active' : nil %>"><%= link_to "Charts", charts_events_path %></li>
         
     | 
| 
       29 
28 
     | 
    
         
             
                      </ul>
         
     | 
| 
       30 
29 
     | 
    
         
             
                      <% if BestBoy.custom_redirect.present? %>
         
     | 
| 
       31 
30 
     | 
    
         
             
                      <ul class="nav navbar-nav navbar-right">
         
     | 
| 
         @@ -40,4 +39,4 @@ 
     | 
|
| 
       40 
39 
     | 
    
         
             
                  <%= yield %>
         
     | 
| 
       41 
40 
     | 
    
         
             
                </div>
         
     | 
| 
       42 
41 
     | 
    
         
             
              </body>
         
     | 
| 
       43 
     | 
    
         
            -
            </html>
         
     | 
| 
      
 42 
     | 
    
         
            +
            </html>
         
     | 
    
        data/config/routes.rb
    CHANGED
    
    
    
        data/lib/best_boy.rb
    CHANGED
    
    
    
        data/lib/best_boy/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: best_boy
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 3. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 3.3.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Christoph Seydel, Carsten Zimmermann, Robin Neumann, Daniel Schoppmann
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2017-01-18 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rails
         
     | 
| 
         @@ -44,20 +44,6 @@ dependencies: 
     | 
|
| 
       44 
44 
     | 
    
         
             
                - - ">="
         
     | 
| 
       45 
45 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       46 
46 
     | 
    
         
             
                    version: 0.14.1
         
     | 
| 
       47 
     | 
    
         
            -
            - !ruby/object:Gem::Dependency
         
     | 
| 
       48 
     | 
    
         
            -
              name: google_visualr
         
     | 
| 
       49 
     | 
    
         
            -
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       50 
     | 
    
         
            -
                requirements:
         
     | 
| 
       51 
     | 
    
         
            -
                - - ">="
         
     | 
| 
       52 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       53 
     | 
    
         
            -
                    version: '0'
         
     | 
| 
       54 
     | 
    
         
            -
              type: :runtime
         
     | 
| 
       55 
     | 
    
         
            -
              prerelease: false
         
     | 
| 
       56 
     | 
    
         
            -
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       57 
     | 
    
         
            -
                requirements:
         
     | 
| 
       58 
     | 
    
         
            -
                - - ">="
         
     | 
| 
       59 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       60 
     | 
    
         
            -
                    version: '0'
         
     | 
| 
       61 
47 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       62 
48 
     | 
    
         
             
              name: haml
         
     | 
| 
       63 
49 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -92,14 +78,14 @@ dependencies: 
     | 
|
| 
       92 
78 
     | 
    
         
             
                requirements:
         
     | 
| 
       93 
79 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       94 
80 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       95 
     | 
    
         
            -
                    version: 3.5.0 
     | 
| 
      
 81 
     | 
    
         
            +
                    version: 3.5.0
         
     | 
| 
       96 
82 
     | 
    
         
             
              type: :development
         
     | 
| 
       97 
83 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       98 
84 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       99 
85 
     | 
    
         
             
                requirements:
         
     | 
| 
       100 
86 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       101 
87 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       102 
     | 
    
         
            -
                    version: 3.5.0 
     | 
| 
      
 88 
     | 
    
         
            +
                    version: 3.5.0
         
     | 
| 
       103 
89 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       104 
90 
     | 
    
         
             
              name: shoulda
         
     | 
| 
       105 
91 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -160,7 +146,6 @@ files: 
     | 
|
| 
       160 
146 
     | 
    
         
             
            - app/models/best_boy/event.rb
         
     | 
| 
       161 
147 
     | 
    
         
             
            - app/models/best_boy/month_report.rb
         
     | 
| 
       162 
148 
     | 
    
         
             
            - app/views/best_boy/events/_navigation.html.erb
         
     | 
| 
       163 
     | 
    
         
            -
            - app/views/best_boy/events/charts.html.erb
         
     | 
| 
       164 
149 
     | 
    
         
             
            - app/views/best_boy/events/details.html.erb
         
     | 
| 
       165 
150 
     | 
    
         
             
            - app/views/best_boy/events/details.xml.haml
         
     | 
| 
       166 
151 
     | 
    
         
             
            - app/views/best_boy/events/index.html.erb
         
     | 
| 
         @@ -1,33 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            <% content_for :javascripts do %>
         
     | 
| 
       2 
     | 
    
         
            -
              <%= javascript_include_tag "https://www.google.com/jsapi" %>
         
     | 
| 
       3 
     | 
    
         
            -
            <% end %>
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
            <div class="row">
         
     | 
| 
       6 
     | 
    
         
            -
              <div class="col-md-12">
         
     | 
| 
       7 
     | 
    
         
            -
                <%= form_tag charts_events_path, method: :get, id: "chart-form" do %>
         
     | 
| 
       8 
     | 
    
         
            -
                  <div class="form-group">
         
     | 
| 
       9 
     | 
    
         
            -
                    <div class="col-md-3">
         
     | 
| 
       10 
     | 
    
         
            -
                      <%= select_tag :owner_type, options_for_select([["Owner", nil]] + available_owner_types, selected: params[:owner_type]), onchange: "submit();", class: "form-control" %>
         
     | 
| 
       11 
     | 
    
         
            -
                    </div>
         
     | 
| 
       12 
     | 
    
         
            -
                    <div class="col-md-3">
         
     | 
| 
       13 
     | 
    
         
            -
                      <%= select_tag :event, options_for_select([["Event", nil]] + available_events, selected: params[:event]), onchange: "submit();", class: "form-control" %>
         
     | 
| 
       14 
     | 
    
         
            -
                    </div>
         
     | 
| 
       15 
     | 
    
         
            -
                    <div class="col-md-3">
         
     | 
| 
       16 
     | 
    
         
            -
                      <%= select_tag :event_source, options_for_select([["Event Source", nil]] + available_event_sources, selected: params[:event_source]), onchange: "submit();", class: "form-control" %>
         
     | 
| 
       17 
     | 
    
         
            -
                    </div>
         
     | 
| 
       18 
     | 
    
         
            -
                    <div class="col-md-3">
         
     | 
| 
       19 
     | 
    
         
            -
                      <%= select_tag :time_interval, options_for_select([["Time Interval", nil], ["yearly", "year"], ["monthly", "month"], ["weekly", "week"]], selected: params[:time_interval]), onchange: "submit();", class: "form-control" %>
         
     | 
| 
       20 
     | 
    
         
            -
                    </div>
         
     | 
| 
       21 
     | 
    
         
            -
                  </div>
         
     | 
| 
       22 
     | 
    
         
            -
                <% end %>
         
     | 
| 
       23 
     | 
    
         
            -
              </div>
         
     | 
| 
       24 
     | 
    
         
            -
            </div>
         
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
            <div class="row">
         
     | 
| 
       27 
     | 
    
         
            -
              <div class="col-md-12">
         
     | 
| 
       28 
     | 
    
         
            -
                <div class="well">
         
     | 
| 
       29 
     | 
    
         
            -
                  <div id='chart'></div>
         
     | 
| 
       30 
     | 
    
         
            -
                  <%= render_chart(@chart, 'chart') %>
         
     | 
| 
       31 
     | 
    
         
            -
                </div>
         
     | 
| 
       32 
     | 
    
         
            -
              </div>
         
     | 
| 
       33 
     | 
    
         
            -
            </div>
         
     |