cms-fortress 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/.rbenv-gemsets +1 -0
  2. data/.ruby-version +1 -0
  3. data/Gemfile +4 -3
  4. data/Gemfile.lock +146 -105
  5. data/README.rdoc +3 -2
  6. data/VERSION +1 -1
  7. data/app/assets/stylesheets/cms/fortress/admin_overrides.css +5 -0
  8. data/app/controllers/cms/fortress/admin_controller.rb +1 -1
  9. data/app/controllers/cms/fortress/roles_controller.rb +11 -3
  10. data/app/controllers/cms/fortress/users_controller.rb +1 -1
  11. data/app/models/cms/fortress/role.rb +3 -2
  12. data/app/models/cms/fortress/role_detail.rb +3 -2
  13. data/app/models/cms/fortress/user.rb +5 -2
  14. data/app/models/cms/page_workflow.rb +27 -0
  15. data/app/views/.DS_Store +0 -0
  16. data/app/views/admin/cms/pages/_form.html.haml +61 -0
  17. data/app/views/admin/cms/partials/_body_before.html.haml +1 -0
  18. data/app/views/cms/fortress/shared/_admin_topnav.html.haml +4 -4
  19. data/app/views/cms/fortress/users/sessions/.DS_Store +0 -0
  20. data/app/views/cms/fortress/users/sessions/new.html.haml +11 -0
  21. data/app/views/layouts/admin/_body.html.haml +17 -0
  22. data/app/views/layouts/admin/cms/.DS_Store +0 -0
  23. data/app/views/layouts/{cms_admin → admin/cms}/_head.html.haml +2 -2
  24. data/app/views/layouts/admin/cms/_left.html.haml +23 -0
  25. data/cms-fortress.gemspec +33 -18
  26. data/config/roles.yml +2 -0
  27. data/db/migrate/04_create_cms_page_workflows.rb +11 -0
  28. data/lib/cms-fortress.rb +8 -5
  29. data/lib/cms/fortress/application_controller_methods.rb +2 -2
  30. data/lib/cms/fortress/auth.rb +2 -2
  31. data/lib/cms/fortress/comfortable_mexican_sofa.rb +1 -0
  32. data/lib/cms/fortress/content_renderer.rb +30 -0
  33. data/lib/cms/fortress/page_methods.rb +17 -0
  34. data/lib/cms/fortress/rails/engine.rb +4 -0
  35. data/lib/cms/fortress/routes/admin.rb +21 -0
  36. data/lib/cms/fortress/routing.rb +1 -0
  37. data/lib/generators/cms/fortress/fortress_generator.rb +4 -0
  38. data/lib/generators/comfy/cms/cms_generator.rb +17 -12
  39. data/test/fixtures/cms/page_workflows.yml +11 -0
  40. metadata +99 -31
  41. data/app/views/cms_users/sessions/new.html.erb +0 -19
  42. data/app/views/layouts/cms_admin/_body.html.haml +0 -22
  43. data/app/views/layouts/cms_admin/_left.html.haml +0 -18
  44. data/config/initializers/devise.rb +0 -243
  45. data/config/routes.rb +0 -34
data/.rbenv-gemsets ADDED
@@ -0,0 +1 @@
1
+ cms-fortress
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 1.9.3-p448
data/Gemfile CHANGED
@@ -1,9 +1,10 @@
1
1
  source "http://rubygems.org"
2
2
  # Add dependencies required to use your gem here.
3
- gem 'rails'
4
- gem 'comfortable_mexican_sofa', '1.8.1'
5
- gem 'devise', '>= 1.5.4'
3
+ gem 'rails', '>=4.0.0'
4
+ gem 'comfortable_mexican_sofa', '~>1.11'
5
+ gem 'devise', '~>3.2'
6
6
  gem 'cancan', '>=1.6.9'
7
+ gem 'delayed_job', '~>4'
7
8
 
8
9
  # Add dependencies to develop your gem here.
9
10
  # Include everything needed to run rake, tests, features, etc.
data/Gemfile.lock CHANGED
@@ -1,150 +1,190 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- actionmailer (3.2.13)
5
- actionpack (= 3.2.13)
6
- mail (~> 2.5.3)
7
- actionpack (3.2.13)
8
- activemodel (= 3.2.13)
9
- activesupport (= 3.2.13)
10
- builder (~> 3.0.0)
4
+ actionmailer (4.0.2)
5
+ actionpack (= 4.0.2)
6
+ mail (~> 2.5.4)
7
+ actionpack (4.0.2)
8
+ activesupport (= 4.0.2)
9
+ builder (~> 3.1.0)
11
10
  erubis (~> 2.7.0)
