puffer_pages 0.0.17 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem 'rails', '>= 3.1.0.rc5'
3
+ gem 'rails', '~> 3.1.0'
4
4
  gem 'puffer', :git => 'git://github.com/puffer/puffer.git'
5
5
  gem 'liquid', :git => 'git://github.com/puffer/liquid.git'
6
6
  gem 'nested_set'
data/Gemfile.lock CHANGED
@@ -6,84 +6,84 @@ GIT
6
6
 
7
7
  GIT
8
8
  remote: git://github.com/puffer/puffer.git
9
- revision: 133a50608537404ea10584bcd0907907f4bc596a
9
+ revision: b3e74b6272b02edf6ccdc4dc3dc3476d85399fa4
10
10
  specs:
11
- puffer (0.0.23)
11
+ puffer (0.0.25)
12
12
  apotomo
13
13
  kaminari
14
- rails (>= 3.1.0.rc5)
14
+ rails (~> 3.1.0)
15
15
 
16
16
  GEM
17
17
  remote: http://rubygems.org/
18
18
  specs:
19
- actionmailer (3.1.0.rc5)
20
- actionpack (= 3.1.0.rc5)
19
+ actionmailer (3.1.0)
20
+ actionpack (= 3.1.0)
21
21
  mail (~> 2.3.0)
22
- actionpack (3.1.0.rc5)
23
- activemodel (= 3.1.0.rc5)
24
- activesupport (= 3.1.0.rc5)
22
+ actionpack (3.1.0)
23
+ activemodel (= 3.1.0)
24
+ activesupport (= 3.1.0)
25
25
  builder (~> 3.0.0)
26
26
  erubis (~> 2.7.0)
27
27
  i18n (~> 0.6)
28
- rack (~> 1.3.1)
29
- rack-cache (~> 1.0.2)
30
- rack-mount (~> 0.8.1)
31
- rack-test (~> 0.6.0)
32
- sprockets (~> 2.0.0.beta.12)
33
- activemodel (3.1.0.rc5)
34
- activesupport (= 3.1.0.rc5)
35
- bcrypt-ruby (~> 2.1.4)
28
+ rack (~> 1.3.2)
29
+ rack-cache (~> 1.0.3)
30
+ rack-mount (~> 0.8.2)
31
+ rack-test (~> 0.6.1)
32
+ sprockets (~> 2.0.0)
33
+ activemodel (3.1.0)
34
+ activesupport (= 3.1.0)
35
+ bcrypt-ruby (~> 3.0.0)
36
36
  builder (~> 3.0.0)
37
37
  i18n (~> 0.6)
38
- activerecord (3.1.0.rc5)
39
- activemodel (= 3.1.0.rc5)
40
- activesupport (= 3.1.0.rc5)
41
- arel (~> 2.1.4)
38
+ activerecord (3.1.0)
39
+ activemodel (= 3.1.0)
40
+ activesupport (= 3.1.0)
41
+ arel (~> 2.2.1)
42
42
  tzinfo (~> 0.3.29)
43
- activeresource (3.1.0.rc5)
44
- activemodel (= 3.1.0.rc5)
45
- activesupport (= 3.1.0.rc5)
46
- activesupport (3.1.0.rc5)
43
+ activeresource (3.1.0)
44
+ activemodel (= 3.1.0)
45
+ activesupport (= 3.1.0)
46
+ activesupport (3.1.0)
47
47
  multi_json (~> 1.0)
48
48
  apotomo (1.1.2)
49
49
  cells (>= 3.5.6)
50
50
  hooks (~> 0.1.3)
51
51
  onfire (~> 0.2.0)
52
- arel (2.1.4)
53
- bcrypt-ruby (2.1.4)
52
+ arel (2.2.1)
53
+ bcrypt-ruby (3.0.0)
54
54
  builder (3.0.0)
55
- capybara (1.0.0)
55
+ capybara (1.1.1)
56
56
  mime-types (>= 1.16)
57
57
  nokogiri (>= 1.3.3)
58
58
  rack (>= 1.0.0)
59
59
  rack-test (>= 0.5.4)
60
- selenium-webdriver (~> 0.2.0)
60
+ selenium-webdriver (~> 2.0)
61
61
  xpath (~> 0.1.4)
62
- cells (3.6.4)
62
+ cells (3.6.5)
63
63
  actionpack (~> 3.0)
