cambium 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/cambium.gemspec +25 -23
  3. data/lib/cambium/version.rb +1 -1
  4. data/lib/generators/cambium/helpers/_autoloader.rb +12 -0
  5. data/lib/generators/cambium/helpers/dependencies_helper.rb +58 -0
  6. data/lib/generators/cambium/helpers/generators_helper.rb +227 -0
  7. data/lib/generators/cambium/install/admin_generator.rb +68 -74
  8. data/lib/generators/cambium/install/app_generator.rb +86 -95
  9. data/lib/generators/cambium/install/config_generator.rb +98 -108
  10. data/lib/generators/cambium/install/utilities_generator.rb +2 -50
  11. data/lib/generators/cambium/model/image_generator.rb +67 -0
  12. data/lib/generators/cambium/model/page_generator.rb +131 -0
  13. data/lib/generators/cambium/model/post_generator.rb +71 -0
  14. data/lib/generators/cambium/model/tag_generator.rb +40 -0
  15. data/lib/generators/cambium/model/user_generator.rb +78 -0
  16. data/lib/generators/cambium/templates/Gemfile +43 -0
  17. data/lib/generators/cambium/templates/_partials/pages/admin_icon.rb +6 -0
  18. data/lib/generators/cambium/templates/app/assets/javascripts/admin/admin.js.coffee +3 -1
  19. data/lib/generators/cambium/templates/app/assets/javascripts/admin/models/image.js.coffee +14 -0
  20. data/lib/generators/cambium/templates/app/assets/javascripts/admin/models/tag.js.coffee +14 -0
  21. data/lib/generators/cambium/templates/app/assets/javascripts/admin/parser_rules/custom.js +552 -0
  22. data/lib/generators/cambium/templates/app/assets/javascripts/admin/routers/router.js.coffee +21 -0
  23. data/lib/generators/cambium/templates/app/assets/javascripts/admin/tag.jst.ejs +7 -0
  24. data/lib/generators/cambium/templates/app/assets/javascripts/admin/templates/image.jst.ejs +3 -0
  25. data/lib/generators/cambium/templates/app/assets/javascripts/admin/templates/post_tag.jst.ejs +1 -0
  26. data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/image_upload.js.coffee +28 -0
  27. data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/tags.js.coffee +158 -0
  28. data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/wysiwyg.js.coffee +77 -0
  29. data/lib/generators/cambium/templates/app/controllers/admin/images_controller.rb +45 -0
  30. data/lib/generators/cambium/templates/app/controllers/admin/pages_controller.rb +42 -0
  31. data/lib/generators/cambium/templates/app/controllers/admin/posts_controller.rb +39 -0
  32. data/lib/generators/cambium/templates/app/controllers/admin/taggings_controller.rb +69 -0
  33. data/lib/generators/cambium/templates/app/controllers/admin/tags_controller.rb +11 -0
  34. data/lib/generators/cambium/templates/app/controllers/admin_controller.rb +11 -2
  35. data/lib/generators/cambium/templates/app/controllers/application_controller.rb +2 -2
  36. data/lib/generators/cambium/templates/app/controllers/images_controller.rb +45 -0
  37. data/lib/generators/cambium/templates/app/controllers/pages_controller.rb +12 -0
  38. data/lib/generators/cambium/templates/app/controllers/posts_controller.rb +11 -0
  39. data/lib/generators/cambium/templates/app/helpers/admin/pages_controller.rb +47 -0
  40. data/lib/generators/cambium/templates/app/helpers/admin_helper.rb +1 -1
  41. data/lib/generators/cambium/templates/app/models/concerns/image_cropper.rb +24 -0
  42. data/lib/generators/cambium/templates/app/models/concerns/publishable.rb +32 -4
  43. data/lib/generators/cambium/templates/app/models/concerns/slug.rb +4 -0
  44. data/lib/generators/cambium/templates/app/models/concerns/tags.rb +6 -1
  45. data/lib/generators/cambium/templates/app/models/image.rb +43 -0
  46. data/lib/generators/cambium/templates/app/models/page.rb +81 -0
  47. data/lib/generators/cambium/templates/app/models/post.rb +45 -0
  48. data/lib/generators/cambium/templates/app/models/tag.rb +33 -0
  49. data/lib/generators/cambium/templates/app/models/tagging.rb +20 -0
  50. data/lib/generators/cambium/templates/app/uploaders/image_uploader.rb +91 -0
  51. data/lib/generators/cambium/templates/app/views/admin/images/_image.html.erb +1 -0
  52. data/lib/generators/cambium/templates/app/views/admin/images/create.js.erb +7 -0
  53. data/lib/generators/cambium/templates/app/views/admin/images/index.json.jbuilder +4 -0
  54. data/lib/generators/cambium/templates/app/views/admin/pages/_form.html.erb +26 -0
  55. data/lib/generators/cambium/templates/app/views/admin/posts/_form.html.erb +40 -0
  56. data/lib/generators/cambium/templates/app/views/admin/shared/_insert_image.html.erb +12 -0
  57. data/lib/generators/cambium/templates/app/views/admin/shared/forms/_editor.html.erb +3 -3
  58. data/lib/generators/cambium/templates/app/views/admin/shared/forms/_form_page.html.erb +5 -1
  59. data/lib/generators/cambium/templates/app/views/home/index.html.erb +7 -0
  60. data/lib/generators/cambium/templates/app/views/page_templates/default.html.erb +2 -0
  61. data/lib/generators/cambium/templates/app/views/posts/_post.html.erb +4 -0
  62. data/lib/generators/cambium/templates/app/views/posts/index.html.erb +1 -0
  63. data/lib/generators/cambium/templates/app/views/posts/show.html.erb +10 -0
  64. data/lib/generators/cambium/templates/config/app_routes.rb +77 -0
  65. data/lib/generators/cambium/templates/config/routes.rb.erb +11 -2
  66. data/lib/generators/cambium/templates/db/migrate/create_pages.rb.erb +24 -0
  67. data/lib/generators/cambium/templates/db/migrate/create_posts.rb +19 -0
  68. data/lib/generators/cambium/templates/gitignore +1 -0
  69. metadata +52 -256
  70. data/lib/generators/cambium/install/users_generator.rb +0 -104
  71. data/lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_icons.scss +0 -5194