12
- journey (~> 1.0.4)
13
- rack (~> 1.4.5)
14
- rack-cache (~> 1.2)
15
- rack-test (~> 0.6.1)
16
- sprockets (~> 2.2.1)
17
- active_link_to (1.0.0)
18
- activemodel (3.2.13)
19
- activesupport (= 3.2.13)
20
- builder (~> 3.0.0)
21
- activerecord (3.2.13)
22
- activemodel (= 3.2.13)
23
- activesupport (= 3.2.13)
24
- arel (~> 3.0.2)
25
- tzinfo (~> 0.3.29)
26
- activeresource (3.2.13)
27
- activemodel (= 3.2.13)
28
- activesupport (= 3.2.13)
29
- activesupport (3.2.13)
30
- i18n (= 0.6.1)
31
- multi_json (~> 1.0)
32
- arel (3.0.2)
33
- bcrypt-ruby (3.0.1)
34
- builder (3.0.4)
35
- cancan (1.6.9)
11
+ rack (~> 1.5.2)
12
+ rack-test (~> 0.6.2)
13
+ active_link_to (1.0.1)
14
+ actionpack
15
+ activemodel (4.0.2)
16
+ activesupport (= 4.0.2)
17
+ builder (~> 3.1.0)
18
+ activerecord (4.0.2)
19
+ activemodel (= 4.0.2)
20
+ activerecord-deprecated_finders (~> 1.0.2)
21
+ activesupport (= 4.0.2)
22
+ arel (~> 4.0.0)
23
+ activerecord-deprecated_finders (1.0.3)
24
+ activesupport (4.0.2)
25
+ i18n (~> 0.6, >= 0.6.4)
26
+ minitest (~> 4.2)
27
+ multi_json (~> 1.3)
28
+ thread_safe (~> 0.1)
29
+ tzinfo (~> 0.3.37)
30
+ addressable (2.3.5)
31
+ arel (4.0.1)
32
+ atomic (1.1.14)
33
+ bcrypt-ruby (3.1.2)
34
+ builder (3.1.4)
35
+ cancan (1.6.10)
36
36
  climate_control (0.0.3)
37
37
  activesupport (>= 3.0)
38
- cocaine (0.5.1)
38
+ cocaine (0.5.3)
39
39
  climate_control (>= 0.0.3, < 1.0)
40
- coffee-rails (3.2.2)
40
+ codemirror-rails (3.16)
41
+ railties (>= 3.0, < 5)
42
+ coffee-rails (4.0.1)
41
43
  coffee-script (>= 2.2.0)
42
- railties (~> 3.2.0)
44
+ railties (>= 4.0.0, < 5.0)
43
45
  coffee-script (2.2.0)
44
46
  coffee-script-source
45
47
  execjs
46
- coffee-script-source (1.6.2)
47
- comfortable_mexican_sofa (1.8.1)
48
+ coffee-script-source (1.6.3)
49
+ comfortable_mexican_sofa (1.11.0)
48
50
  active_link_to (>= 1.0.0)
51
+ codemirror-rails (>= 3.0.0)
49
52
  coffee-rails (>= 3.1.0)
50
53
  formatted_form (>= 2.1.0)
51
54
  haml-rails (>= 0.3.0)
52
- jquery-rails (>= 2.2.0)
55
+ jquery-rails (>= 3.0.0)
56
+ jquery-ui-rails (>= 4.0.0)
57
+ kaminari (>= 0.14.0)
58
+ kramdown (>= 1.0.0)
53
59
  paperclip (>= 3.4.0)
54
- rails (>= 3.1.0)
55
- redcarpet (>= 2.2.0)
60
+ rails (~> 4.0)
56
61
  sass-rails (>= 3.1.0)
57
- devise (2.2.3)
62
+ delayed_job (4.0.0)
63
+ activesupport (>= 3.0, < 4.1)
64
+ devise (3.2.2)
58
65
  bcrypt-ruby (~> 3.0)
59
66
  orm_adapter (~> 0.1)
60
- railties (~> 3.1)
61
- warden (~> 1.2.1)
67
+ railties (>= 3.2.6, < 5)
68
+ thread_safe (~> 0.1)
69
+ warden (~> 1.2.3)
70
+ docile (1.1.1)
62
71
  erubis (2.7.0)
