best_boy 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ ## 0.3.1
2
+ * added precompilation flag to initializer. see Readme for update
3
+ * fixed compatibility with asset-pipeline precompilation
4
+
1
5
  ## 0.3.0
2
6
  * rails 3.2.x compatibility
3
7
  * refactored BestBoyEventsController
data/README.md CHANGED
@@ -57,6 +57,10 @@ Update to fit the asset-pipeline
57
57
 
58
58
  If you were using the gem without asset-pipeline and want to update your project to fit new rails versions, simply delete all best_boy files in your public folder.
59
59
 
60
+ If you need to precompile assets, maybe for deployment on heroku cedar stack, please add the following flag to your best_boy initializer.
61
+
62
+ config.precompile_assets = true
63
+
60
64
 
61
65
  Update from version 0.1.0
62
66
  -------------------------
@@ -109,6 +113,7 @@ BestBoy comes with an admin interface, largely configurable to fit right into yo
109
113
 
110
114
  Following configurations can be done:
111
115
 
116
+ config.precompile_assets "boolean" # default: false # if you need best_boy to precompile its assets for the asset-pipeline
112
117
  config.orm "symbole" # default: :active_record # for now only active_record is supported
113
118
  config.base_controller "String" # default: "ApplicationController" # declare with Controller should be inherited
114
119
  config.before_filter "comma separated symbols" # default: nil # declare before_filter to use inherited before_filters in admin section
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require best_boy/bootstrap_datepicker
@@ -0,0 +1,14 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require best_boy/bootstrap
13
+ *= require best_boy/bootstrap_datepicker
14
+ */
@@ -1778,7 +1778,7 @@ table .span24 {
1778
1778
  *margin-right: .3em;
1779
1779
  line-height: 14px;
1780
1780
  vertical-align: text-top;
1781
- background-image: image-url("glyphicons-halflings.png");
1781
+ background-image: image-url("best_boy/glyphicons-halflings.png");
1782
1782
  background-position: 14px 14px;
1783
1783
  background-repeat: no-repeat;
1784
1784
  }
@@ -1789,7 +1789,7 @@ table .span24 {
1789
1789
  }
1790
1790
 
1791
1791
  .icon-white {
1792
- background-image: image-url("glyphicons-halflings-white.png");
1792
+ background-image: image-url("best_boy/glyphicons-halflings-white.png");
1793
1793
  }
1794
1794
 
