merrycms 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/README +15 -0
  2. data/app/controllers/admin/base_controller.rb +11 -0
  3. data/app/controllers/admin/categories_controller.rb +63 -0
  4. data/app/controllers/admin/pages_controller.rb +73 -0
  5. data/app/controllers/admin/translations_controller.rb +55 -0
  6. data/app/controllers/admin/users_controller.rb +53 -0
  7. data/app/helpers/admin/categories_helper.rb +32 -0
  8. data/app/helpers/admin/pages_helper.rb +24 -0
  9. data/app/helpers/admin/translations_helper.rb +25 -0
  10. data/app/helpers/admin/users_helper.rb +10 -0
  11. data/app/models/category.rb +11 -0
  12. data/app/models/page.rb +66 -0
  13. data/app/models/role.rb +6 -0
  14. data/app/models/translation.rb +48 -0
  15. data/app/models/user.rb +42 -0
  16. data/app/views/admin/_nav.html.erb +10 -0
  17. data/app/views/admin/categories/_form.erb +24 -0
  18. data/app/views/admin/categories/edit.html.erb +3 -0
  19. data/app/views/admin/categories/index.html.erb +22 -0
  20. data/app/views/admin/categories/new.html.erb +3 -0
  21. data/app/views/admin/categories/sort.html.erb +29 -0
  22. data/app/views/admin/pages/_form.html.erb +25 -0
  23. data/app/views/admin/pages/_search.erb +15 -0
  24. data/app/views/admin/pages/edit.html.erb +3 -0
  25. data/app/views/admin/pages/index.html.erb +32 -0
  26. data/app/views/admin/pages/new.html.erb +3 -0
  27. data/app/views/admin/translations/_filter.html.erb +8 -0
  28. data/app/views/admin/translations/destroy.js +4 -0
  29. data/app/views/admin/translations/index.html.erb +40 -0
  30. data/app/views/admin/translations/new.html.erb +49 -0
  31. data/app/views/admin/users/_form.html.erb +33 -0
  32. data/app/views/admin/users/edit.html.erb +3 -0
  33. data/app/views/admin/users/index.html.erb +18 -0
  34. data/app/views/admin/users/new.html.erb +3 -0
  35. data/app/views/devise/confirmations/new.html.erb +10 -0
  36. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  37. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  38. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  39. data/app/views/devise/passwords/edit.html.erb +15 -0
  40. data/app/views/devise/passwords/new.html.erb +16 -0
  41. data/app/views/devise/registrations/edit.html.erb +24 -0
  42. data/app/views/devise/registrations/new.html.erb +31 -0
  43. data/app/views/devise/sessions/new.html.erb +24 -0
  44. data/app/views/devise/shared/_links.erb +19 -0
  45. data/app/views/devise/unlocks/new.html.erb +11 -0
  46. data/app/views/layouts/admin.html.erb +22 -0
  47. data/app/views/layouts/login.html.erb +17 -0
  48. data/app/views/shared/_error_messages.html.erb +9 -0
  49. data/app/views/shared/_flashbox.html.erb +5 -0
  50. data/app/views/shared/_toplinks.html.erb +8 -0
  51. data/config/locales/en/admin/missing.yml +4 -0
  52. data/config/locales/fr/admin/admin.fr.yml +9 -0
  53. data/config/locales/fr/admin/category.fr.yml +22 -0
  54. data/config/locales/fr/admin/devise.fr.yml +129 -0
  55. data/config/locales/fr/admin/merrycms.fr.yml +6 -0
  56. data/config/locales/fr/admin/missing.yml +5 -0
  57. data/config/locales/fr/admin/pages.fr.yml +51 -0
  58. data/config/locales/fr/admin/pagination.fr.yml +6 -0
  59. data/config/locales/fr/admin/toplinks.fr.yml +9 -0
  60. data/config/locales/fr/admin/translations.fr.yml +46 -0
  61. data/config/locales/fr/admin/users.fr.yml +14 -0
  62. data/lib/generators/merrycms/install_generator.rb +78 -0
  63. data/lib/generators/merrycms/templates/create_pages_and_categories_migration.rb +36 -0
  64. data/lib/generators/merrycms/templates/create_roles_migration.rb +14 -0
  65. data/lib/generators/merrycms/templates/create_translations_migration.rb +17 -0
  66. data/lib/generators/merrycms/templates/devise_create_users_migration.rb +26 -0
  67. data/lib/generators/merrycms/templates/devise_initializer.rb +142 -0
  68. data/lib/generators/merrycms/templates/locale_initializer.rb +10 -0
  69. data/lib/generators/merrycms/templates/roles_users_migration.rb +13 -0
  70. data/lib/generators/merrycms/views_generator.rb +11 -0
  71. data/lib/merrycms/engine.rb +38 -0
  72. data/lib/merrycms/rails/routes.rb +35 -0
  73. data/lib/merrycms/railties/merrycms_tasks.rake +72 -0
  74. data/lib/merrycms.rb +1 -0
  75. metadata +270 -0