63
- execjs (1.4.0)
64
- multi_json (~> 1.0)
65
- formatted_form (2.1.1)
66
- rails (>= 3.1.0)
67
- git (1.2.5)
68
- haml (4.0.2)
72
+ execjs (2.0.2)
73
+ faraday (0.8.8)
74
+ multipart-post (~> 1.2.0)
75
+ formatted_form (2.1.2)
76
+ rails (>= 3.1)
77
+ git (1.2.6)
78
+ github_api (0.10.1)
79
+ addressable
80
+ faraday (~> 0.8.1)
81
+ hashie (>= 1.2)
82
+ multi_json (~> 1.4)
83
+ nokogiri (~> 1.5.2)
84
+ oauth2
85
+ haml (4.0.4)
69
86
  tilt
70
- haml-rails (0.4)
71
- actionpack (>= 3.1, < 4.1)
72
- activesupport (>= 3.1, < 4.1)
73
- haml (>= 3.1, < 4.1)
74
- railties (>= 3.1, < 4.1)
75
- hike (1.2.2)
76
- i18n (0.6.1)
77
- jeweler (1.8.4)
87
+ haml-rails (0.5.1)
88
+ actionpack (~> 4.0.0)
89
+ activesupport (~> 4.0.0)
90
+ haml (>= 3.1, < 5.0)
91
+ railties (~> 4.0.0)
92
+ hashie (2.0.5)
93
+ highline (1.6.20)
94
+ hike (1.2.3)
95
+ httpauth (0.2.0)
96
+ i18n (0.6.9)
97
+ jeweler (1.8.8)
98
+ builder
78
99
  bundler (~> 1.0)
79
100
  git (>= 1.2.5)
101
+ github_api (= 0.10.1)
102
+ highline (>= 1.6.15)
103
+ nokogiri (= 1.5.10)
80
104
  rake
81
105
  rdoc
82
- journey (1.0.4)
83
- jquery-rails (2.2.1)
106
+ jquery-rails (3.0.4)
84
107
  railties (>= 3.0, < 5.0)
85
108
  thor (>= 0.14, < 2.0)
86
- json (1.7.7)
87
- mail (2.5.3)
88
- i18n (>= 0.4.0)
109
+ jquery-ui-rails (4.1.0)
110
+ railties (>= 3.1.0)
111
+ json (1.8.1)
112
+ jwt (0.1.8)
113
+ multi_json (>= 1.5)
114
+ kaminari (0.15.0)
115
+ actionpack (>= 3.0.0)
116
+ activesupport (>= 3.0.0)
117
+ kramdown (1.2.0)
118
+ mail (2.5.4)
89
119
  mime-types (~> 1.16)
90
120
  treetop (~> 1.4.8)
91
- mime-types (1.23)
92
- multi_json (1.7.2)
93
- orm_adapter (0.4.0)
94
- paperclip (3.4.1)
121
+ mime-types (1.25.1)
122
+ minitest (4.7.5)
123
+ multi_json (1.8.2)
124
+ multi_xml (0.5.5)
125
+ multipart-post (1.2.0)
126
+ nokogiri (1.5.10)
127
+ oauth2 (0.9.2)
128
+ faraday (~> 0.8)
129
+ httpauth (~> 0.2)
130
+ jwt (~> 0.1.4)
131
+ multi_json (~> 1.0)
132
+ multi_xml (~> 0.5)
133
+ rack (~> 1.2)
134
+ orm_adapter (0.5.0)
135
+ paperclip (3.5.2)
95
136
  activemodel (>= 3.0.0)
96
- activerecord (>= 3.0.0)
97
137
  activesupport (>= 3.0.0)
98
- cocaine (~> 0.5.0)
138
+ cocaine (~> 0.5.3)
99
139
  mime-types
100
140
  polyglot (0.3.3)
101
- rack (1.4.5)
102
- rack-cache (1.2)
103
- rack (>= 0.4)
104
- rack-ssl (1.3.3)
105
- rack
141
+ rack (1.5.2)
106
142
  rack-test (0.6.2)
107
143
  rack (>= 1.0)
108
- rails (3.2.13)
109
- actionmailer (= 3.2.13)
110
- actionpack (= 3.2.13)
111
- activerecord (= 3.2.13)
112
- activeresource (= 3.2.13)
113
- activesupport (= 3.2.13)
114
- bundler (~> 1.0)
115
- railties (= 3.2.13)
116
- railties (3.2.13)
117
- actionpack (= 3.2.13)
118
- activesupport (= 3.2.13)
119
- rack-ssl (~> 1.3.2)
144
+ rails (4.0.2)
145
+ actionmailer (= 4.0.2)
146
+ actionpack (= 4.0.2)
147
+ activerecord (= 4.0.2)
148
+ activesupport (= 4.0.2)
149
+ bundler (>= 1.3.0, < 2.0)
150
+ railties (= 4.0.2)
151
+ sprockets-rails (~> 2.0.0)
152
+ railties (4.0.2)
153
+ actionpack (= 4.0.2)
154
+ activesupport (= 4.0.2)
120
155
  rake (>= 0.8.7)
