page_engine 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.markdown +74 -0
- data/Rakefile +39 -0
- data/app/assets/images/page_engine/add.png +0 -0
- data/app/assets/images/page_engine/bullet_add.png +0 -0
- data/app/assets/images/page_engine/bullet_go.png +0 -0
- data/app/assets/images/page_engine/delete.png +0 -0
- data/app/assets/images/page_engine/page_add.png +0 -0
- data/app/assets/images/page_engine/page_copy.png +0 -0
- data/app/assets/images/page_engine/page_delete.png +0 -0
- data/app/assets/images/page_engine/page_edit.png +0 -0
- data/app/assets/images/page_engine/page_gear.png +0 -0
- data/app/assets/images/page_engine/page_green.png +0 -0
- data/app/assets/images/page_engine/page_hidden.png +0 -0
- data/app/assets/images/page_engine/page_lightning.png +0 -0
- data/app/assets/images/page_engine/page_line.jpg +0 -0
- data/app/assets/images/page_engine/page_red.png +0 -0
- data/app/assets/images/page_engine/pencil.png +0 -0
- data/app/assets/images/page_engine/waiting.gif +0 -0
- data/app/assets/images/page_engine/zoom.png +0 -0
- data/app/assets/javascripts/markitup/sets/css/set.js +52 -0
- data/app/assets/javascripts/markitup/sets/html/set.js +64 -0
- data/app/assets/javascripts/markitup/sets/javascript/set.js +6 -0
- data/app/assets/javascripts/markitup/sets/markdown/set.js +53 -0
- data/app/assets/javascripts/markitup/sets/textile/set.js +57 -0
- data/app/assets/javascripts/page_engine.js +189 -0
- data/app/assets/stylesheets/jquery-ui/smoothness/jquery-ui-1.8.15.custom.css +307 -0
- data/app/assets/stylesheets/markitup/sets/css/style.css +69 -0
- data/app/assets/stylesheets/markitup/sets/html/style.css +58 -0
- data/app/assets/stylesheets/markitup/sets/javascript/style.css +0 -0
- data/app/assets/stylesheets/markitup/sets/markdown/style.css +49 -0
- data/app/assets/stylesheets/markitup/sets/textile/style.css +58 -0
- data/app/assets/stylesheets/markitup/skins/markitup/style.css +147 -0
- data/app/assets/stylesheets/markitup/skins/simple/style.css +118 -0
- data/app/assets/stylesheets/page_engine.css +231 -0
- data/app/controllers/admin/page_snippets_controller.rb +64 -0
- data/app/controllers/admin/pages_controller.rb +167 -0
- data/app/controllers/pages_controller.rb +20 -0
- data/app/helpers/pages_helper.rb +234 -0
- data/app/models/page.rb +233 -0
- data/app/models/page_part.rb +35 -0
- data/app/models/page_role.rb +15 -0
- data/app/models/page_snippet.rb +30 -0
- data/app/views/admin/page_snippets/_form.html.haml +10 -0
- data/app/views/admin/page_snippets/destroy.js.erb +3 -0
- data/app/views/admin/page_snippets/edit.html.haml +6 -0
- data/app/views/admin/page_snippets/index.html.haml +20 -0
- data/app/views/admin/page_snippets/new.html.haml +6 -0
- data/app/views/admin/page_snippets/show.html.erb +20 -0
- data/app/views/admin/pages/_form.html.haml +56 -0
- data/app/views/admin/pages/_page.html.haml +19 -0
- data/app/views/admin/pages/_page_list.html.haml +2 -0
- data/app/views/admin/pages/_page_part_fields.html.haml +9 -0
- data/app/views/admin/pages/destroy.js.erb +1 -0
- data/app/views/admin/pages/duplicate.js.erb +5 -0
- data/app/views/admin/pages/edit.html.haml +9 -0
- data/app/views/admin/pages/index.html.haml +10 -0
- data/app/views/admin/pages/new.html.haml +10 -0
- data/app/views/admin/pages/show.html.erb +100 -0
- data/app/views/admin/pages/sort.js.erb +3 -0
- data/app/views/layouts/admin.html.haml +20 -0
- data/app/views/pages/_nav_item.html.haml +10 -0
- data/app/views/pages/_navigation.html.haml +11 -0
- data/app/views/pages/index.html.erb +2 -0
- data/app/views/pages/show.html.erb +2 -0
- data/config/routes.rb +23 -0
- data/db/migrate/20110814185929_create_page_engine.rb +77 -0
- data/db/seed.rb +8 -0
- data/lib/generators/page_engine/page_engine_generator.rb +59 -0
- data/lib/page_engine/class_methods.rb +4 -0
- data/lib/page_engine/defaults.rb +5 -0
- data/lib/page_engine/engine.rb +4 -0
- data/lib/page_engine/exceptions.rb +4 -0
- data/lib/page_engine/extensions.rb +24 -0
- data/lib/page_engine/helpers.rb +10 -0
- data/lib/page_engine/instance_methods.rb +82 -0
- data/lib/page_engine/routes_finder.rb +23 -0
- data/lib/page_engine.rb +41 -0
- data/lib/tasks/page_engine_tasks.rake +4 -0
- metadata +192 -0
data/lib/page_engine.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'page_engine/defaults'
|
2
|
+
require "page_engine/engine"
|
3
|
+
require 'page_engine/extensions'
|
4
|
+
require 'page_engine/helpers'
|
5
|
+
require 'page_engine/routes_finder'
|
6
|
+
require 'RedCloth'
|
7
|
+
require 'bluecloth'
|
8
|
+
require 'haml'
|
9
|
+
require 'simple_form'
|
10
|
+
require 'awesome_nested_set'
|
11
|
+
|
12
|
+
module PageEngine
|
13
|
+
def self.class_exists?(class_name)
|
14
|
+
klass = Module.const_get(class_name)
|
15
|
+
return klass.is_a?(Class)
|
16
|
+
rescue NameError
|
17
|
+
return false
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.available_routes
|
21
|
+
available = {}
|
22
|
+
|
23
|
+
Rails.application.routes.routes.each do |route|
|
24
|
+
unless route.requirements.empty?
|
25
|
+
unless ['DELETE'].include?(route.verb.to_s) || route.requirements[:controller].match(/^admin.*/) || ['delete', :delete].include?(route.requirements[:method].to_s)
|
26
|
+
available[route.requirements[:controller]] = [] unless available[route.requirements[:controller]]
|
27
|
+
unless route.requirements[:controller] == 'pages' && route.requirements[:action] == 'show'
|
28
|
+
available[route.requirements[:controller]] << route.requirements[:action] unless available[route.requirements[:controller]].include?(route.requirements[:action])
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
available.delete('rails/info')
|
36
|
+
available
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
ActionView::Helpers::AssetTagHelper.register_javascript_expansion :page_engine => ["jquery-ui-1.8.15.custom.min", "jquery.ui.nestedSortable", "jquery.markitup", "markitup/sets/html/set", "markitup/sets/textile/set", "markitup/sets/markdown/set", "markitup/sets/css/set", "markitup/sets/javascript/set", "page_engine"]
|
41
|
+
ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion :page_engine => [ "markitup/skins/simple/style", "markitup/sets/html/style", "markitup/sets/textile/style", "markitup/sets/markdown/style", "markitup/sets/css/style", "markitup/sets/javascript/style", "page_engine"]
|
metadata
ADDED
@@ -0,0 +1,192 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: page_engine
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Mark Asson
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-08-24 00:00:00.000000000 +01:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: simple_form
|
17
|
+
requirement: &83050240 !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *83050240
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: RedCloth
|
28
|
+
requirement: &83049230 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *83049230
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: haml-rails
|
39
|
+
requirement: &83035610 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
type: :runtime
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *83035610
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: awesome_nested_set
|
50
|
+
requirement: &83034150 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
type: :runtime
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *83034150
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: BlueCloth
|
61
|
+
requirement: &83033550 !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ! '>='
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
type: :runtime
|
68
|
+
prerelease: false
|
69
|
+
version_requirements: *83033550
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rspec-rails
|
72
|
+
requirement: &83033060 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: *83033060
|
81
|
+
description: Extends a rails application with pages, allowing the generation of navigation,
|
82
|
+
breadcrumbs etc. Content can be currentl written in markdown, textile or plain html.
|
83
|
+
email: mark@fatdude.net
|
84
|
+
executables: []
|
85
|
+
extensions: []
|
86
|
+
extra_rdoc_files: []
|
87
|
+
files:
|
88
|
+
- app/helpers/pages_helper.rb
|
89
|
+
- app/controllers/pages_controller.rb
|
90
|
+
- app/controllers/admin/pages_controller.rb
|
91
|
+
- app/controllers/admin/page_snippets_controller.rb
|
92
|
+
- app/views/layouts/admin.html.haml
|
93
|
+
- app/views/admin/page_snippets/new.html.haml
|
94
|
+
- app/views/admin/page_snippets/show.html.erb
|
95
|
+
- app/views/admin/page_snippets/_form.html.haml
|
96
|
+
- app/views/admin/page_snippets/destroy.js.erb
|
97
|
+
- app/views/admin/page_snippets/edit.html.haml
|
98
|
+
- app/views/admin/page_snippets/index.html.haml
|
99
|
+
- app/views/admin/pages/new.html.haml
|
100
|
+
- app/views/admin/pages/sort.js.erb
|
101
|
+
- app/views/admin/pages/show.html.erb
|
102
|
+
- app/views/admin/pages/_page_list.html.haml
|
103
|
+
- app/views/admin/pages/duplicate.js.erb
|
104
|
+
- app/views/admin/pages/_form.html.haml
|
105
|
+
- app/views/admin/pages/destroy.js.erb
|
106
|
+
- app/views/admin/pages/_page.html.haml
|
107
|
+
- app/views/admin/pages/_page_part_fields.html.haml
|
108
|
+
- app/views/admin/pages/edit.html.haml
|
109
|
+
- app/views/admin/pages/index.html.haml
|
110
|
+
- app/views/pages/_nav_item.html.haml
|
111
|
+
- app/views/pages/show.html.erb
|
112
|
+
- app/views/pages/_navigation.html.haml
|
113
|
+
- app/views/pages/index.html.erb
|
114
|
+
- app/models/page_role.rb
|
115
|
+
- app/models/page_snippet.rb
|
116
|
+
- app/models/page_part.rb
|
117
|
+
- app/models/page.rb
|
118
|
+
- app/assets/images/page_engine/waiting.gif
|
119
|
+
- app/assets/images/page_engine/page_delete.png
|
120
|
+
- app/assets/images/page_engine/page_edit.png
|
121
|
+
- app/assets/images/page_engine/page_hidden.png
|
122
|
+
- app/assets/images/page_engine/page_copy.png
|
123
|
+
- app/assets/images/page_engine/page_add.png
|
124
|
+
- app/assets/images/page_engine/page_green.png
|
125
|
+
- app/assets/images/page_engine/add.png
|
126
|
+
- app/assets/images/page_engine/page_line.jpg
|
127
|
+
- app/assets/images/page_engine/page_lightning.png
|
128
|
+
- app/assets/images/page_engine/delete.png
|
129
|
+
- app/assets/images/page_engine/page_gear.png
|
130
|
+
- app/assets/images/page_engine/zoom.png
|
131
|
+
- app/assets/images/page_engine/pencil.png
|
132
|
+
- app/assets/images/page_engine/bullet_add.png
|
133
|
+
- app/assets/images/page_engine/bullet_go.png
|
134
|
+
- app/assets/images/page_engine/page_red.png
|
135
|
+
- app/assets/stylesheets/jquery-ui/smoothness/jquery-ui-1.8.15.custom.css
|
136
|
+
- app/assets/stylesheets/page_engine.css
|
137
|
+
- app/assets/stylesheets/markitup/sets/css/style.css
|
138
|
+
- app/assets/stylesheets/markitup/sets/html/style.css
|
139
|
+
- app/assets/stylesheets/markitup/sets/markdown/style.css
|
140
|
+
- app/assets/stylesheets/markitup/sets/javascript/style.css
|
141
|
+
- app/assets/stylesheets/markitup/sets/textile/style.css
|
142
|
+
- app/assets/stylesheets/markitup/skins/simple/style.css
|
143
|
+
- app/assets/stylesheets/markitup/skins/markitup/style.css
|
144
|
+
- app/assets/javascripts/markitup/sets/css/set.js
|
145
|
+
- app/assets/javascripts/markitup/sets/html/set.js
|
146
|
+
- app/assets/javascripts/markitup/sets/markdown/set.js
|
147
|
+
- app/assets/javascripts/markitup/sets/javascript/set.js
|
148
|
+
- app/assets/javascripts/markitup/sets/textile/set.js
|
149
|
+
- app/assets/javascripts/page_engine.js
|
150
|
+
- config/routes.rb
|
151
|
+
- db/seed.rb
|
152
|
+
- db/migrate/20110814185929_create_page_engine.rb
|
153
|
+
- lib/page_engine.rb
|
154
|
+
- lib/tasks/page_engine_tasks.rake
|
155
|
+
- lib/generators/page_engine/page_engine_generator.rb
|
156
|
+
- lib/page_engine/exceptions.rb
|
157
|
+
- lib/page_engine/routes_finder.rb
|
158
|
+
- lib/page_engine/class_methods.rb
|
159
|
+
- lib/page_engine/instance_methods.rb
|
160
|
+
- lib/page_engine/extensions.rb
|
161
|
+
- lib/page_engine/engine.rb
|
162
|
+
- lib/page_engine/helpers.rb
|
163
|
+
- lib/page_engine/defaults.rb
|
164
|
+
- MIT-LICENSE
|
165
|
+
- Rakefile
|
166
|
+
- README.markdown
|
167
|
+
has_rdoc: true
|
168
|
+
homepage: http://www.fatdude.net
|
169
|
+
licenses: []
|
170
|
+
post_install_message:
|
171
|
+
rdoc_options: []
|
172
|
+
require_paths:
|
173
|
+
- lib
|
174
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
175
|
+
none: false
|
176
|
+
requirements:
|
177
|
+
- - ! '>='
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '0'
|
180
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
|
+
none: false
|
182
|
+
requirements:
|
183
|
+
- - ! '>='
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
version: '0'
|
186
|
+
requirements: []
|
187
|
+
rubyforge_project:
|
188
|
+
rubygems_version: 1.6.2
|
189
|
+
signing_key:
|
190
|
+
specification_version: 3
|
191
|
+
summary: Extends a rails application with pages
|
192
|
+
test_files: []
|