constructor-pages 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -6,12 +6,12 @@ module ConstructorPages
|
|
6
6
|
include ConstructorCore::DeviseHelper
|
7
7
|
|
8
8
|
caches_page :show
|
9
|
-
|
9
|
+
|
10
10
|
before_filter :authenticate_user!, :except => [:show, :search, :sitemap]
|
11
11
|
before_filter {@roots = Page.roots}
|
12
12
|
layout 'constructor_core/application_admin', :except => [:show, :search, :sitemap]
|
13
13
|
before_filter :cache, :only => [:create, :update, :destroy, :move_up, :move_down]
|
14
|
-
|
14
|
+
|
15
15
|
# TODO
|
16
16
|
def index
|
17
17
|
@user_signed_in = user_signed_in?
|
@@ -28,7 +28,7 @@ module ConstructorPages
|
|
28
28
|
@multipart = false
|
29
29
|
|
30
30
|
if params[:page]
|
31
|
-
@parent = Page.find(params[:page])
|
31
|
+
@parent = Page.find(params[:page])
|
32
32
|
@page.parent_id = @parent.id
|
33
33
|
|
34
34
|
if @parent.template.child_id.nil? and !@parent.template.leaf?
|
@@ -38,7 +38,7 @@ module ConstructorPages
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
41
|
-
|
41
|
+
|
42
42
|
def show
|
43
43
|
if params[:all].nil?
|
44
44
|
@page = Page.first
|
@@ -67,7 +67,7 @@ module ConstructorPages
|
|
67
67
|
_template = render_to_string :partial => "json_templates/#{@page.template.code_name}.json.erb", :layout => false, :locals => {@page.template.code_name.to_sym => @page, :page => @page}
|
68
68
|
_js = render_to_string :partial => "js_partials/#{@page.template.code_name}.js"
|
69
69
|
|
70
|
-
render :json => @page, :template => _template.gsub(/\n/, '\\\\n'), :js => _js
|
70
|
+
render :json => @page, :ancestors => @page.ancestors.map{|a| a.id}, :template => _template.gsub(/\n/, '\\\\n'), :js => _js
|
71
71
|
}
|
72
72
|
end
|
73
73
|
end
|
@@ -117,7 +117,7 @@ module ConstructorPages
|
|
117
117
|
|
118
118
|
render :template => "templates/#{template.code_name}_search"
|
119
119
|
end
|
120
|
-
|
120
|
+
|
121
121
|
def edit
|
122
122
|
@page = Page.find(params[:id])
|
123
123
|
@page.template ||= Template.first
|
@@ -126,7 +126,7 @@ module ConstructorPages
|
|
126
126
|
@multipart = @page.template.fields.map{|f| f.type_value == "image"}.include?(true) ? true : false
|
127
127
|
end
|
128
128
|
|
129
|
-
def create
|
129
|
+
def create
|
130
130
|
@page = Page.new params[:page]
|
131
131
|
|
132
132
|
if @page.save
|
@@ -136,7 +136,7 @@ module ConstructorPages
|
|
136
136
|
end
|
137
137
|
end
|
138
138
|
|
139
|
-
def update
|
139
|
+
def update
|
140
140
|
@page = Page.find params[:id]
|
141
141
|
|
142
142
|
@page.template.fields.each do |field|
|
@@ -193,9 +193,9 @@ module ConstructorPages
|
|
193
193
|
|
194
194
|
redirect_to :back
|
195
195
|
end
|
196
|
-
|
196
|
+
|
197
197
|
private
|
198
|
-
|
198
|
+
|
199
199
|
def cache
|
200
200
|
expire_page :action => :show
|
201
201
|
cache_dir = ActionController::Base.page_cache_directory
|
@@ -203,5 +203,5 @@ module ConstructorPages
|
|
203
203
|
FileUtils.rm_r(Dir.glob(cache_dir+"/*")) rescue Errno::ENOENT
|
204
204
|
end
|
205
205
|
end
|
206
|
-
end
|
206
|
+
end
|
207
207
|
end
|
@@ -4,12 +4,6 @@ app = Dragonfly[:images]
|
|
4
4
|
app.configure_with(:imagemagick)
|
5
5
|
app.configure_with(:rails)
|
6
6
|
|
7
|
-
app.datastore = Dragonfly::DataStorage::S3DataStore.new({
|
8
|
-
:bucket_name => 'avgustklimat',
|
9
|
-
:access_key_id => 'AKIAIGSQM22DEELECHJQ',
|
10
|
-
:secret_access_key => 'HR3E4umEheZAskkS2Ld+DsFfCF8WO0LvA/Rr2g6j'
|
11
|
-
})
|
12
|
-
|
13
7
|
app.configure do |c|
|
14
8
|
c.url_format = '/images/:job/:basename.:format'
|
15
9
|
end
|
data/constructor-pages.gemspec
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.name = %q{constructor-pages}
|
6
|
-
s.version = '0.2.
|
6
|
+
s.version = '0.2.3'
|
7
7
|
s.summary = %q{Pages for ConstructorCms}
|
8
8
|
s.authors = ['Ivan Zotov']
|
9
9
|
s.require_paths = %w(lib)
|
@@ -17,7 +17,6 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.add_dependency 'awesome_nested_set', '~> 2.0'
|
18
18
|
s.add_dependency 'haml-rails'
|
19
19
|
s.add_dependency 'aws-s3'
|
20
|
-
s.add_dependency 'fog'
|
21
20
|
s.add_dependency 'russian', '~> 0.6.0'
|
22
21
|
s.add_dependency 'RedCloth'
|
23
22
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: constructor-pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -91,22 +91,6 @@ dependencies:
|
|
91
91
|
- - ! '>='
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '0'
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: fog
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
|
-
requirements:
|
99
|
-
- - ! '>='
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '0'
|
102
|
-
type: :runtime
|
103
|
-
prerelease: false
|
104
|
-
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- - ! '>='
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '0'
|
110
94
|
- !ruby/object:Gem::Dependency
|
111
95
|
name: russian
|
112
96
|
requirement: !ruby/object:Gem::Requirement
|