64
64
  railties (~> 3.0)
65
- childprocess (0.2.0)
65
+ childprocess (0.2.2)
66
66
  ffi (~> 1.0.6)
67
67
  database_cleaner (0.6.7)
68
- diff-lcs (1.1.2)
68
+ diff-lcs (1.1.3)
69
69
  erubis (2.7.0)
70
- fabrication (1.0.1)
70
+ fabrication (1.1.0)
71
71
  ffi (1.0.9)
72
- forgery (0.3.12)
73
- nokogiri (~> 1.4)
72
+ forgery (0.5.0)
74
73
  git (1.2.5)
75
- guard (0.5.1)
74
+ guard (0.6.3)
76
75
  thor (~> 0.14.6)
77
- guard-rspec (0.4.0)
76
+ guard-rspec (0.4.4)
78
77
  guard (>= 0.4.0)
79
- hike (1.2.0)
78
+ hike (1.2.1)
80
79
  hooks (0.1.4)
81
80
  i18n (0.6.0)
82
81
  jeweler (1.6.4)
83
82
  bundler (~> 1.0)
84
83
  git (>= 1.2.5)
85
84
  rake
86
- json_pure (1.5.3)
85
+ json_pure (1.5.4)
86
+ spruz (~> 0.2.8)
87
87
  kaminari (0.12.4)
88
88
  rails (>= 3.0.0)
89
89
  libnotify (0.5.7)
@@ -94,7 +94,7 @@ GEM
94
94
  mime-types (1.16)
95
95
  multi_json (1.0.3)
96
96
  mysql (2.8.1)
97
- nested_set (1.6.7)
97
+ nested_set (1.6.8)
98
98
  activerecord (>= 3.0.0)
99
99
  railties (>= 3.0.0)
100
100
  nokogiri (1.5.0)
@@ -102,31 +102,31 @@ GEM
102
102
  pg (0.11.0)
103
103
  polyglot (0.3.2)
104
104
  rack (1.3.2)
105
- rack-cache (1.0.2)
105
+ rack-cache (1.0.3)
106
106
  rack (>= 0.4)
107
- rack-mount (0.8.1)
107
+ rack-mount (0.8.3)
108
108
  rack (>= 1.0.0)
109
109
  rack-ssl (1.3.2)
110
110
  rack
111
111
  rack-test (0.6.1)
112
112
  rack (>= 1.0)
113
- rails (3.1.0.rc5)
114
- actionmailer (= 3.1.0.rc5)
115
- actionpack (= 3.1.0.rc5)
116
- activerecord (= 3.1.0.rc5)
117
- activeresource (= 3.1.0.rc5)
118
- activesupport (= 3.1.0.rc5)
113
+ rails (3.1.0)
114
+ actionmailer (= 3.1.0)
115
+ actionpack (= 3.1.0)
116
+ activerecord (= 3.1.0)
117
+ activeresource (= 3.1.0)
118
+ activesupport (= 3.1.0)
119
119
  bundler (~> 1.0)
120
- railties (= 3.1.0.rc5)
121
- railties (3.1.0.rc5)
122
- actionpack (= 3.1.0.rc5)
123
- activesupport (= 3.1.0.rc5)
120
+ railties (= 3.1.0)
121
+ railties (3.1.0)
122
+ actionpack (= 3.1.0)
123
+ activesupport (= 3.1.0)
124
124
  rack-ssl (~> 1.3.2)
125
125
  rake (>= 0.8.7)
126
126
  rdoc (~> 3.4)
127
127
  thor (~> 0.14.6)
128
128
  rake (0.9.2)
129
- rdoc (3.9.1)
129
+ rdoc (3.9.4)
130
130
  rspec (2.6.0)
131
131
  rspec-core (~> 2.6.0)
132
132
  rspec-expectations (~> 2.6.0)
@@ -141,20 +141,21 @@ GEM
141
141
  railties (~> 3.0)
142
142
  rspec (~> 2.6.0)
143
143
  rubyzip (0.9.4)
144
- selenium-webdriver (0.2.2)
145
- childprocess (>= 0.1.9)
144
+ selenium-webdriver (2.5.0)
145
+ childprocess (>= 0.2.1)
146
146
  ffi (>= 1.0.7)
147
147
  json_pure