121
- rdoc (~> 3.4)
122
- thor (>= 0.14.6, < 2.0)
123
- rake (10.0.4)
124
- rdoc (3.12.2)
156
+ thor (>= 0.18.1, < 2.0)
157
+ rake (10.1.0)
158
+ rdoc (4.0.1)
125
159
  json (~> 1.4)
126
- redcarpet (2.2.2)
127
- sass (3.2.8)
128
- sass-rails (3.2.6)
129
- railties (~> 3.2.0)
160
+ sass (3.2.12)
161
+ sass-rails (4.0.1)
162
+ railties (>= 4.0.0, < 5.0)
130
163
  sass (>= 3.1.10)
131
- tilt (~> 1.3)
132
- simplecov (0.7.1)
133
- multi_json (~> 1.0)
134
- simplecov-html (~> 0.7.1)
135
- simplecov-html (0.7.1)
136
- sprockets (2.2.2)
164
+ sprockets-rails (~> 2.0.0)
165
+ simplecov (0.8.2)
166
+ docile (~> 1.1.0)
167
+ multi_json
168
+ simplecov-html (~> 0.8.0)
169
+ simplecov-html (0.8.0)
170
+ sprockets (2.10.1)
137
171
  hike (~> 1.2)
138
172
  multi_json (~> 1.0)
139
173
  rack (~> 1.0)
140
174
  tilt (~> 1.1, != 1.3.0)
175
+ sprockets-rails (2.0.1)
176
+ actionpack (>= 3.0)
177
+ activesupport (>= 3.0)
178
+ sprockets (~> 2.8)
141
179
  thor (0.18.1)
142
- tilt (1.3.7)
143
- treetop (1.4.12)
180
+ thread_safe (0.1.3)
181
+ atomic
182
+ tilt (1.4.1)
183
+ treetop (1.4.15)
144
184
  polyglot
145
185
  polyglot (>= 0.3.1)
146
- tzinfo (0.3.37)
147
- warden (1.2.1)
186
+ tzinfo (0.3.38)
187
+ warden (1.2.3)
148
188
  rack (>= 1.0)
149
189
 
150
190
  PLATFORMS
@@ -153,9 +193,10 @@ PLATFORMS
153
193
  DEPENDENCIES
154
194
  bundler
155
195
  cancan (>= 1.6.9)
156
- comfortable_mexican_sofa (= 1.8.1)
157
- devise (>= 1.5.4)
196
+ comfortable_mexican_sofa (~> 1.11)
197
+ delayed_job (~> 4)
198
+ devise (~> 3.2)
158
199
  jeweler
159
- rails
200
+ rails (>= 4.0.0)
160
201
  rdoc
161
202
  simplecov
data/README.rdoc CHANGED
@@ -6,8 +6,7 @@ An extension for the awesome Comfortable Mexican Sofa (https://github.com/comfy/
6
6
  * Added Devise for User and Session Management
7
7
  * todo..
8
8
 
9
- Installation
10
- ------------
9
+ == Installation
11
10
 
12
11
  Add gem defintion to your Gemfile:
13
12
 
@@ -19,7 +18,9 @@ Then from the Rails project's root run:
19
18
  rails generate cms:fortress
20
19
  rake db:migrate
21
20
 
21
+ After that run your app and navigate to http://localhost:3000/cms-admin to start creating your pages, and also don't forget to delete your public/index.html file.
22
22
 
23
+ For more Comfortable Mexican Sofa awesomeness visit the wiki page here https://github.com/comfy/comfortable-mexican-sofa/wiki
23
24
 
24
25
  == Contributing to cms-fortress
25
26
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 1.0.0
@@ -9,3 +9,8 @@ body#comfy .body-wrapper {
9
9
  .footer-container {
10
10
  margin-top: 1em;
11
11
  }
12
+
13
+ body#comfy form.formatted.form-horizontal .control-group .controls select.status-control,
14
+ body#comfy form.formatted.form-horizontal .control-group .controls input[type='text'].status-control {
15
+ width: 30%;
16
+ }
@@ -1,6 +1,6 @@
1
1
  module Cms
