puffer_pages 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -3
- data/Gemfile.lock +46 -40
- data/README.md +3 -2
- data/VERSION +1 -1
- data/app/helpers/puffer_pages_helper.rb +4 -3
- data/app/helpers/puffer_tree_helper.rb +7 -3
- data/app/models/page.rb +8 -17
- data/app/views/puffer_pages/_tree_page.html.erb +1 -1
- data/app/views/puffer_tree/_record.html.erb +27 -0
- data/app/views/puffer_tree/toggle.js.erb +6 -0
- data/app/views/puffer_tree/tree.html.erb +1 -18
- data/lib/generators/puffer_pages/install/templates/puffer/stylesheets/puffer_tree.css +15 -1
- data/lib/puffer/tree_base.rb +25 -1
- data/lib/puffer_pages/extensions/core.rb +15 -0
- data/lib/puffer_pages/liquid/page_drop.rb +4 -0
- data/puffer_pages.gemspec +9 -5
- data/spec/dummy/public/puffer/stylesheets/puffer_tree.css +13 -0
- data/spec/lib/core_spec.rb +18 -0
- data/spec/lib/drops_spec.rb +0 -2
- data/spec/lib/tags_spec.rb +6 -0
- data/spec/models/page_spec.rb +6 -0
- metadata +11 -9
data/Gemfile
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
|
-
gem 'rails'
|
4
|
-
gem 'liquid', :git => 'git://github.com/
|
5
|
-
gem 'nested_set'
|
3
|
+
gem 'rails'
|
4
|
+
gem 'liquid', :git => 'git://github.com/puffer/liquid.git'
|
5
|
+
gem 'nested_set', :git => 'git://github.com/pyromaniac/nested_set.git'
|
6
6
|
gem 'puffer', '>= 0.0.17'
|
7
7
|
|
8
8
|
group :development, :test, :pg_test do
|
data/Gemfile.lock
CHANGED
@@ -1,20 +1,28 @@
|
|
1
1
|
GIT
|
2
|
-
remote: git://github.com/
|
3
|
-
revision:
|
2
|
+
remote: git://github.com/puffer/liquid.git
|
3
|
+
revision: 18ddffc9c4be25dadf9ec55dc5664a454ae3d072
|
4
4
|
specs:
|
5
5
|
liquid (2.2.2)
|
6
6
|
|
7
|
+
GIT
|
8
|
+
remote: git://github.com/pyromaniac/nested_set.git
|
9
|
+
revision: 32c0d948cfccdb81324bc127daa3c5077d89be22
|
10
|
+
specs:
|
11
|
+
nested_set (1.6.4)
|
12
|
+
activerecord (>= 3.0.0)
|
13
|
+
railties (>= 3.0.0)
|
14
|
+
|
7
15
|
GEM
|
8
16
|
remote: http://rubygems.org/
|
9
17
|
specs:
|
10
|
-
ZenTest (4.
|
18
|
+
ZenTest (4.5.0)
|
11
19
|
abstract (1.0.0)
|
12
|
-
actionmailer (3.0.
|
13
|
-
actionpack (= 3.0.
|
20
|
+
actionmailer (3.0.5)
|
21
|
+
actionpack (= 3.0.5)
|
14
22
|
mail (~> 2.2.15)
|
15
|
-
actionpack (3.0.
|
16
|
-
activemodel (= 3.0.
|
17
|
-
activesupport (= 3.0.
|
23
|
+
actionpack (3.0.5)
|
24
|
+
activemodel (= 3.0.5)
|
25
|
+
activesupport (= 3.0.5)
|
18
26
|
builder (~> 2.1.2)
|
19
27
|
erubis (~> 2.6.6)
|
20
28
|
i18n (~> 0.4)
|
@@ -22,24 +30,24 @@ GEM
|
|
22
30
|
rack-mount (~> 0.6.13)
|
23
31
|
rack-test (~> 0.5.7)
|
24
32
|
tzinfo (~> 0.3.23)
|
25
|
-
activemodel (3.0.
|
26
|
-
activesupport (= 3.0.
|
33
|
+
activemodel (3.0.5)
|
34
|
+
activesupport (= 3.0.5)
|
27
35
|
builder (~> 2.1.2)
|
28
36
|
i18n (~> 0.4)
|
29
|
-
activerecord (3.0.
|
30
|
-
activemodel (= 3.0.
|
31
|
-
activesupport (= 3.0.
|
37
|
+
activerecord (3.0.5)
|
38
|
+
activemodel (= 3.0.5)
|
39
|
+
activesupport (= 3.0.5)
|
32
40
|
arel (~> 2.0.2)
|
33
41
|
tzinfo (~> 0.3.23)
|
34
|
-
activeresource (3.0.
|
35
|
-
activemodel (= 3.0.
|
36
|
-
activesupport (= 3.0.
|
37
|
-
activesupport (3.0.
|
38
|
-
arel (2.0.
|
42
|
+
activeresource (3.0.5)
|
43
|
+
activemodel (= 3.0.5)
|
44
|
+
activesupport (= 3.0.5)
|
45
|
+
activesupport (3.0.5)
|
46
|
+
arel (2.0.9)
|
39
47
|
autotest (4.4.6)
|
40
48
|
ZenTest (>= 4.4.1)
|
41
49
|
builder (2.1.2)
|
42
|
-
capybara (0.4.1.
|
50
|
+
capybara (0.4.1.2)
|
43
51
|
celerity (>= 0.7.9)
|
44
52
|
culerity (>= 0.2.4)
|
45
53
|
mime-types (>= 1.16)
|
@@ -48,10 +56,10 @@ GEM
|
|
48
56
|
rack-test (>= 0.5.4)
|
49
57
|
selenium-webdriver (>= 0.0.27)
|
50
58
|
xpath (~> 0.1.3)
|
51
|
-
celerity (0.8.
|
59
|
+
celerity (0.8.8)
|
52
60
|
cells (3.4.4)
|
53
61
|
cgi_multipart_eof_fix (2.5.0)
|
54
|
-
childprocess (0.1.
|
62
|
+
childprocess (0.1.7)
|
55
63
|
ffi (~> 0.6.3)
|
56
64
|
culerity (0.2.15)
|
57
65
|
daemons (1.1.0)
|
@@ -62,7 +70,8 @@ GEM
|
|
62
70
|
fastthread (1.0.7)
|
63
71
|
ffi (0.6.3)
|
64
72
|
rake (>= 0.8.7)
|
65
|
-
forgery (0.3.
|
73
|
+
forgery (0.3.7)
|
74
|
+
nokogiri (~> 1.4)
|
66
75
|
gem_plugin (0.2.3)
|
67
76
|
git (1.2.5)
|
68
77
|
i18n (0.5.0)
|
@@ -83,32 +92,29 @@ GEM
|
|
83
92
|
fastthread (>= 1.0.1)
|
84
93
|
gem_plugin (>= 0.2.3)
|
85
94
|
mysql (2.8.1)
|
86
|
-
nested_set (1.6.3)
|
87
|
-
activerecord (>= 3.0.0)
|
88
|
-
railties (>= 3.0.0)
|
89
95
|
nokogiri (1.4.4)
|
90
96
|
pg (0.10.1)
|
91
97
|
polyglot (0.3.1)
|
92
|
-
puffer (0.0.
|
98
|
+
puffer (0.0.19)
|
93
99
|
cells (~> 3.4.4)
|
94
|
-
rails (~> 3.0.
|
100
|
+
rails (~> 3.0.4)
|
95
101
|
will_paginate (~> 3.0.pre2)
|
96
102
|
rack (1.2.1)
|
97
103
|
rack-mount (0.6.13)
|
98
104
|
rack (>= 1.0.0)
|
99
105
|
rack-test (0.5.7)
|
100
106
|
rack (>= 1.0)
|
101
|
-
rails (3.0.
|
102
|
-
actionmailer (= 3.0.
|
103
|
-
actionpack (= 3.0.
|
104
|
-
activerecord (= 3.0.
|
105
|
-
activeresource (= 3.0.
|
106
|
-
activesupport (= 3.0.
|
107
|
+
rails (3.0.5)
|
108
|
+
actionmailer (= 3.0.5)
|
109
|
+
actionpack (= 3.0.5)
|
110
|
+
activerecord (= 3.0.5)
|
111
|
+
activeresource (= 3.0.5)
|
112
|
+
activesupport (= 3.0.5)
|
107
113
|
bundler (~> 1.0)
|
108
|
-
railties (= 3.0.
|
109
|
-
railties (3.0.
|
110
|
-
actionpack (= 3.0.
|
111
|
-
activesupport (= 3.0.
|
114
|
+
railties (= 3.0.5)
|
115
|
+
railties (3.0.5)
|
116
|
+
actionpack (= 3.0.5)
|
117
|
+
activesupport (= 3.0.5)
|
112
118
|
rake (>= 0.8.7)
|
113
119
|
thor (~> 0.14.4)
|
114
120
|
rake (0.8.7)
|
@@ -126,7 +132,7 @@ GEM
|
|
126
132
|
railties (~> 3.0)
|
127
133
|
rspec (~> 2.5.0)
|
128
134
|
rubyzip (0.9.4)
|
129
|
-
selenium-webdriver (0.1.
|
135
|
+
selenium-webdriver (0.1.3)
|
130
136
|
childprocess (~> 0.1.5)
|
131
137
|
ffi (~> 0.6.3)
|
132
138
|
json_pure
|
@@ -154,9 +160,9 @@ DEPENDENCIES
|
|
154
160
|
liquid!
|
155
161
|
mongrel
|
156
162
|
mysql
|
157
|
-
nested_set
|
163
|
+
nested_set!
|
158
164
|
pg
|
159
165
|
puffer (>= 0.0.17)
|
160
|
-
rails
|
166
|
+
rails
|
161
167
|
rspec-rails
|
162
168
|
sqlite3-ruby
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
# Warning! This puffer_pages version requires liquid from repo. So, add following line to your Gemfile until new liquid version will release.
|
2
|
-
<pre>gem 'liquid', :git => 'git://github.com/
|
1
|
+
# Warning! This puffer_pages version requires liquid from puffer repo. So, add following line to your Gemfile until new liquid version will release.
|
2
|
+
<pre>gem 'liquid', :git => 'git://github.com/puffer/liquid.git'</pre>
|
3
|
+
I hope, it's temporarly
|
3
4
|
|
4
5
|
# Puffer_pages is lightweight rails 3 CMS
|
5
6
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.14
|
@@ -1,11 +1,12 @@
|
|
1
1
|
module PufferPagesHelper
|
2
2
|
|
3
3
|
def possible_layouts
|
4
|
-
inherited_layout + (application_layouts + puffer_layouts).sort
|
4
|
+
inherited_layout + (application_layouts + puffer_layouts).uniq.sort
|
5
5
|
end
|
6
6
|
|
7
7
|
def application_layouts
|
8
|
-
view_paths.
|
8
|
+
application_layouts_path = view_paths.detect {|path| path.to_s.starts_with? Rails.root }
|
9
|
+
Dir.glob("#{application_layouts_path}/layouts/[^_]*").flatten.map {|path| File.basename(path).gsub(/\..*$/, '')}.uniq
|
9
10
|
end
|
10
11
|
|
11
12
|
def puffer_layouts
|
@@ -13,7 +14,7 @@ module PufferPagesHelper
|
|
13
14
|
end
|
14
15
|
|
15
16
|
def inherited_layout
|
16
|
-
record.inherited_layout_name ? [[t('puffer.inherited_layout', :name => record.inherited_layout_name), '']] : []
|
17
|
+
record.inherited_layout_name && !record.root? ? [[t('puffer.inherited_layout', :name => record.inherited_layout_name), '']] : []
|
17
18
|
end
|
18
19
|
|
19
20
|
def possible_statuses
|
@@ -2,9 +2,13 @@ module PufferTreeHelper
|
|
2
2
|
|
3
3
|
def puffer_tree hash, options = {}, &block
|
4
4
|
content_tag :ul, options do
|
5
|
-
hash
|
6
|
-
|
7
|
-
|
5
|
+
puffer_tree_node hash, &block
|
6
|
+
end if hash.present?
|
7
|
+
end
|
8
|
+
|
9
|
+
def puffer_tree_node hash, &block
|
10
|
+
hash.keys.each do |node|
|
11
|
+
block.call node, render_tree(hash[node], &block)
|
8
12
|
end if hash.present?
|
9
13
|
end
|
10
14
|
|
data/app/models/page.rb
CHANGED
@@ -2,9 +2,7 @@ class Page < ActiveRecord::Base
|
|
2
2
|
|
3
3
|
acts_as_nested_set
|
4
4
|
|
5
|
-
scope :with_parts, includes(:page_parts)
|
6
5
|
scope :published, where(:status => 'published')
|
7
|
-
default_scope order(:lft)
|
8
6
|
|
9
7
|
def self.statuses
|
10
8
|
%w(draft hidden published)
|
@@ -22,24 +20,21 @@ class Page < ActiveRecord::Base
|
|
22
20
|
belongs_to :layout, :primary_key => :name, :foreign_key => :layout_name
|
23
21
|
|
24
22
|
validates_presence_of :name
|
25
|
-
validate do |page|
|
26
|
-
page.errors.add(:layout_name, :blank) unless page.inherited_layout_name.present?
|
27
|
-
end
|
28
23
|
validates_uniqueness_of :slug, :scope => (:parent_id unless PufferPages.single_section_page_path)
|
24
|
+
validates_inclusion_of :status, :in => Page.statuses
|
29
25
|
validates_format_of :slug,
|
30
26
|
:with => /\A([\w]+[\w-]*(\.[\w]+)?|\*)\Z/,
|
31
27
|
:message => :slug_format,
|
32
28
|
:unless => :root?
|
33
|
-
|
34
|
-
:
|
35
|
-
:
|
36
|
-
|
37
|
-
validates_inclusion_of :status, :in => Page.statuses
|
29
|
+
validate do |page|
|
30
|
+
page.errors.add(:layout_name, :blank) unless page.inherited_layout_name.present?
|
31
|
+
page.errors.add(:slug, :root_slug_format) if page.root? && !page.slug.nil?
|
32
|
+
end
|
38
33
|
|
39
34
|
attr_protected :location
|
40
35
|
|
41
|
-
before_validation :
|
42
|
-
def
|
36
|
+
before_validation :defaultize_attributes
|
37
|
+
def defaultize_attributes
|
43
38
|
self.status ||= 'draft'
|
44
39
|
self.slug = slug.presence
|
45
40
|
self.location = [swallow_nil{parent.location}, slug].compact.join('/').presence
|
@@ -105,11 +100,7 @@ class Page < ActiveRecord::Base
|
|
105
100
|
end
|
106
101
|
|
107
102
|
def content_type
|
108
|
-
Rack::Mime.mime_type(File.extname(slug), 'text/html')
|
109
|
-
end
|
110
|
-
|
111
|
-
def self_and_children
|
112
|
-
[self] + children
|
103
|
+
Rack::Mime.mime_type(File.extname(slug.to_s), 'text/html')
|
113
104
|
end
|
114
105
|
|
115
106
|
end
|
@@ -1,2 +1,2 @@
|
|
1
1
|
<strong><%= tree_page.id %></strong> — <%= tree_page.name %>
|
2
|
-
(<%= link_to t('.view'), puffer_page_path(tree_page.
|
2
|
+
(<%= tree_page.status %>, <%= link_to t('.view'), puffer_page_path(tree_page.to_location), :target => '_blank' %>)
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<li id="<%= dom_id record %>">
|
2
|
+
<dl class="record columns">
|
3
|
+
<dt class="column">
|
4
|
+
<% unless record.leaf? || record.root? %>
|
5
|
+
<span class="toggle">
|
6
|
+
<% if children.blank? %>
|
7
|
+
<%= link_to '+', resource.member_path(record, :action => :expand), :remote => true %>
|
8
|
+
<% else %>
|
9
|
+
<%= link_to '–', resource.member_path(record, :action => :collapse), :remote => true %>
|
10
|
+
<% end %>
|
11
|
+
</span>
|
12
|
+
<% end %>
|
13
|
+
<span class="handle">⇅</span>
|
14
|
+
<% tree_fields.each do |field| -%>
|
15
|
+
<span><%= render_field field, record %></span>
|
16
|
+
<% end -%>
|
17
|
+
</dt>
|
18
|
+
<dd class="column">
|
19
|
+
<%= link_to 'edit', resource.edit_path(record) if update_fields.present? %>
|
20
|
+
<% controller._members.each do |member| %>
|
21
|
+
<%= link_to member.label, resource.member_path(record, :action => member.action) if member.display? %>
|
22
|
+
<% end %>
|
23
|
+
<%= link_to 'destroy', resource.member_path(record), :confirm => "Are you sure?", :method => :delete if configuration.destroy %>
|
24
|
+
</dd>
|
25
|
+
</dl>
|
26
|
+
<%= children %>
|
27
|
+
</li>
|
@@ -2,24 +2,7 @@
|
|
2
2
|
<h1><%= @title %> Tree</h1>
|
3
3
|
<% if records.present? %>
|
4
4
|
<%= puffer_tree records, :class => 'puffer_tree' do |record, children| %>
|
5
|
-
|
6
|
-
<dl class="record columns">
|
7
|
-
<dt class="column">
|
8
|
-
<span class="handle">⇅</span>
|
9
|
-
<% tree_fields.each do |field| -%>
|
10
|
-
<span><%= render_field field, record %></span>
|
11
|
-
<% end -%>
|
12
|
-
</dt>
|
13
|
-
<dd class="column">
|
14
|
-
<%= link_to 'edit', resource.edit_path(record) if update_fields.present? %>
|
15
|
-
<% controller._members.each do |member| %>
|
16
|
-
<%= link_to member.label, resource.member_path(record, :action => member.action) if member.display? %>
|
17
|
-
<% end %>
|
18
|
-
<%= link_to 'destroy', resource.member_path(record), :confirm => "Are you sure?", :method => :delete if configuration.destroy %>
|
19
|
-
</dd>
|
20
|
-
</dl>
|
21
|
-
<%= children %>
|
22
|
-
</li>
|
5
|
+
<%= render :partial => 'record', :object => record, :locals => {:children => children} %>
|
23
6
|
<% end %>
|
24
7
|
<% else %>
|
25
8
|
<p>Sorry, but there is no records in <%= resource.human %></p>
|
@@ -1,10 +1,12 @@
|
|
1
|
-
.puffer_tree
|
1
|
+
.puffer_tree *
|
2
2
|
{
|
3
|
+
font-size: 8pt;
|
3
4
|
}
|
4
5
|
|
5
6
|
.puffer_tree li
|
6
7
|
{
|
7
8
|
list-style: none;
|
9
|
+
position: relative;
|
8
10
|
}
|
9
11
|
|
10
12
|
.puffer_tree li ul
|
@@ -49,3 +51,15 @@
|
|
49
51
|
padding-right: 10px;
|
50
52
|
color: #999;
|
51
53
|
}
|
54
|
+
|
55
|
+
.puffer_tree li .record .toggle
|
56
|
+
{
|
57
|
+
position: absolute;
|
58
|
+
left: -20px;
|
59
|
+
}
|
60
|
+
|
61
|
+
.puffer_tree li .record .toggle a
|
62
|
+
{
|
63
|
+
color: #999;
|
64
|
+
text-decoration: none;
|
65
|
+
}
|
data/lib/puffer/tree_base.rb
CHANGED
@@ -13,12 +13,19 @@ module Puffer
|
|
13
13
|
|
14
14
|
def index
|
15
15
|
return super if params[:search]
|
16
|
-
@records = resource.collection_scope.includes(resource.includes)
|
16
|
+
@records = resource.collection_scope.includes(resource.includes)
|
17
|
+
if session[:expanded].present?
|
18
|
+
@records = @records.where(["depth in (0, 1) or parent_id in (#{session[:expanded].join(', ')})"]).arrange
|
19
|
+
else
|
20
|
+
@records = @records.where(:depth => [0, 1]).arrange
|
21
|
+
end
|
17
22
|
render 'tree'
|
18
23
|
end
|
19
24
|
|
20
25
|
member do
|
21
26
|
get :inherit, :label => 'new page'
|
27
|
+
get :expand, :display => false
|
28
|
+
get :collapse, :display => false
|
22
29
|
end
|
23
30
|
|
24
31
|
def inherit
|
@@ -27,5 +34,22 @@ module Puffer
|
|
27
34
|
render 'new'
|
28
35
|
end
|
29
36
|
|
37
|
+
def expand
|
38
|
+
@parent = resource.member
|
39
|
+
session[:expanded] ||= []
|
40
|
+
session[:expanded].push params[:id] if @parent
|
41
|
+
session[:expanded].uniq!
|
42
|
+
@records = @parent.self_and_descendants.where(:parent_id => [@parent.parent_id] + session[:expanded]).includes(resource.includes).arrange
|
43
|
+
render 'toggle'
|
44
|
+
end
|
45
|
+
|
46
|
+
def collapse
|
47
|
+
@parent = resource.member
|
48
|
+
session[:expanded] ||= []
|
49
|
+
session[:expanded].delete params[:id]
|
50
|
+
@records = resource.collection_scope.where(:id => [@parent.id]).includes(resource.includes).arrange
|
51
|
+
render 'toggle'
|
52
|
+
end
|
53
|
+
|
30
54
|
end
|
31
55
|
end
|
@@ -5,3 +5,18 @@ Kernel.class_eval do
|
|
5
5
|
nil
|
6
6
|
end
|
7
7
|
end
|
8
|
+
|
9
|
+
Array.class_eval do
|
10
|
+
def arranged
|
11
|
+
arranged = ActiveSupport::OrderedHash.new
|
12
|
+
insertion_points = [arranged]
|
13
|
+
depth = 0
|
14
|
+
each do |node|
|
15
|
+
insertion_points.push insertion_points.last.values.last if node.depth > depth
|
16
|
+
(depth - node.depth).times { insertion_points.pop } if node.depth < depth
|
17
|
+
insertion_points.last.merge! node => ActiveSupport::OrderedHash.new
|
18
|
+
depth = node.depth
|
19
|
+
end
|
20
|
+
arranged
|
21
|
+
end
|
22
|
+
end
|
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.
|
8
|
+
s.version = "0.0.14"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["pyromaniac"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-03-01}
|
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 = [
|
@@ -36,6 +36,8 @@ Gem::Specification.new do |s|
|
|
36
36
|
"app/views/puffer_pages/_page_part_builder.html.erb",
|
37
37
|
"app/views/puffer_pages/_page_parts.html.erb",
|
38
38
|
"app/views/puffer_pages/_tree_page.html.erb",
|
39
|
+
"app/views/puffer_tree/_record.html.erb",
|
40
|
+
"app/views/puffer_tree/toggle.js.erb",
|
39
41
|
"app/views/puffer_tree/tree.html.erb",
|
40
42
|
"autotest/discover.rb",
|
41
43
|
"config/locales/en.yml",
|
@@ -130,6 +132,7 @@ Gem::Specification.new do |s|
|
|
130
132
|
"spec/fabricators/pages_fabricator.rb",
|
131
133
|
"spec/fabricators/snippets_fabricator.rb",
|
132
134
|
"spec/integration/navigation_spec.rb",
|
135
|
+
"spec/lib/core_spec.rb",
|
133
136
|
"spec/lib/drops_spec.rb",
|
134
137
|
"spec/lib/tags_spec.rb",
|
135
138
|
"spec/models/page_spec.rb",
|
@@ -173,6 +176,7 @@ Gem::Specification.new do |s|
|
|
173
176
|
"spec/fabricators/pages_fabricator.rb",
|
174
177
|
"spec/fabricators/snippets_fabricator.rb",
|
175
178
|
"spec/integration/navigation_spec.rb",
|
179
|
+
"spec/lib/core_spec.rb",
|
176
180
|
"spec/lib/drops_spec.rb",
|
177
181
|
"spec/lib/tags_spec.rb",
|
178
182
|
"spec/models/page_spec.rb",
|
@@ -184,7 +188,7 @@ Gem::Specification.new do |s|
|
|
184
188
|
s.specification_version = 3
|
185
189
|
|
186
190
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
187
|
-
s.add_runtime_dependency(%q<rails>, ["
|
191
|
+
s.add_runtime_dependency(%q<rails>, [">= 0"])
|
188
192
|
s.add_runtime_dependency(%q<liquid>, [">= 0"])
|
189
193
|
s.add_runtime_dependency(%q<nested_set>, [">= 0"])
|
190
194
|
s.add_runtime_dependency(%q<puffer>, [">= 0.0.17"])
|
@@ -199,7 +203,7 @@ Gem::Specification.new do |s|
|
|
199
203
|
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
200
204
|
s.add_development_dependency(%q<mongrel>, [">= 0"])
|
201
205
|
else
|
202
|
-
s.add_dependency(%q<rails>, ["
|
206
|
+
s.add_dependency(%q<rails>, [">= 0"])
|
203
207
|
s.add_dependency(%q<liquid>, [">= 0"])
|
204
208
|
s.add_dependency(%q<nested_set>, [">= 0"])
|
205
209
|
s.add_dependency(%q<puffer>, [">= 0.0.17"])
|
@@ -215,7 +219,7 @@ Gem::Specification.new do |s|
|
|
215
219
|
s.add_dependency(%q<mongrel>, [">= 0"])
|
216
220
|
end
|
217
221
|
else
|
218
|
-
s.add_dependency(%q<rails>, ["
|
222
|
+
s.add_dependency(%q<rails>, [">= 0"])
|
219
223
|
s.add_dependency(%q<liquid>, [">= 0"])
|
220
224
|
s.add_dependency(%q<nested_set>, [">= 0"])
|
221
225
|
s.add_dependency(%q<puffer>, [">= 0.0.17"])
|
@@ -5,6 +5,7 @@
|
|
5
5
|
.puffer_tree li
|
6
6
|
{
|
7
7
|
list-style: none;
|
8
|
+
position: relative;
|
8
9
|
}
|
9
10
|
|
10
11
|
.puffer_tree li ul
|
@@ -49,3 +50,15 @@
|
|
49
50
|
padding-right: 10px;
|
50
51
|
color: #999;
|
51
52
|
}
|
53
|
+
|
54
|
+
.puffer_tree li .record .toggle
|
55
|
+
{
|
56
|
+
position: absolute;
|
57
|
+
left: -20px;
|
58
|
+
}
|
59
|
+
|
60
|
+
.puffer_tree li .record .toggle a
|
61
|
+
{
|
62
|
+
color: #999;
|
63
|
+
text-decoration: none;
|
64
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Core' do
|
4
|
+
|
5
|
+
describe 'arrange' do
|
6
|
+
|
7
|
+
it 'should generate proper hash' do
|
8
|
+
@root = Fabricate :page, :layout_name => 'foo_layout'
|
9
|
+
@foo = Fabricate :page, :slug => 'foo', :parent => @root
|
10
|
+
@bar = Fabricate :page, :slug => 'bar', :parent => @foo
|
11
|
+
@baz = Fabricate :page, :slug => 'baz', :parent => @root
|
12
|
+
|
13
|
+
@root.reload.self_and_descendants.all.arrange.should == @root.reload.self_and_descendants.arrange
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
data/spec/lib/drops_spec.rb
CHANGED
data/spec/lib/tags_spec.rb
CHANGED
@@ -44,6 +44,12 @@ describe 'Tags' do
|
|
44
44
|
render_page(@page).should == @snippet.body
|
45
45
|
end
|
46
46
|
|
47
|
+
it 'should include snippet with proper object name' do
|
48
|
+
@snippet = Fabricate :snippet, :name => 'var', :body => '{{ var }}'
|
49
|
+
@layout = Fabricate :layout, :name => 'foo_layout', :body => "{% assign sn = 'snippets/var' %}{% include sn with 'hello' %}"
|
50
|
+
render_page(@page).should == 'hello'
|
51
|
+
end
|
52
|
+
|
47
53
|
end
|
48
54
|
|
49
55
|
describe 'stylesheets' do
|
data/spec/models/page_spec.rb
CHANGED
@@ -127,6 +127,12 @@ describe Page do
|
|
127
127
|
result.should == "#{@root.title} #{@root.name}"
|
128
128
|
end
|
129
129
|
|
130
|
+
it 'should receive proper content type' do
|
131
|
+
@root.content_type.should == 'text/html'
|
132
|
+
page = Fabricate :page, :slug => 'style.css'
|
133
|
+
page.content_type.should == 'text/css'
|
134
|
+
end
|
135
|
+
|
130
136
|
end
|
131
137
|
|
132
138
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puffer_pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 14
|
10
|
+
version: 0.0.14
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- pyromaniac
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-03-01 00:00:00 +03:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -23,14 +23,12 @@ dependencies:
|
|
23
23
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
24
24
|
none: false
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
28
|
+
hash: 3
|
29
29
|
segments:
|
30
|
-
- 3
|
31
30
|
- 0
|
32
|
-
|
33
|
-
version: 3.0.3
|
31
|
+
version: "0"
|
34
32
|
requirement: *id001
|
35
33
|
prerelease: false
|
36
34
|
name: rails
|
@@ -251,6 +249,8 @@ files:
|
|
251
249
|
- app/views/puffer_pages/_page_part_builder.html.erb
|
252
250
|
- app/views/puffer_pages/_page_parts.html.erb
|
253
251
|
- app/views/puffer_pages/_tree_page.html.erb
|
252
|
+
- app/views/puffer_tree/_record.html.erb
|
253
|
+
- app/views/puffer_tree/toggle.js.erb
|
254
254
|
- app/views/puffer_tree/tree.html.erb
|
255
255
|
- autotest/discover.rb
|
256
256
|
- config/locales/en.yml
|
@@ -345,6 +345,7 @@ files:
|
|
345
345
|
- spec/fabricators/pages_fabricator.rb
|
346
346
|
- spec/fabricators/snippets_fabricator.rb
|
347
347
|
- spec/integration/navigation_spec.rb
|
348
|
+
- spec/lib/core_spec.rb
|
348
349
|
- spec/lib/drops_spec.rb
|
349
350
|
- spec/lib/tags_spec.rb
|
350
351
|
- spec/models/page_spec.rb
|
@@ -417,6 +418,7 @@ test_files:
|
|
417
418
|
- spec/fabricators/pages_fabricator.rb
|
418
419
|
- spec/fabricators/snippets_fabricator.rb
|
419
420
|
- spec/integration/navigation_spec.rb
|
421
|
+
- spec/lib/core_spec.rb
|
420
422
|
- spec/lib/drops_spec.rb
|
421
423
|
- spec/lib/tags_spec.rb
|
422
424
|
- spec/models/page_spec.rb
|