@@ -1,19 +1,28 @@
1
1
  <%= Rails.application.class.parent_name %>::Application.routes.draw do
2
2
 
3
- # ------------------------------------------ Devise
3
+ <% if defined?(User) == 'constant' && User.class == Class %> # ------------------------------------------ Devise
4
4
 
5
5
  devise_for :users, skip: [:sessions, :registrations]
6
6
  devise_scope :user do
7
7
  get '/login' => 'devise/sessions#new', :as => :new_user_session
8
8
  post '/login' => 'devise/sessions#create', :as => :user_session
9
9
  get '/logout' => 'devise/sessions#destroy', :as => :destroy_user_session
10
- end
10
+ end<% end %>
11
11
 
12
12
  # ------------------------------------------ Admin
13
13
 
14
14
  get '/admin' => 'admin#dashboard', :as => :admin_dashboard
15
15
  namespace :admin do
16
16
  resources :users, :except => [:show]
17
+ <% if defined?(Page) == 'constant' && Page.class == Class %>
18
+ resources :pages, :except => [:show]
19
+ <% end %>
20
+ <% if defined?(Post) == 'constant' && Post.class == Class %>
21
+ resources :posts, :except => [:show]
22
+ <% end %>
23
+ scope 'json' do
24
+ resources :images, only: [:index, :create, :destroy]
25
+ end
17
26
  end
18
27
 
19
28
  # ------------------------------------------ Public
@@ -0,0 +1,24 @@
1
+ class CreatePages < ActiveRecord::Migration
2
+
3
+ def up
4
+ create_table :pages do |t|
5
+ t.string :title
6
+ t.text :body
7
+ t.text :description
8
+ t.string :template
9
+ t.string :slug
10
+ t.string :ancestry
11
+ t.integer :position
12
+ t.boolean :in_nav
13
+ t.datetime :active_at, default: nil
14
+ t.datetime :inactive_at, default: nil
15
+ t.json :template_data
16
+ t.timestamps
17
+ end
18
+ end
19
+
20
+ def down
21
+ drop_table :pages
22
+ end
23
+
24
+ end
@@ -0,0 +1,19 @@
1
+ class CreatePosts < ActiveRecord::Migration
2
+ def up
3
+ create_table "posts", force: true do |t|
4
+ t.string "title"
5
+ t.text "body"
6
+ t.string "slug"
7
+ t.datetime "active_at"
8
+ t.datetime "inactive_at"
9
+ t.datetime "created_at"
10
+ t.datetime "updated_at"
11
+ t.string "main_image"
12
+ t.integer "user_id"
13
+ t.boolean "is_featured", default: false
14
+ end
15
+ end
16
+ def down
17
+ remove_table :posts
18
+ end
19
+ end
@@ -24,6 +24,7 @@ config/settings_private.yml
24
24
  # Public Uploads