2
2
  module Fortress
3
- class AdminController < CmsAdmin::BaseController
3
+ class AdminController < Admin::Cms::BaseController
4
4
 
5
5
  def index
6
6
 
@@ -1,4 +1,4 @@
1
- class Cms::Fortress::RolesController < CmsAdmin::BaseController
1
+ class Cms::Fortress::RolesController < Admin::Cms::BaseController
2
2
 
3
3
  # GET /cms/fortress/roles
4
4
  # GET /cms/fortress/roles.json
@@ -41,10 +41,12 @@ class Cms::Fortress::RolesController < CmsAdmin::BaseController
41
41
  # POST /cms/fortress/roles
42
42
  # POST /cms/fortress/roles.json
43
43
  def create
44
- @cms_fortress_role = Cms::Fortress::Role.new(params[:cms_fortress_role])
44
+ @cms_fortress_role = Cms::Fortress::Role.new(role_params)
45
+ @cms_fortress_role.load_defaults
45
46
 
46
47
  respond_to do |format|
47
48
  if @cms_fortress_role.save
49
+
48
50
  format.html { redirect_to @cms_fortress_role, notice: 'Role was successfully created.' }
49
51
  format.json { render json: @cms_fortress_role, status: :created, location: @cms_fortress_role }
50
52
  else
@@ -60,7 +62,7 @@ class Cms::Fortress::RolesController < CmsAdmin::BaseController
60
62
  @cms_fortress_role = Cms::Fortress::Role.find(params[:id])
61
63
 
62
64
  respond_to do |format|
63
- if @cms_fortress_role.update_attributes(params[:cms_fortress_role])
65
+ if @cms_fortress_role.update_attributes(role_params)
64
66
  format.html { redirect_to cms_fortress_roles_path, notice: 'Role was successfully updated.' }
65
67
  format.json { head :no_content }
66
68
  else
@@ -81,4 +83,10 @@ class Cms::Fortress::RolesController < CmsAdmin::BaseController
81
83
  format.json { head :no_content }
82
84
  end
83
85
  end
86
+
87
+ private
88
+
89
+ def role_params
90
+ params.require(:cms_fortress_role).permit(:name, :description)
91
+ end
84
92
  end
@@ -1,4 +1,4 @@
1
- class Cms::Fortress::UsersController < CmsAdmin::BaseController
1
+ class Cms::Fortress::UsersController < Admin::Cms::BaseController
2
2
  # GET /cms/fortress/users
3
3
  # GET /cms/fortress/users.json
4
4
  def index
@@ -1,6 +1,7 @@
1
1
  class Cms::Fortress::Role < ActiveRecord::Base
2
- set_table_name :cms_fortress_roles
3
- attr_accessible :description, :name
2
+ # set_table_name :cms_fortress_roles
3
+ self.table_name = "cms_fortress_roles"
4
+ # attr_accessible :description, :name
4
5
  has_many :users
5
6
  has_many :role_details
6
7
 
@@ -1,6 +1,7 @@
1
1
  class Cms::Fortress::RoleDetail < ActiveRecord::Base
2
- set_table_name :cms_fortress_role_details
3
- attr_accessible :command, :can_create, :can_delete, :name, :can_update, :can_view
2
+ # set_table_name :cms_fortress_role_details
3
+ self.table_name = "cms_fortress_role_details"
4
+ # attr_accessible :command, :can_create, :can_delete, :name, :can_update, :can_view
4
5
  belongs_to :role
5
6
 
6
7
  end
@@ -1,5 +1,7 @@
1
1
  class Cms::Fortress::User < ActiveRecord::Base
2
- set_table_name :cms_fortress_users
2
+ # set_table_name :cms_fortress_users
3
+ self.table_name = "cms_fortress_users"
4
+
3
5
  # Include default devise modules. Others available are:
4
6
  # :token_authenticatable, :confirmable,
5
7
  # :lockable, :timeoutable and :omniauthable
@@ -7,7 +9,8 @@ class Cms::Fortress::User < ActiveRecord::Base
7
9
  :recoverable, :rememberable, :trackable, :validatable
8
10
 
9
11
  # Setup accessible (or protected) attributes for your model
10
- attr_accessible :email, :password, :password_confirmation, :remember_me, :role_id
12
+ # TODO: remove this deprecation
13
+ # attr_accessible :email, :password, :password_confirmation, :remember_me, :role_id
11
14
  # attr_accessible :title, :body
12
15
  belongs_to :role
13
16