148
148
  rubyzip
149
- sprockets (2.0.0.beta.12)
149
+ sprockets (2.0.0)
150
150
  hike (~> 1.2)
151
151
  rack (~> 1.0)
152
152
  tilt (!= 1.3.0, ~> 1.1)
153
+ spruz (0.2.13)
153
154
  sqlite3 (1.3.4)
154
155
  sqlite3-ruby (1.3.3)
155
156
  sqlite3 (>= 1.3.3)
156
157
  thor (0.14.6)
157
- tilt (1.3.2)
158
+ tilt (1.3.3)
158
159
  treetop (1.4.10)
159
160
  polyglot
160
161
  polyglot (>= 0.3.1)
@@ -179,6 +180,6 @@ DEPENDENCIES
179
180
  nested_set
180
181
  pg
181
182
  puffer!
182
- rails (>= 3.1.0.rc5)
183
+ rails (~> 3.1.0)
183
184
  rspec-rails
184
185
  sqlite3-ruby
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.17
1
+ 0.0.18
@@ -1,6 +1,3 @@
1
- //= require puffer_pages/right-tabs
2
- //= require puffer_pages/right-dialog
1
+ //= require puffer_pages/right-tabs-src
3
2
  //= require puffer_pages/puffer_pages
4
- //= require puffer_pages/codemirror
5
- //= require puffer_pages/codemirror-base
6
- //= require puffer_pages/codemirror-parser
3
+ //= require puffer_pages/codemirror
@@ -34,13 +34,15 @@ var page_part_tab_add = function(event) {
34
34
  }).show();
35
35
  }
36
36
 