25
25
  public/uploads/
26
26
  public/files/
27
+ public/media/
27
28
 
28
29
  # Stupid Files
29
30
  *.DS_Store
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cambium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean C Davis
8
+ - Warren Harrison
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-07-16 00:00:00.000000000 Z
12
+ date: 2014-12-15 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
@@ -52,261 +53,10 @@ dependencies:
52
53
  - - ">="
53
54
  - !ruby/object:Gem::Version
54
55
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: annotate
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: backbone-on-rails
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: bones-rails
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: bourbon
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: carrierwave
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :runtime
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: coffee-rails
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :runtime
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: devise
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :runtime
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
- - !ruby/object:Gem::Dependency
154
- name: factory_girl_rails
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :runtime
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: '0'
167
- - !ruby/object:Gem::Dependency
168
- name: faker
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - ">="
172
- - !ruby/object:Gem::Version
173
- version: '0'
174
- type: :runtime
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ">="
179
- - !ruby/object:Gem::Version
180
- version: '0'
181
- - !ruby/object:Gem::Dependency
182
- name: hirb
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - ">="
186
- - !ruby/object:Gem::Version
187
- version: '0'
188
- type: :runtime
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- version: '0'
195
- - !ruby/object:Gem::Dependency
196
- name: jbuilder
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- version: '0'
202
- type: :runtime
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - ">="
207
- - !ruby/object:Gem::Version
208
- version: '0'
209
- - !ruby/object:Gem::Dependency
210
- name: jquery-rails
211
- requirement: !ruby/object:Gem::Requirement
212
- requirements:
213
- - - ">="
214
- - !ruby/object:Gem::Version
215
- version: '0'
216
- type: :runtime
217
- prerelease: false
218
- version_requirements: !ruby/object:Gem::Requirement
219
- requirements:
220
- - - ">="
221
- - !ruby/object:Gem::Version
222
- version: '0'
223
- - !ruby/object:Gem::Dependency
224
- name: pickadate-rails
225
- requirement: !ruby/object:Gem::Requirement
226
- requirements:
227
- - - ">="
228
- - !ruby/object:Gem::Version
229
- version: '0'
230
- type: :runtime
231
- prerelease: false
232
- version_requirements: !ruby/object:Gem::Requirement
233
- requirements:
234
- - - ">="
235
- - !ruby/object:Gem::Version
236
- version: '0'
237
- - !ruby/object:Gem::Dependency
238
- name: sass-rails
239
- requirement: !ruby/object:Gem::Requirement
240
- requirements:
241
- - - ">="
242
- - !ruby/object:Gem::Version
243
- version: '0'
244
- type: :runtime
245
- prerelease: false
246
- version_requirements: !ruby/object:Gem::Requirement
247
- requirements:
248
- - - ">="
249
- - !ruby/object:Gem::Version
250
- version: '0'
251
- - !ruby/object:Gem::Dependency
252
- name: simple_form
253
- requirement: !ruby/object:Gem::Requirement
254
- requirements:
255
- - - ">="
256
- - !ruby/object:Gem::Version
257
- version: '0'
258
- type: :runtime
259
- prerelease: false
260
- version_requirements: !ruby/object:Gem::Requirement
261
- requirements:
262
- - - ">="
263
- - !ruby/object:Gem::Version
264
- version: '0'
265
- - !ruby/object:Gem::Dependency
266
- name: uglifier
267
- requirement: !ruby/object:Gem::Requirement
268
- requirements:
269
- - - ">="
270
- - !ruby/object:Gem::Version
271
- version: '0'
272
- type: :runtime
273
- prerelease: false
274
- version_requirements: !ruby/object:Gem::Requirement
275
- requirements:
276
- - - ">="
277
- - !ruby/object:Gem::Version
278
- version: '0'
279
- - !ruby/object:Gem::Dependency
280
- name: unicorn-rails
281
- requirement: !ruby/object:Gem::Requirement
282
- requirements:
283
- - - ">="
284
- - !ruby/object:Gem::Version
285
- version: '0'
286
- type: :runtime
287
- prerelease: false
288
- version_requirements: !ruby/object:Gem::Requirement
289
- requirements:
290
- - - ">="
291
- - !ruby/object:Gem::Version
292
- version: '0'
293
- - !ruby/object:Gem::Dependency
294
- name: wysihtml5-rails
295
- requirement: !ruby/object:Gem::Requirement
296
- requirements:
297
- - - ">="
298
- - !ruby/object:Gem::Version
299
- version: '0'
300
- type: :runtime
301
- prerelease: false
302
- version_requirements: !ruby/object:Gem::Requirement
303
- requirements:
304
- - - ">="
305
- - !ruby/object:Gem::Version
306
- version: '0'
307
56
  description: ''
