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.
- data/.rbenv-gemsets +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -3
- data/Gemfile.lock +146 -105
- data/README.rdoc +3 -2
- data/VERSION +1 -1
- data/app/assets/stylesheets/cms/fortress/admin_overrides.css +5 -0
- data/app/controllers/cms/fortress/admin_controller.rb +1 -1
- data/app/controllers/cms/fortress/roles_controller.rb +11 -3
- data/app/controllers/cms/fortress/users_controller.rb +1 -1
- data/app/models/cms/fortress/role.rb +3 -2
- data/app/models/cms/fortress/role_detail.rb +3 -2
- data/app/models/cms/fortress/user.rb +5 -2
- data/app/models/cms/page_workflow.rb +27 -0
- data/app/views/.DS_Store +0 -0
- data/app/views/admin/cms/pages/_form.html.haml +61 -0
- data/app/views/admin/cms/partials/_body_before.html.haml +1 -0
- data/app/views/cms/fortress/shared/_admin_topnav.html.haml +4 -4
- data/app/views/cms/fortress/users/sessions/.DS_Store +0 -0
- data/app/views/cms/fortress/users/sessions/new.html.haml +11 -0
- data/app/views/layouts/admin/_body.html.haml +17 -0
- data/app/views/layouts/admin/cms/.DS_Store +0 -0
- data/app/views/layouts/{cms_admin → admin/cms}/_head.html.haml +2 -2
- data/app/views/layouts/admin/cms/_left.html.haml +23 -0
- data/cms-fortress.gemspec +33 -18
- data/config/roles.yml +2 -0
- data/db/migrate/04_create_cms_page_workflows.rb +11 -0
- data/lib/cms-fortress.rb +8 -5
- data/lib/cms/fortress/application_controller_methods.rb +2 -2
- data/lib/cms/fortress/auth.rb +2 -2
- data/lib/cms/fortress/comfortable_mexican_sofa.rb +1 -0
- data/lib/cms/fortress/content_renderer.rb +30 -0
- data/lib/cms/fortress/page_methods.rb +17 -0
- data/lib/cms/fortress/rails/engine.rb +4 -0
- data/lib/cms/fortress/routes/admin.rb +21 -0
- data/lib/cms/fortress/routing.rb +1 -0
- data/lib/generators/cms/fortress/fortress_generator.rb +4 -0
- data/lib/generators/comfy/cms/cms_generator.rb +17 -12
- data/test/fixtures/cms/page_workflows.yml +11 -0
- metadata +99 -31
- data/app/views/cms_users/sessions/new.html.erb +0 -19
- data/app/views/layouts/cms_admin/_body.html.haml +0 -22
- data/app/views/layouts/cms_admin/_left.html.haml +0 -18
- data/config/initializers/devise.rb +0 -243
- 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.
|
5
|
-
gem 'devise', '
|
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 (
|
5
|
-
actionpack (=
|
6
|
-
mail (~> 2.5.
|
7
|
-
actionpack (
|
8
|
-
|
9
|
-
|
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
|
-
|
13
|
-
rack (~>
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
arel (
|
33
|
-
|
34
|
-
|
35
|
-
|
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.
|
38
|
+
cocaine (0.5.3)
|
39
39
|
climate_control (>= 0.0.3, < 1.0)
|
40
|
-
|
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 (
|
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.
|
47
|
-
comfortable_mexican_sofa (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 (>=
|
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 (
|
55
|
-
redcarpet (>= 2.2.0)
|
60
|
+
rails (~> 4.0)
|
56
61
|
sass-rails (>= 3.1.0)
|
57
|
-
|
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 (
|
61
|
-
|
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 (
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
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.
|
71
|
-
actionpack (
|
72
|
-
activesupport (
|
73
|
-
haml (>= 3.1, <
|
74
|
-
railties (
|
75
|
-
|
76
|
-
|
77
|
-
|
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
|
-
|
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
|
-
|
87
|
-
|
88
|
-
|
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.
|
92
|
-
|
93
|
-
|
94
|
-
|
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.
|
138
|
+
cocaine (~> 0.5.3)
|
99
139
|
mime-types
|
100
140
|
polyglot (0.3.3)
|
101
|
-
rack (1.
|
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 (
|
109
|
-
actionmailer (=
|
110
|
-
actionpack (=
|
111
|
-
activerecord (=
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
railties (
|
117
|
-
actionpack (=
|
118
|
-
activesupport (=
|
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
|
-
|
122
|
-
|
123
|
-
|
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
|
-
|
127
|
-
sass (
|
128
|
-
|
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
|
-
|
132
|
-
simplecov (0.
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
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
|
-
|
143
|
-
|
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.
|
147
|
-
warden (1.2.
|
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 (
|
157
|
-
|
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.
|
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,4 +1,4 @@
|
|
1
|
-
class Cms::Fortress::RolesController <
|
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(
|
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(
|
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,6 +1,7 @@
|
|
1
1
|
class Cms::Fortress::Role < ActiveRecord::Base
|
2
|
-
set_table_name :cms_fortress_roles
|
3
|
-
|
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
|
-
|
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
|
-
|
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
|
|