page_engine 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.markdown +74 -0
  3. data/Rakefile +39 -0
  4. data/app/assets/images/page_engine/add.png +0 -0
  5. data/app/assets/images/page_engine/bullet_add.png +0 -0
  6. data/app/assets/images/page_engine/bullet_go.png +0 -0
  7. data/app/assets/images/page_engine/delete.png +0 -0
  8. data/app/assets/images/page_engine/page_add.png +0 -0
  9. data/app/assets/images/page_engine/page_copy.png +0 -0
  10. data/app/assets/images/page_engine/page_delete.png +0 -0
  11. data/app/assets/images/page_engine/page_edit.png +0 -0
  12. data/app/assets/images/page_engine/page_gear.png +0 -0
  13. data/app/assets/images/page_engine/page_green.png +0 -0
  14. data/app/assets/images/page_engine/page_hidden.png +0 -0
  15. data/app/assets/images/page_engine/page_lightning.png +0 -0
  16. data/app/assets/images/page_engine/page_line.jpg +0 -0
  17. data/app/assets/images/page_engine/page_red.png +0 -0
  18. data/app/assets/images/page_engine/pencil.png +0 -0
  19. data/app/assets/images/page_engine/waiting.gif +0 -0
  20. data/app/assets/images/page_engine/zoom.png +0 -0
  21. data/app/assets/javascripts/markitup/sets/css/set.js +52 -0
  22. data/app/assets/javascripts/markitup/sets/html/set.js +64 -0
  23. data/app/assets/javascripts/markitup/sets/javascript/set.js +6 -0
  24. data/app/assets/javascripts/markitup/sets/markdown/set.js +53 -0
  25. data/app/assets/javascripts/markitup/sets/textile/set.js +57 -0
  26. data/app/assets/javascripts/page_engine.js +189 -0
  27. data/app/assets/stylesheets/jquery-ui/smoothness/jquery-ui-1.8.15.custom.css +307 -0
  28. data/app/assets/stylesheets/markitup/sets/css/style.css +69 -0
  29. data/app/assets/stylesheets/markitup/sets/html/style.css +58 -0
  30. data/app/assets/stylesheets/markitup/sets/javascript/style.css +0 -0
  31. data/app/assets/stylesheets/markitup/sets/markdown/style.css +49 -0
  32. data/app/assets/stylesheets/markitup/sets/textile/style.css +58 -0
  33. data/app/assets/stylesheets/markitup/skins/markitup/style.css +147 -0
  34. data/app/assets/stylesheets/markitup/skins/simple/style.css +118 -0
  35. data/app/assets/stylesheets/page_engine.css +231 -0
  36. data/app/controllers/admin/page_snippets_controller.rb +64 -0
  37. data/app/controllers/admin/pages_controller.rb +167 -0
  38. data/app/controllers/pages_controller.rb +20 -0
  39. data/app/helpers/pages_helper.rb +234 -0
  40. data/app/models/page.rb +233 -0
  41. data/app/models/page_part.rb +35 -0
  42. data/app/models/page_role.rb +15 -0
  43. data/app/models/page_snippet.rb +30 -0
  44. data/app/views/admin/page_snippets/_form.html.haml +10 -0
  45. data/app/views/admin/page_snippets/destroy.js.erb +3 -0
  46. data/app/views/admin/page_snippets/edit.html.haml +6 -0
  47. data/app/views/admin/page_snippets/index.html.haml +20 -0
  48. data/app/views/admin/page_snippets/new.html.haml +6 -0
  49. data/app/views/admin/page_snippets/show.html.erb +20 -0
  50. data/app/views/admin/pages/_form.html.haml +56 -0
  51. data/app/views/admin/pages/_page.html.haml +19 -0
  52. data/app/views/admin/pages/_page_list.html.haml +2 -0
  53. data/app/views/admin/pages/_page_part_fields.html.haml +9 -0
  54. data/app/views/admin/pages/destroy.js.erb +1 -0
  55. data/app/views/admin/pages/duplicate.js.erb +5 -0
  56. data/app/views/admin/pages/edit.html.haml +9 -0
  57. data/app/views/admin/pages/index.html.haml +10 -0
  58. data/app/views/admin/pages/new.html.haml +10 -0
  59. data/app/views/admin/pages/show.html.erb +100 -0
  60. data/app/views/admin/pages/sort.js.erb +3 -0
  61. data/app/views/layouts/admin.html.haml +20 -0
  62. data/app/views/pages/_nav_item.html.haml +10 -0
  63. data/app/views/pages/_navigation.html.haml +11 -0
  64. data/app/views/pages/index.html.erb +2 -0
  65. data/app/views/pages/show.html.erb +2 -0
  66. data/config/routes.rb +23 -0
  67. data/db/migrate/20110814185929_create_page_engine.rb +77 -0
  68. data/db/seed.rb +8 -0
  69. data/lib/generators/page_engine/page_engine_generator.rb +59 -0
  70. data/lib/page_engine/class_methods.rb +4 -0
  71. data/lib/page_engine/defaults.rb +5 -0
  72. data/lib/page_engine/engine.rb +4 -0
  73. data/lib/page_engine/exceptions.rb +4 -0
  74. data/lib/page_engine/extensions.rb +24 -0
  75. data/lib/page_engine/helpers.rb +10 -0
  76. data/lib/page_engine/instance_methods.rb +82 -0
  77. data/lib/page_engine/routes_finder.rb +23 -0
  78. data/lib/page_engine.rb +41 -0
  79. data/lib/tasks/page_engine_tasks.rake +4 -0
  80. metadata +192 -0
@@ -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"]
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :page_engine do
3
+ # # Task goes here
4
+ # end
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: []