puffer 0.0.3 → 0.0.4
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.
- data/Gemfile +1 -4
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/app/views/puffer/index.html.erb +7 -7
- data/app/views/puffer/show.html.erb +3 -3
- data/lib/generators/puffer/install/install_generator.rb +9 -0
- data/lib/generators/puffer/install/templates/puffer/javascripts/application.js +2 -0
- data/lib/generators/puffer/install/templates/puffer/javascripts/controls.js +965 -0
- data/lib/generators/puffer/install/templates/puffer/javascripts/dragdrop.js +974 -0
- data/lib/generators/puffer/install/templates/puffer/javascripts/effects.js +1123 -0
- data/lib/generators/puffer/install/templates/puffer/javascripts/prototype.js +6001 -0
- data/lib/generators/puffer/install/templates/puffer/javascripts/rails.js +175 -0
- data/lib/generators/puffer/install/templates/puffer.rb +0 -0
- data/lib/puffer/base.rb +1 -1
- data/lib/puffer/controller/dsl.rb +9 -10
- data/lib/puffer/controller/helpers.rb +1 -9
- data/lib/puffer/controller/mutate.rb +0 -4
- data/lib/puffer/fields/field.rb +58 -0
- data/lib/puffer/fields.rb +17 -0
- data/lib/puffer/resource/scoping.rb +6 -0
- data/lib/puffer/resource.rb +5 -5
- data/puffer.gemspec +17 -8
- data/spec/dummy/app/controllers/admin/categories_controller.rb +10 -0
- data/spec/dummy/app/controllers/admin/posts_controller.rb +12 -0
- data/spec/dummy/app/controllers/admin/profiles_controller.rb +14 -0
- data/spec/dummy/app/controllers/admin/tags_controller.rb +8 -0
- data/spec/lib/fields_spec.rb +54 -0
- data/spec/lib/params_spec.rb +1 -1
- data/spec/lib/resource_spec.rb +37 -3
- data/spec/spec_helper.rb +2 -1
- metadata +30 -19
- 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.
|
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
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<% @title = current_resource.
|
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.
|
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.
|
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.
|
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
|
-
<%
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|