1795
1795
  .icon-glass {
@@ -1,5 +1,5 @@
1
1
  <% content_for :javascripts do %>
2
- <script src='https://www.google.com/jsapi'></script>
2
+ <%= javascript_include_tag "https://www.google.com/jsapi" %>
3
3
  <% end %>
4
4
 
5
5
  <%= form_tag best_boy_admin_charts_path, :method => :get, :id => "chart-form" do %>
@@ -1,9 +1,5 @@
1
- <% content_for :stylesheets do %>
2
- <%= stylesheet_link_tag "bootstrap_datepicker" %>
3
- <% end %>
4
1
  <% content_for :javascripts do %>
5
2
  <%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" %>
6
- <%= javascript_include_tag "bootstrap_datepicker" %>
7
3
  <script type="text/javascript">
8
4
  $(function(){$('#dp1').datepicker().on('changeDate', function(){$('#list-form').submit();})});
9
5
  </script>
@@ -1,5 +1,5 @@
1
1
  <% content_for :javascripts do %>
2
- <script src='https://www.google.com/jsapi'></script>
2
+ <%= javascript_include_tag "https://www.google.com/jsapi" %>
3
3
  <% end %>
4
4
 
5
5
  <div class="span12">
@@ -6,9 +6,19 @@
6
6
  <meta name="viewport" content="width=device-width">
7
7
  <title>BBAC - BestBoy Administration Center</title>
8
8
  <%= csrf_meta_tag %>
9
- <%= stylesheet_link_tag("bootstrap", :media => "all") %>
9
+
10
10
  <%= yield :stylesheets %>
11
11
  <%= yield :javascripts %>
12
+
13
+ <% if BestBoy.precompile_assets %>
14
+ <%= stylesheet_link_tag("best_boy/best_boy", :media => "all") %>
15
+ <%= javascript_include_tag "best_boy/best_boy" %>
16
+ <% else %>
17
+ <%= stylesheet_link_tag("bootstrap", :media => "all") %>
18
+ <%= stylesheet_link_tag("bootstrap_datepicker", :media => "all") %>
19
+ <%= javascript_include_tag "bootstrap_datepicker" %>
20
+ <% end %>
21
+
12
22
  <style>
13
23
  .small-font {
14
24
  font-size: 9px;
@@ -2,7 +2,10 @@ require "best_boy/engine.rb"
2
2
 
3
3
  module BestBoy
4
4
  # Define ORM
5
- mattr_accessor :orm, :base_controller, :before_filter, :skip_before_filter, :custom_redirect
5
+ mattr_accessor :precompile_assets, :orm, :base_controller, :before_filter,
6
+ :skip_before_filter, :custom_redirect
7
+
8
+ @@precompile_assets = false
6
9
  @@orm = :active_record
7
10
  @@base_controller = "ApplicationController"
8
11
  @@before_filter = nil
@@ -4,6 +4,15 @@ require "google_visualr"
4
4
 
5
5
  module BestBoy
6
6
  class Engine < Rails::Engine
7
+
8
+ initializer 'best_boy.assets', :group => :all do |app|
9
+ initializer_path = "#{Rails.root}/config/initializers/best_boy.rb"
10
+ require initializer_path if File.exist? initializer_path
11
+
12
+ if BestBoy.precompile_assets == true
13
+ Rails.application.config.assets.precompile += ['best_boy/best_boy.css', 'best_boy/best_boy.js']
14
+ end
15
+ end
7
16
 
8
17
  initializer 'best_boy.model' do |app|
9
18
  if BestBoy.orm == :active_record
@@ -13,6 +22,7 @@ module BestBoy
13
22
  else
14
23
  raise "Sorry, best_boy actually only supports ActiveRecord ORM."
15
24
  end
25
+
16
26
  end
17
27
 
18
28
  initializer 'best_boy.controller' do
@@ -1,3 +1,3 @@
1
1
  module BestBoy
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -1,5 +1,7 @@
1
- # Use this hook to configure impressionist parameters
2
1
  BestBoy.setup do |config|
2
+ # if you want to use the asset-pipeline, set precompile_assets to true (default: false)
3
+ # config.precompile_assets = true
4
+
3
5
  # Define ORM. Could be :active_record (default). Actually no other mapper is supported
4
6
  #config.orm = :active_record
5
7
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: best_boy
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.0
5
+ version: 0.3.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Christoph Seydel
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-07-20 00:00:00 +02:00
13
+ date: 2012-07-25 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -130,11 +130,13 @@ files:
130
130
  - LICENSE.txt
131
131
  - README.md
132
132
  - Rakefile
133
- - app/assets/images/glyphicons-halflings-white.png
134
- - app/assets/images/glyphicons-halflings.png
135
- - app/assets/javascripts/bootstrap_datepicker.js
136
- - app/assets/stylesheets/bootstrap.scss
137
- - app/assets/stylesheets/bootstrap_datepicker.css
133
+ - app/assets/images/best_boy/glyphicons-halflings-white.png
134
+ - app/assets/images/best_boy/glyphicons-halflings.png
135
+ - app/assets/javascripts/best_boy/best_boy.js
136
+ - app/assets/javascripts/best_boy/bootstrap_datepicker.js
137
+ - app/assets/stylesheets/best_boy/best_boy.css
138
+ - app/assets/stylesheets/best_boy/bootstrap.scss
139
+ - app/assets/stylesheets/best_boy/bootstrap_datepicker.css
138
140
  - app/controllers/best_boy/best_boy_events_controller.rb
139
141
  - app/views/best_boy/best_boy_events/_navigation.html.erb
140
142
  - app/views/best_boy/best_boy_events/charts.html.erb