308
57
  email:
309
58
  - scdavis41@gmail.com
59
+ - warren@hungry-media.com
310
60
  executables:
311
61
  - cambium
312
62
  extensions: []
@@ -322,25 +72,42 @@ files:
322
72
  - lib/cambium.rb
323
73
  - lib/cambium/engine.rb
324
74
  - lib/cambium/version.rb
75
+ - lib/generators/cambium/helpers/_autoloader.rb
76
+ - lib/generators/cambium/helpers/dependencies_helper.rb
77
+ - lib/generators/cambium/helpers/generators_helper.rb
325
78
  - lib/generators/cambium/install/admin_generator.rb
326
79
  - lib/generators/cambium/install/app_generator.rb
327
80
  - lib/generators/cambium/install/config_generator.rb
328
- - lib/generators/cambium/install/users_generator.rb
329
81
  - lib/generators/cambium/install/utilities_generator.rb
82
+ - lib/generators/cambium/model/image_generator.rb
83
+ - lib/generators/cambium/model/page_generator.rb
84
+ - lib/generators/cambium/model/post_generator.rb
85
+ - lib/generators/cambium/model/tag_generator.rb
86
+ - lib/generators/cambium/model/user_generator.rb
87
+ - lib/generators/cambium/templates/Gemfile
330
88
  - lib/generators/cambium/templates/Gemfile.erb
89
+ - lib/generators/cambium/templates/_partials/pages/admin_icon.rb
331
90
  - lib/generators/cambium/templates/app/assets/javascripts/.DS_Store
332
91
  - lib/generators/cambium/templates/app/assets/javascripts/admin/admin.js.coffee
333
92
  - lib/generators/cambium/templates/app/assets/javascripts/admin/collections/.gitkeep
334
93
  - lib/generators/cambium/templates/app/assets/javascripts/admin/models/.gitkeep
94
+ - lib/generators/cambium/templates/app/assets/javascripts/admin/models/image.js.coffee
95
+ - lib/generators/cambium/templates/app/assets/javascripts/admin/models/tag.js.coffee
96
+ - lib/generators/cambium/templates/app/assets/javascripts/admin/parser_rules/custom.js
335
97
  - lib/generators/cambium/templates/app/assets/javascripts/admin/routers/router.js.coffee
98
+ - lib/generators/cambium/templates/app/assets/javascripts/admin/tag.jst.ejs
99
+ - lib/generators/cambium/templates/app/assets/javascripts/admin/templates/image.jst.ejs
336
100
  - lib/generators/cambium/templates/app/assets/javascripts/admin/templates/paginator_controls.jst.ejs
337
101
  - lib/generators/cambium/templates/app/assets/javascripts/admin/templates/paginator_nav.jst.ejs
102
+ - lib/generators/cambium/templates/app/assets/javascripts/admin/templates/post_tag.jst.ejs
338
103
  - lib/generators/cambium/templates/app/assets/javascripts/admin/views/accordion.js.coffee
339
104
  - lib/generators/cambium/templates/app/assets/javascripts/admin/views/counter.js.coffee
340
105
  - lib/generators/cambium/templates/app/assets/javascripts/admin/views/dropdown_toggle.js.coffee
106
+ - lib/generators/cambium/templates/app/assets/javascripts/admin/views/image_upload.js.coffee
341
107
  - lib/generators/cambium/templates/app/assets/javascripts/admin/views/init_counter.js.coffee
342
108
  - lib/generators/cambium/templates/app/assets/javascripts/admin/views/paginator.js.coffee
343
109
  - lib/generators/cambium/templates/app/assets/javascripts/admin/views/publishable.js.coffee
110
+ - lib/generators/cambium/templates/app/assets/javascripts/admin/views/tags.js.coffee
344
111
  - lib/generators/cambium/templates/app/assets/javascripts/admin/views/wysiwyg.js.coffee
345
112
  - lib/generators/cambium/templates/app/assets/javascripts/admin/wysihtml5.js
346
113
  - lib/generators/cambium/templates/app/assets/javascripts/application.js
@@ -367,30 +134,51 @@ files:
367
134
  - lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_form.scss