@@ -0,0 +1,35 @@
1
+ module ActionDispatch::Routing
2
+
3
+ class Mapper
4
+
5
+ def merrycms_routes
6
+ namespace :admin do
7
+ resources :users
8
+ resources :pages do
9
+ member do
10
+ get 'publish'
11
+ get 'unpublish'
12
+ get 'archive'
13
+ get 'unarchive'
14
+ end
15
+ end
16
+ resources :categories do
17
+ member do
18
+ get 'sort'
19
+ end
20
+ collection do
21
+ get 'sorting'
22
+ end
23
+ end
24
+ resources :translations do
25
+ collection do
26
+ get 'dump'
27
+ end
28
+ end
29
+ root :to => 'pages#index'
30
+ end
31
+ end
32
+
33
+ end
34
+
35
+ end
@@ -0,0 +1,72 @@
1
+ namespace :merrycms do
2
+
3
+ desc "setup"
4
+ task :setup => :environment do
5
+ system("rails generate merrycms:install")
6
+ Rake::Task['db:migrate'].invoke
7
+ Rake::Task['merrycms:bootstrap'].invoke
8
+ Rake::Task['jquery:install'].invoke
9
+ end
10
+
11
+ desc "bootstrap app"
12
+ task :bootstrap => :environment do
13
+ create_admins
14
+ create_root_cat
15
+ end
16
+
17
+ def create_admins
18
+ users = [{
19
+ :email => "franck.dagostini@gmail.com",
20
+ :password => "adminadmin",
21
+ :password_confirmation => "adminadmin"
22
+ }]
23
+
24
+ for user in users
25
+ u = User.find_or_create_by_email(user)
26
+ u.has_role!('admin')
27
+ end
28
+ end
29
+
30
+ def create_root_cat
31
+ Category.find_or_create_by_name("root")
32
+ end
33
+
34
+ desc "cleanup current app"
35
+ task :cleanapp => :environment do
36
+ Rake::Task['db:drop'].invoke
37
+ command = "rm -rf #{Rails.root}/db/migrate/*"
38
+ puts command
39
+ system command
40
+ end
41
+
42
+ desc "add locale to app"
43
+ task :locale2app => :environment do
44
+ text = <<-EOT
45
+
46
+ ################################################
47
+ # Add this snippet in application_controller.rb
48
+ ################################################
49
+
50
+ before_filter :set_locale
51
+ def set_locale
52
+ I18n.locale = params[:locale]
53
+ end
54
+
55
+ def default_url_options(options={})
56
+ { :locale => I18n.locale }
57
+ end
58
+
59
+ ################################################
60
+ # And nest your routes with
61
+ ################################################
62
+
63
+ scope "/:locale" do
64
+ # your routes here
65
+ end
66
+
67
+ EOT
68
+
69
+ puts text
70
+ end
71
+
72
+ end
data/lib/merrycms.rb ADDED
@@ -0,0 +1 @@
1
+ require 'merrycms/engine' if defined?(Rails) && Rails::VERSION::MAJOR == 3
metadata ADDED
@@ -0,0 +1,270 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: merrycms
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
10
+ platform: ruby
11
+ authors:
12
+ - Franck D'agostini
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-03-22 00:00:00 +01:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: devise
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 1
30
+ - 1
31
+ - 7
32
+ version: 1.1.7
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: acl9
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ segments:
44
+ - 0
45
+ version: "0"
46
+ type: :runtime
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: RedCloth
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ segments:
57
+ - 0
58
+ version: "0"
59
+ type: :runtime
60
+ version_requirements: *id003
61
+ - !ruby/object:Gem::Dependency
62
+ name: friendly_id
63
+ prerelease: false
64
+ requirement: &id004 !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ segments:
70
+ - 0
71
+ version: "0"
72
+ type: :runtime
73
+ version_requirements: *id004
74
+ - !ruby/object:Gem::Dependency
75
+ name: transitions
76
+ prerelease: false
77
+ requirement: &id005 !ruby/object:Gem::Requirement
78
+ none: false
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ segments:
83
+ - 0
84
+ version: "0"
85
+ type: :runtime
86
+ version_requirements: *id005
87
+ - !ruby/object:Gem::Dependency
88
+ name: nested_set
89
+ prerelease: false
90
+ requirement: &id006 !ruby/object:Gem::Requirement
91
+ none: false
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ segments:
96
+ - 0
97
+ version: "0"
98
+ type: :runtime
99
+ version_requirements: *id006
100
+ - !ruby/object:Gem::Dependency
101
+ name: i18n-active_record
102
+ prerelease: false
103
+ requirement: &id007 !ruby/object:Gem::Requirement
104
+ none: false
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ segments:
109
+ - 0
110
+ version: "0"
111
+ type: :runtime
112
+ version_requirements: *id007
113
+ - !ruby/object:Gem::Dependency
114
+ name: jquery-rails
115
+ prerelease: false
116
+ requirement: &id008 !ruby/object:Gem::Requirement
117
+ none: false
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ segments:
122
+ - 0
123
+ - 2
124
+ - 6
125
+ version: 0.2.6
126
+ type: :runtime
127
+ version_requirements: *id008
128
+ - !ruby/object:Gem::Dependency
129
+ name: kaminari
130
+ prerelease: false
131
+ requirement: &id009 !ruby/object:Gem::Requirement
132
+ none: false
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ segments:
137
+ - 0
138
+ version: "0"
139
+ type: :runtime
140
+ version_requirements: *id009
141
+ - !ruby/object:Gem::Dependency
142
+ name: meta_search
143
+ prerelease: false
144
+ requirement: &id010 !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ segments:
150
+ - 0
151
+ version: "0"
152
+ type: :runtime
153
+ version_requirements: *id010
154
+ description: "Admin panel for rails3 app : user management, pages, categories"
155
+ email: franck.dagostini@gmail.com
156
+ executables: []
157
+
158
+ extensions: []
159
+
160
+ extra_rdoc_files:
161
+ - README
162
+ files:
163
+ - app/controllers/admin/base_controller.rb
164
+ - app/controllers/admin/categories_controller.rb
165
+ - app/controllers/admin/pages_controller.rb
166
+ - app/controllers/admin/translations_controller.rb
167
+ - app/controllers/admin/users_controller.rb
168
+ - app/helpers/admin/categories_helper.rb
169
+ - app/helpers/admin/pages_helper.rb
170
+ - app/helpers/admin/translations_helper.rb
171
+ - app/helpers/admin/users_helper.rb
172
+ - app/models/category.rb
173
+ - app/models/page.rb
174
+ - app/models/role.rb
175
+ - app/models/translation.rb
176
+ - app/models/user.rb
177
+ - app/views/admin/_nav.html.erb
178
+ - app/views/admin/categories/_form.erb
179
+ - app/views/admin/categories/edit.html.erb
180
+ - app/views/admin/categories/index.html.erb
181
+ - app/views/admin/categories/new.html.erb
182
+ - app/views/admin/categories/sort.html.erb
183
+ - app/views/admin/pages/_form.html.erb
184
+ - app/views/admin/pages/_search.erb
185
+ - app/views/admin/pages/edit.html.erb
186
+ - app/views/admin/pages/index.html.erb
187
+ - app/views/admin/pages/new.html.erb
188
+ - app/views/admin/translations/_filter.html.erb
189
+ - app/views/admin/translations/destroy.js
190
+ - app/views/admin/translations/index.html.erb
191
+ - app/views/admin/translations/new.html.erb
192
+ - app/views/admin/users/_form.html.erb
193
+ - app/views/admin/users/edit.html.erb
194
+ - app/views/admin/users/index.html.erb
195
+ - app/views/admin/users/new.html.erb
196
+ - app/views/devise/confirmations/new.html.erb
197
+ - app/views/devise/mailer/confirmation_instructions.html.erb
198
+ - app/views/devise/mailer/reset_password_instructions.html.erb
199
+ - app/views/devise/mailer/unlock_instructions.html.erb
200
+ - app/views/devise/passwords/edit.html.erb
201
+ - app/views/devise/passwords/new.html.erb
202
+ - app/views/devise/registrations/edit.html.erb
203
+ - app/views/devise/registrations/new.html.erb
204
+ - app/views/devise/sessions/new.html.erb
205
+ - app/views/devise/shared/_links.erb
206
+ - app/views/devise/unlocks/new.html.erb
207
+ - app/views/layouts/admin.html.erb
208
+ - app/views/layouts/login.html.erb
209
+ - app/views/shared/_error_messages.html.erb
210
+ - app/views/shared/_flashbox.html.erb
211
+ - app/views/shared/_toplinks.html.erb
212
+ - config/locales/en/admin/missing.yml
213
+ - config/locales/fr/admin/admin.fr.yml
214
+ - config/locales/fr/admin/category.fr.yml
215
+ - config/locales/fr/admin/devise.fr.yml
216
+ - config/locales/fr/admin/merrycms.fr.yml
217
+ - config/locales/fr/admin/missing.yml
218
+ - config/locales/fr/admin/pages.fr.yml
219
+ - config/locales/fr/admin/pagination.fr.yml
220
+ - config/locales/fr/admin/toplinks.fr.yml
221
+ - config/locales/fr/admin/translations.fr.yml
222
+ - config/locales/fr/admin/users.fr.yml
223
+ - lib/generators/merrycms/install_generator.rb
224
+ - lib/generators/merrycms/templates/create_pages_and_categories_migration.rb
225
+ - lib/generators/merrycms/templates/create_roles_migration.rb
226
+ - lib/generators/merrycms/templates/create_translations_migration.rb
227
+ - lib/generators/merrycms/templates/devise_create_users_migration.rb
228
+ - lib/generators/merrycms/templates/devise_initializer.rb
229
+ - lib/generators/merrycms/templates/locale_initializer.rb
230
+ - lib/generators/merrycms/templates/roles_users_migration.rb
231
+ - lib/generators/merrycms/views_generator.rb
232
+ - lib/merrycms.rb
233
+ - lib/merrycms/engine.rb
234
+ - lib/merrycms/rails/routes.rb
235
+ - lib/merrycms/railties/merrycms_tasks.rake
236
+ - README
237
+ has_rdoc: true
238
+ homepage: https://github.com/franck/merrycms
239
+ licenses: []
240
+
241
+ post_install_message:
242
+ rdoc_options: []
243
+
244
+ require_paths:
245
+ - lib
246
+ required_ruby_version: !ruby/object:Gem::Requirement
247
+ none: false
248
+ requirements:
249
+ - - ">="
250
+ - !ruby/object:Gem::Version
251
+ segments:
252
+ - 0
253
+ version: "0"
254
+ required_rubygems_version: !ruby/object:Gem::Requirement
255
+ none: false
256
+ requirements:
257
+ - - ">="
258
+ - !ruby/object:Gem::Version
259
+ segments:
260
+ - 0
261
+ version: "0"
262
+ requirements: []
263
+
264
+ rubyforge_project:
265
+ rubygems_version: 1.3.7
266
+ signing_key:
267
+ specification_version: 3
268
+ summary: "Admin panel for rails3 app : user management, pages, categories"
269
+ test_files: []
270
+