puffer 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. data/Gemfile +1 -4
  2. data/Gemfile.lock +1 -1
  3. data/VERSION +1 -1
  4. data/app/views/puffer/index.html.erb +7 -7
  5. data/app/views/puffer/show.html.erb +3 -3
  6. data/lib/generators/puffer/install/install_generator.rb +9 -0
  7. data/lib/generators/puffer/install/templates/puffer/javascripts/application.js +2 -0
  8. data/lib/generators/puffer/install/templates/puffer/javascripts/controls.js +965 -0
  9. data/lib/generators/puffer/install/templates/puffer/javascripts/dragdrop.js +974 -0
  10. data/lib/generators/puffer/install/templates/puffer/javascripts/effects.js +1123 -0
  11. data/lib/generators/puffer/install/templates/puffer/javascripts/prototype.js +6001 -0
  12. data/lib/generators/puffer/install/templates/puffer/javascripts/rails.js +175 -0
  13. data/lib/generators/puffer/install/templates/puffer.rb +0 -0
  14. data/lib/puffer/base.rb +1 -1
  15. data/lib/puffer/controller/dsl.rb +9 -10
  16. data/lib/puffer/controller/helpers.rb +1 -9
  17. data/lib/puffer/controller/mutate.rb +0 -4
  18. data/lib/puffer/fields/field.rb +58 -0
  19. data/lib/puffer/fields.rb +17 -0
  20. data/lib/puffer/resource/scoping.rb +6 -0
  21. data/lib/puffer/resource.rb +5 -5
  22. data/puffer.gemspec +17 -8
  23. data/spec/dummy/app/controllers/admin/categories_controller.rb +10 -0
  24. data/spec/dummy/app/controllers/admin/posts_controller.rb +12 -0
  25. data/spec/dummy/app/controllers/admin/profiles_controller.rb +14 -0
  26. data/spec/dummy/app/controllers/admin/tags_controller.rb +8 -0
  27. data/spec/lib/fields_spec.rb +54 -0
  28. data/spec/lib/params_spec.rb +1 -1
  29. data/spec/lib/resource_spec.rb +37 -3
  30. data/spec/spec_helper.rb +2 -1
  31. metadata +30 -19
  32. data/lib/puffer/field.rb +0 -88
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  gem 'rails', '~> 3.0.3'
4
- gem 'will_paginate', '~> 3.0.beta'
4
+ gem 'will_paginate', '~> 3.0.pre2'
5
5
 
6
6
  group :development, :test do
7
7
  gem "capybara", ">= 0.4.0"
@@ -15,6 +15,3 @@ group :development, :test do
15
15
  gem "jeweler"
16
16
  end
17
17
 
18
- # To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
19
- # gem 'ruby-debug'
20
- # gem 'ruby-debug19'
data/Gemfile.lock CHANGED
@@ -127,4 +127,4 @@ DEPENDENCIES
127
127
  rails (~> 3.0.3)
128
128
  rspec-rails
129
129
  sqlite3-ruby
130
- will_paginate (~> 3.0.beta)
130
+ will_paginate (~> 3.0.pre2)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -1,4 +1,4 @@
1
- <% @title = current_resource.human_name %>
1
+ <% @title = current_resource.human %>
2
2
  <h1><%= @title %></h1>
3
3
  <% if respond_to? :will_paginate %>
4
4
  <%= will_paginate @records, :url => current_resource.index_path(:page => '') %>
@@ -7,7 +7,7 @@
7
7
  <div class="row">
8
8
  <div class="column left_column">
9
9
  <% if @records.empty? %>
10
- <p>Sorry, but there is no records in <%= current_resource.human_name %></p>
10
+ <p>Sorry, but there is no records in <%= current_resource.human %></p>
11
11
  <% else %>
12
12
  <table class="list_table">
13
13
  <thead>
@@ -30,9 +30,9 @@
30
30
  <%= link_to 'destroy', current_resource.path(record), :confirm => "Are you sure?", :method => :delete, :class => 'remove_entry' if current_config.destroy %>
31
31
  <% current_resource.children(:post_id => record.id).each do |child| %>
32
32
  <% if child.plural? %>
33
- <p><%= link_to "#{child.human_name}(#{child.collection.size})", child.index_path %></p>
33
+ <p><%= link_to "#{child.human}(#{child.collection.size})", child.index_path %></p>
34
34
  <% else %>
35
- <p><%= link_to "#{child.member ? 'Edit' : 'Add'} #{child.human_name}", child.index_path %></p>
35
+ <p><%= link_to "#{child.member ? 'Edit' : 'Add'} #{child.human}", child.index_path %></p>
36
36
  <% end %>
37
37
  <% end %>
38
38
  </td>
@@ -54,7 +54,7 @@
54
54
  <% end %>
55
55
  <% end %>
56
56
  </dd>
57
- <% boolean_fields.each do |field| %>
57
+ <% index_fields.boolean.each do |field| %>
58
58
  <dt><%= field.label %></dt>
59
59
  <dd>
60
60
  <ul>
@@ -75,9 +75,9 @@
75
75
  <% content_for :additional_navigation do %>
76
76
  <ul class="buttons">
77
77
  <% current_resource.ancestors.each do |resource| %>
78
- <%= link_to resource.plural? ? resource.human_name : resource.member.to_title, resource.index_path %>
78
+ <%= link_to resource.plural? ? resource.human : resource.member.to_title, resource.index_path %>
79
79
  <%= link_to resource.member.to_title, resource.path unless resource.plural? %>
80
80
  <% end %>
81
- <%= link_to current_resource.plural? ? current_resource.human_name : current_resource.member.to_title, current_resource.index_path %>
81
+ <%= link_to current_resource.plural? ? current_resource.human : current_resource.member.to_title, current_resource.index_path %>
82
82
  </ul>
83
83
  <% end %>
@@ -1,11 +1,11 @@
1
- <% @title = "Show #{current_resource.human_name}" %>
1
+ <% @title = "Show #{current_resource.human}" %>
2
2
  <h1><%= @title %></h1>
3
3
  <ul class="show_entry">
4
4
  <% if current_resource.children.present? %>
5
5
  <li>
6
6
  <h2>Associations</h2>
7
7
  <% current_resource.children.each do |child| %>
8
- <%= link_to child.human_name, child.index_path %>
8
+ <%= link_to child.human, child.index_path %>
9
9
  <% end %>
10
10
  </li>
11
11
  <% end %>
@@ -22,7 +22,7 @@
22
22
  <% content_for :additional_navigation do %>
23
23
  <ul class="buttons">
24
24
  <% (current_resource.ancestors + [current_resource]).each do |resource| %>
25
- <%= link_to resource.plural? ? resource.human_name : resource.member.to_title, resource.index_path %>
25
+ <%= link_to resource.plural? ? resource.human : resource.member.to_title, resource.index_path %>
26
26
  <%= link_to resource.member.to_title, resource.path unless resource.plural? %>
27
27
  <% end %>
28
28
  </ul>
@@ -1,3 +1,12 @@
1
1
  class Puffer::InstallGenerator < Rails::Generators::Base
2
2
  source_root File.expand_path('../templates', __FILE__)
3
+
4
+ def generate_files
5
+ directory 'puffer', 'public/puffer'
6
+ end
7
+
8
+ def generate_config
9
+ copy_file 'puffer.rb', 'config/puffer.rb'
10
+ end
11
+
3
12
  end
@@ -0,0 +1,2 @@
1
+ // Place your application-specific JavaScript functions and classes here
2
+ // This file is automatically included by javascript_include_tag :defaults