368
135
  - lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_globals.scss
369
136
  - lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_header.scss
370
- - lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_icons.scss
371
137
  - lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_nav.scss
372
138
  - lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_wireframe.scss
373
139
  - lib/generators/cambium/templates/app/assets/stylesheets/admin/wysihtml5.css
374
140
  - lib/generators/cambium/templates/app/assets/stylesheets/application.scss
141
+ - lib/generators/cambium/templates/app/controllers/admin/images_controller.rb
142
+ - lib/generators/cambium/templates/app/controllers/admin/pages_controller.rb
143
+ - lib/generators/cambium/templates/app/controllers/admin/posts_controller.rb
144
+ - lib/generators/cambium/templates/app/controllers/admin/taggings_controller.rb
145
+ - lib/generators/cambium/templates/app/controllers/admin/tags_controller.rb
375
146
  - lib/generators/cambium/templates/app/controllers/admin/users_controller.rb
376
147
  - lib/generators/cambium/templates/app/controllers/admin_controller.rb
377
148
  - lib/generators/cambium/templates/app/controllers/application_controller.rb
149
+ - lib/generators/cambium/templates/app/controllers/images_controller.rb
150
+ - lib/generators/cambium/templates/app/controllers/pages_controller.rb
151
+ - lib/generators/cambium/templates/app/controllers/posts_controller.rb
152
+ - lib/generators/cambium/templates/app/helpers/admin/pages_controller.rb
378
153
  - lib/generators/cambium/templates/app/helpers/admin_helper.rb
379
154
  - lib/generators/cambium/templates/app/models/concerns/idx.rb
155
+ - lib/generators/cambium/templates/app/models/concerns/image_cropper.rb
380
156
  - lib/generators/cambium/templates/app/models/concerns/name.rb
381
157
  - lib/generators/cambium/templates/app/models/concerns/publishable.rb
382
158
  - lib/generators/cambium/templates/app/models/concerns/slug.rb
383
159
  - lib/generators/cambium/templates/app/models/concerns/tags.rb
384
160
  - lib/generators/cambium/templates/app/models/concerns/title.rb
161
+ - lib/generators/cambium/templates/app/models/image.rb
162
+ - lib/generators/cambium/templates/app/models/page.rb
163
+ - lib/generators/cambium/templates/app/models/post.rb
164
+ - lib/generators/cambium/templates/app/models/tag.rb
165
+ - lib/generators/cambium/templates/app/models/tagging.rb
385
166
  - lib/generators/cambium/templates/app/models/user.rb
167
+ - lib/generators/cambium/templates/app/uploaders/image_uploader.rb
386
168
  - lib/generators/cambium/templates/app/views/admin/_buttons.html.erb
387
169
  - lib/generators/cambium/templates/app/views/admin/_form.html.erb
388
170
  - lib/generators/cambium/templates/app/views/admin/_title.html.erb
389
171
  - lib/generators/cambium/templates/app/views/admin/edit.html.erb
172
+ - lib/generators/cambium/templates/app/views/admin/images/_image.html.erb
173
+ - lib/generators/cambium/templates/app/views/admin/images/create.js.erb
174
+ - lib/generators/cambium/templates/app/views/admin/images/index.json.jbuilder
390
175
  - lib/generators/cambium/templates/app/views/admin/index.html.erb
391
176
  - lib/generators/cambium/templates/app/views/admin/new.html.erb
177
+ - lib/generators/cambium/templates/app/views/admin/pages/_form.html.erb
178
+ - lib/generators/cambium/templates/app/views/admin/posts/_form.html.erb
392
179
  - lib/generators/cambium/templates/app/views/admin/shared/_footer.html.erb
393
180
  - lib/generators/cambium/templates/app/views/admin/shared/_header.html.erb
181
+ - lib/generators/cambium/templates/app/views/admin/shared/_insert_image.html.erb
394
182
  - lib/generators/cambium/templates/app/views/admin/shared/_nav.html.erb
395
183
  - lib/generators/cambium/templates/app/views/admin/shared/_status.html.erb
396
184
  - lib/generators/cambium/templates/app/views/admin/shared/forms/_editor.html.erb
@@ -401,9 +189,15 @@ files:
401
189
  - lib/generators/cambium/templates/app/views/admin/shared/forms/_publishable.html.erb
402
190
  - lib/generators/cambium/templates/app/views/admin/users/_form.html.erb
403
191
  - lib/generators/cambium/templates/app/views/application/_status.html.erb