37
- $(document).onReady(function() {
38
- $$('textarea[codemirror]').each(function(textarea) {
39
- CodeMirror.fromTextArea(textarea._, {
40
- basefiles: "/puffer/javascripts/codemirror-base.js",
41
- parserfile: "/puffer/javascripts/codemirror-parser.js",
42
- stylesheet: "/puffer/stylesheets/codemirror.css",
43
- tabMode: 'shift'
44
- });
37
+ var init_codemirror = function(textarea) {
38
+ CodeMirror.fromTextArea(textarea._, {
39
+ basefiles: "/assets/puffer_pages/codemirror-base.js",
40
+ parserfile: "/assets/puffer_pages/codemirror-parser.js",
41
+ stylesheet: "/assets/puffer_pages/codemirror.css",
42
+ tabMode: 'shift'
45
43
  });
44
+ }
45
+
46
+ $(document).onReady(function() {
47
+ $$('textarea[codemirror]').each(init_codemirror);
46
48
  });
@@ -1,4 +1,3 @@
1
1
  /*
2
2
  *= require puffer_pages/puffer_pages
3
- *= require puffer_pages/codemirror
4
3
  */
@@ -0,0 +1 @@
1
+ <%= opts[:form].text_area field, field.input_options %>
@@ -0,0 +1,3 @@
1
+ class PagePartBodyComponent < BaseComponent
2
+
3
+ end
@@ -0,0 +1,30 @@
1
+ <ul id="page_parts" data-tabs="{closable: true, onRemove: page_part_tab_remove, addButton: page_part_tab_add}">
2
+ <ul>
3
+ <% opts[:form].object.page_parts.each_with_index do |page_part, index| %>
4
+ <li><%= link_to page_part.name, "#page_part_tab_#{index}" %></li>
5
+ <% end %>
6
+ </ul>
7
+ <% opts[:form].object.page_parts.each_with_index do |page_part, index| -%>
8
+ <li id="<%= "page_part_tab_#{index}" %>">
9
+ <% opts[:form].fields_for :page_parts, page_part do |page_part_builder| %>
10
+ <% field.children.each do |field| %>
11
+ <%= field.render parent_controller, :form, :form => page_part_builder %>
12
+ <% end %>
13
+ <% end %>
14
+ </li>
15
+ <% end -%>
16
+ </ul>
17
+ <div id="page_parts_marked_for_destroy">
18
+ </div>
19
+
20
+ <% new_page_part_tab_panel = capture do %>
21
+ <% opts[:form].fields_for :page_parts, PagePart.new, :child_index => 'new_page_part_tab_panel_index' do |page_part_builder| %>
22
+ <% field.children.each do |field| %>
23
+ <%= field.render parent_controller, :form, :form => page_part_builder %>
24
+ <% end %>
25
+ <% end %>
26
+ <% end %>
27
+
28
+ <%= javascript_tag do %>
29
+ var new_page_part_tab_panel = '<%= escape_javascript new_page_part_tab_panel.strip.html_safe %>'
30
+ <% end %>
@@ -0,0 +1,7 @@
1
+ class PagePartsComponent < Puffer::Component::Base
2
+
3
+ def form
4
+ render
5
+ end
6
+
7
+ end
@@ -1,6 +1,8 @@
1
1
  class PufferPages::LayoutsBase < Puffer::Base
2
2
  unloadable
3
3
 
4
+ layout 'puffer_pages'
5
+
4
6
  setup do
5
7
  group :pages
6
8
  end
@@ -23,7 +23,11 @@ class PufferPages::PagesBase < Puffer::TreeBase
23
23
  form do
24
24
  field :name
25
25
  field :slug
26
- field :page_parts, :type => :page_parts
26
+ field :page_parts, :type => :page_parts do
27
+ field :body, :type => :page_part_body, :html => {:codemirror => true}
28
+ field :name, :type => :hidden
29
+ field :_destroy, :type => :hidden, :html => { :class => 'destroy_mark' }
30
+ end
27
31
  field :layout_name, :select => :possible_layouts
28
32
  field :status, :select => :possible_statuses
29
33
  field :title
@@ -1,6 +1,8 @@
1
1
  class PufferPages::SnippetsBase < Puffer::Base
2
2
  unloadable
3
3
 
4
+ layout 'puffer_pages'
5
+
4
6
  setup do
5
7
  group :pages
6
8
  end
@@ -6,7 +6,7 @@ module PufferPages
6
6
  include Rails.application.routes.url_helpers
7
7
 
8
8
  delegate *(Page.statuses.map {|s| "#{s}?"} << {:to => :page})
9
- delegate :name, :title, :description, :keywords, :created_at, :updated_at, :to => :page
9
+ delegate :id, :name, :title, :description, :keywords, :created_at, :updated_at, :to => :page
10
10
 
11
11
  def initialize page, current_page = nil, controller = nil
12
12
  @page, @current_page, @controller = page, current_page, controller
@@ -14,13 +14,13 @@ module PufferPages
14
14
 
15
15
  %w(parent root).each do |attribute|
16
16
  define_method attribute do
17
- instance_variable_get("@#{attribute}") || instance_variable_set("@#{attribute}", self.class.new(page.parent, current_page, request))
17
+ instance_variable_get("@#{attribute}") || instance_variable_set("@#{attribute}", self.class.new(page.parent, current_page, controller))
18
18
  end
19
19
  end
20
20
 
21
21
  %w(ancestors self_and_ancestors children self_and_children siblings self_and_siblings descendants, self_and_descendants).each do |attribute|
22
22
  define_method attribute do
23
- instance_variable_get("@#{attribute}") || instance_variable_set("@#{attribute}", page.send(attribute).map{ |ac| self.class.new(ac, current_page, request)})
23
+ instance_variable_get("@#{attribute}") || instance_variable_set("@#{attribute}", page.send(attribute).map{ |ac| self.class.new(ac, current_page, controller)})
24
24
  end
25
25
  end
26
26
 
@@ -41,7 +41,7 @@ module PufferPages
41
41
  end
42
42
 
43
43
  def == drop
44
- page.id == drop.send(:page).id
44
+ id == drop.send(:page).id
45
45
  end
46
46
 
47
47
  def before_method method
data/puffer_pages.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{puffer_pages}
8
- s.version = "0.0.17"
8
+ s.version = "0.0.18"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["pyromaniac"]
12
- s.date = %q{2011-08-01}
11
+ s.authors = [%q{pyromaniac}]
12
+ s.date = %q{2011-09-09}
13
13
  s.description = %q{Puffer pages is integratable rails CMS with puffer admin interface}
14
14
  s.email = %q{kinwizard@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -29,11 +29,14 @@ Gem::Specification.new do |s|
29
29
  "app/assets/javascripts/puffer_pages/codemirror-parser.js",
30
30
  "app/assets/javascripts/puffer_pages/codemirror.js",
31
31
  "app/assets/javascripts/puffer_pages/puffer_pages.js",
32
- "app/assets/javascripts/puffer_pages/right-dialog.js",
33
- "app/assets/javascripts/puffer_pages/right-tabs.js",
32
+ "app/assets/javascripts/puffer_pages/right-tabs-src.js",
34
33
  "app/assets/stylesheets/puffer_pages/application.css",
35
34
  "app/assets/stylesheets/puffer_pages/codemirror.css",
36
35
  "app/assets/stylesheets/puffer_pages/puffer_pages.css",
36
+ "app/components/page_part_body/form.html.erb",
37
+ "app/components/page_part_body_component.rb",
38
+ "app/components/page_parts/form.html.erb",
39
+ "app/components/page_parts_component.rb",
37
40
  "app/controllers/admin/layouts_controller.rb",
38
41
  "app/controllers/admin/pages_controller.rb",
39
42
  "app/controllers/admin/snippets_controller.rb",
@@ -51,8 +54,6 @@ Gem::Specification.new do |s|
51
54
  "app/models/puffer_pages/snippet.rb",
52
55
  "app/models/snippet.rb",
53
56
  "app/views/layouts/puffer_pages.html.erb",
54
- "app/views/puffer_pages/pages_base/_page_part_builder.html.erb",
55
- "app/views/puffer_pages/pages_base/_page_parts.html.erb",
56
57
  "app/views/puffer_pages/pages_base/_tree_page.html.erb",
57
58
  "config/locales/en.yml",
58
59
  "config/puffer_routes.rb",
@@ -60,8 +61,6 @@ Gem::Specification.new do |s|
60
61
  "db/migrate/20090504132337_create_page_parts.rb",
61
62
  "db/migrate/20090506102004_create_layouts.rb",
62
63
  "db/migrate/20090510121824_create_snippets.rb",
63
- "lib/puffer/inputs/page_parts.rb",
64
- "lib/puffer/inputs/page_parts_body.rb",
65
64
  "lib/puffer_pages.rb",
66
65
  "lib/puffer_pages/engine.rb",
67
66
  "lib/puffer_pages/extensions/core.rb",
@@ -123,15 +122,15 @@ Gem::Specification.new do |s|
123
122
  "spec/spec_helper.rb"
124
123
  ]
125
124
  s.homepage = %q{http://github.com/puffer/puffer_pages}
126
- s.require_paths = ["lib"]
127
- s.rubygems_version = %q{1.6.2}
125
+ s.require_paths = [%q{lib}]
126
+ s.rubygems_version = %q{1.8.6}
128
127
  s.summary = %q{Content management system}
129
128
 
130
129
  if s.respond_to? :specification_version then
131
130
  s.specification_version = 3
132
131
 
133
132
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
134
- s.add_runtime_dependency(%q<rails>, [">= 3.1.0.rc5"])
133
+ s.add_runtime_dependency(%q<rails>, ["~> 3.1.0"])
135
134
  s.add_runtime_dependency(%q<puffer>, [">= 0"])
136
135
  s.add_runtime_dependency(%q<liquid>, [">= 0"])
137
136
  s.add_runtime_dependency(%q<nested_set>, [">= 0"])
@@ -148,7 +147,7 @@ Gem::Specification.new do |s|
148
147
  s.add_development_dependency(%q<fabrication>, [">= 0"])
149
148
  s.add_development_dependency(%q<jeweler>, [">= 0"])
150
149
  else
151
- s.add_dependency(%q<rails>, [">= 3.1.0.rc5"])
150
+ s.add_dependency(%q<rails>, ["~> 3.1.0"])
152
151
  s.add_dependency(%q<puffer>, [">= 0"])
153
152
  s.add_dependency(%q<liquid>, [">= 0"])
154
153
  s.add_dependency(%q<nested_set>, [">= 0"])
@@ -166,7 +165,7 @@ Gem::Specification.new do |s|
166
165
  s.add_dependency(%q<jeweler>, [">= 0"])
167
166
  end
168
167
  else
169
- s.add_dependency(%q<rails>, [">= 3.1.0.rc5"])
168
+ s.add_dependency(%q<rails>, ["~> 3.1.0"])
170
169
  s.add_dependency(%q<puffer>, [">= 0"])
171
170
  s.add_dependency(%q<liquid>, [">= 0"])
172
171
  s.add_dependency(%q<nested_set>, [">= 0"])