192
+ - lib/generators/cambium/templates/app/views/home/index.html.erb
404
193
  - lib/generators/cambium/templates/app/views/layouts/.DS_Store
405
194
  - lib/generators/cambium/templates/app/views/layouts/admin.html.erb
406
195
  - lib/generators/cambium/templates/app/views/layouts/application.html.erb
196
+ - lib/generators/cambium/templates/app/views/page_templates/default.html.erb
197
+ - lib/generators/cambium/templates/app/views/posts/_post.html.erb
198
+ - lib/generators/cambium/templates/app/views/posts/index.html.erb
199
+ - lib/generators/cambium/templates/app/views/posts/show.html.erb
200
+ - lib/generators/cambium/templates/config/app_routes.rb
407
201
  - lib/generators/cambium/templates/config/application.rb
408
202
  - lib/generators/cambium/templates/config/database.mysql2.yml.erb
409
203
  - lib/generators/cambium/templates/config/database.pg.yml.erb
@@ -414,6 +208,8 @@ files:
414
208
  - lib/generators/cambium/templates/config/settings.yml
415
209
  - lib/generators/cambium/templates/config/settings_private.sample.yml
416
210
  - lib/generators/cambium/templates/config/settings_private.yml
211
+ - lib/generators/cambium/templates/db/migrate/create_pages.rb.erb
212
+ - lib/generators/cambium/templates/db/migrate/create_posts.rb
417
213
  - lib/generators/cambium/templates/db/seeds.rb
418
214
  - lib/generators/cambium/templates/gitignore
419
215
  - lib/generators/cambium/templates/lib/.DS_Store
@@ -1,104 +0,0 @@
1
- require 'rake'
2
- require 'rails/generators'
3
-
4
- module Cambium
5
- module Install
6
- class UsersGenerator < Rails::Generators::Base
7
- desc "Setup users model for new rails project"
8
-
9
- source_root File.expand_path('../../templates', __FILE__)
10
-
11
- # ------------------------------------------ Install Devise
12
-
13
- def install_devise
14
- unless File.exist?("#{Rails.root}/config/initializers/devise.rb")
15
- run_cmd "#{g} devise:install"
16
- end
17
- unless File.exist?("#{Rails.root}/app/models/user.rb")
18
- run_cmd "#{g} devise User"
19
- end
20
- end
21
-
22
- # ------------------------------------------ User Model
23
-
24
- def add_admin_column_to_users
25
- file = Dir.glob("#{Rails.root}/db/migrate/*devise_create_users.rb").first
26
- insert_into_file(
27
- file,
28
- "## Admin\n t.boolean :is_admin, :default => false \n\n ",
29
- :before => "t.timestamps"
30
- )
31
- end
32
-
33
- def add_user_model_file
34
- remove_file "app/models/user.rb"
35
- template "app/models/user.rb", "app/models/user.rb"
36
- end
37
-
38
- def migrate_and_annotate
39
- run_cmd "#{rake} db:migrate"
40
- run_cmd "#{be} annotate"
41
- end
42
-
43
- # ------------------------------------------ Log In/Out Redirects
44
-
45
- def add_application_controller_redirects
46
- insert_into_file(
47
- "app/controllers/application_controller.rb",
48
- file_contents("app/controllers/application_controller.rb"),
49
- :after => ":exception"
50
- )
51
- end
52
-
53
- # ------------------------------------------ Private Methods
54
-
55
- private
56
-
57
- def run_cmd(cmd, options = {})
58
- print_table(
59
- [
60
- [set_color("run", :green, :bold), cmd]
61
- ],
62
- :indent => 9
63
- )
64
- if options[:quiet] == true
65
- `#{cmd}`
66
- else
67
- system(cmd)
68
- end
69
- end
70
-
71
- def template_file(name)
72
- File.expand_path("../../templates/#{name}", __FILE__)
73
- end
74
-
75
- def file_contents(template)
76
- File.read(template_file(template))
77
- end
78
-
79
- def be
80
- "bundle exec"
81
- end
82
-
83
- def g
84
- "#{be} rails g"
85
- end
86
-
87
- def rake
88
- "#{be} rake"
89
- end
90
-
91
- def confirm_ask(question)
92
- answer = ask("\n#{question}")
93
- match = ask("CONFIRM #{question}")
94
- if answer == match
95
- answer
96
- else
97
- say set_color("Did not match.", :red)
98
- confirm_ask(question)
99
- end
100
- end
101
-
102
- end
103
- end
104
- end