casein 4.0.0 → 5.0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +246 -0
- data/PUBLIC_VERSION.yml +2 -2
- data/README.rdoc +73 -49
- data/Rakefile +7 -5
- data/app/assets/fonts/casein/glyphiconshalflings-regular.eot +0 -0
- data/app/assets/fonts/casein/glyphiconshalflings-regular.otf +0 -0
- data/app/assets/fonts/casein/glyphiconshalflings-regular.svg +175 -0
- data/app/assets/fonts/casein/glyphiconshalflings-regular.ttf +0 -0
- data/app/assets/fonts/casein/glyphiconshalflings-regular.woff +0 -0
- data/app/assets/images/casein/casein.png +0 -0
- data/app/assets/javascripts/casein/bootstrap.js +1966 -0
- data/app/assets/javascripts/casein/casein.js +34 -19
- data/app/assets/javascripts/casein/html5shiv.js +8 -0
- data/app/assets/stylesheets/casein/bootstrap-glyphicons.css.scss +2 -0
- data/app/assets/stylesheets/casein/bootstrap.css +4692 -0
- data/app/assets/stylesheets/casein/casein-bootstrap-overrides.css.scss +76 -0
- data/app/assets/stylesheets/casein/casein.css.scss +258 -3
- data/app/assets/stylesheets/casein/login.css.scss +48 -109
- data/app/controllers/casein/{user_sessions_controller.rb → admin_user_sessions_controller.rb} +6 -10
- data/app/controllers/casein/admin_users_controller.rb +124 -0
- data/app/controllers/casein/casein_controller.rb +11 -9
- data/app/controllers/casein/password_resets_controller.rb +8 -10
- data/app/helpers/casein/casein_helper.rb +94 -31
- data/app/mailers/casein/casein_notification.rb +13 -13
- data/app/models/casein/{user.rb → admin_user.rb} +2 -2
- data/app/models/casein/{user_session.rb → admin_user_session.rb} +1 -1
- data/app/views/casein/admin_user_sessions/new.html.erb +56 -0
- data/app/views/casein/admin_users/index.html.erb +39 -0
- data/app/views/casein/admin_users/new.html.erb +57 -0
- data/app/views/casein/admin_users/show.html.erb +104 -0
- data/app/views/casein/casein/blank.html.erb +12 -1
- data/app/views/casein/casein_notification/generate_new_password.erb +1 -1
- data/app/views/casein/casein_notification/new_user_information.erb +1 -1
- data/app/views/casein/casein_notification/password_reset_instructions.erb +1 -1
- data/app/views/casein/password_resets/edit.html.erb +21 -33
- data/app/views/layouts/casein_auth.html.erb +34 -22
- data/app/views/layouts/casein_main.html.erb +111 -64
- data/config/initializers/will_paginate.rb +40 -0
- data/config/routes.rb +2 -2
- data/lib/casein.rb +9 -3
- data/lib/casein/engine.rb +5 -1
- data/lib/generators/casein/install/install_generator.rb +3 -3
- data/lib/generators/casein/install/templates/app/helpers/casein/config_helper.rb +10 -11
- data/lib/generators/casein/install/templates/app/views/casein/layouts/{_left_navigation.html.erb → _tab_navigation.html.erb} +0 -0
- data/lib/generators/casein/install/templates/app/views/casein/layouts/_top_navigation.html.erb +4 -0
- data/lib/generators/casein/install/templates/db/migrate/{casein_create_users.rb → casein_create_admin_users.rb} +3 -3
- data/lib/generators/casein/scaffold/scaffold_generator.rb +20 -8
- data/lib/generators/casein/scaffold/templates/controller.rb +6 -6
- data/lib/generators/casein/scaffold/templates/views/_form.html.erb +11 -8
- data/lib/generators/casein/scaffold/templates/views/_table.html.erb +12 -10
- data/lib/generators/casein/scaffold/templates/views/index.html.erb +7 -3
- data/lib/generators/casein/scaffold/templates/views/new.html.erb +3 -3
- data/lib/generators/casein/scaffold/templates/views/show.html.erb +5 -5
- data/lib/railties/tasks.rake +15 -13
- metadata +67 -46
- data/MIT-LICENSE +0 -21
- data/app/assets/images/casein/header.png +0 -0
- data/app/assets/images/casein/icons/add.png +0 -0
- data/app/assets/images/casein/icons/delete.png +0 -0
- data/app/assets/images/casein/icons/table.png +0 -0
- data/app/assets/images/casein/login/alertBg.png +0 -0
- data/app/assets/images/casein/login/background.png +0 -0
- data/app/assets/images/casein/login/bottom.png +0 -0
- data/app/assets/images/casein/login/loginBoxBg.png +0 -0
- data/app/assets/images/casein/login/loginBoxBottom.png +0 -0
- data/app/assets/images/casein/login/loginBoxTop.png +0 -0
- data/app/assets/images/casein/login/loginSubmit.png +0 -0
- data/app/assets/images/casein/login/recoverSubmit.png +0 -0
- data/app/assets/images/casein/login/top.png +0 -0
- data/app/assets/images/casein/nav.png +0 -0
- data/app/assets/images/casein/rightNav.png +0 -0
- data/app/assets/images/casein/rightNavButton.png +0 -0
- data/app/assets/images/casein/visitSiteNav.png +0 -0
- data/app/assets/javascripts/casein/login.js +0 -27
- data/app/assets/stylesheets/casein/elements.css.scss +0 -307
- data/app/assets/stylesheets/casein/screen.css.scss +0 -224
- data/app/controllers/casein/users_controller.rb +0 -108
- data/app/views/casein/user_sessions/new.html.erb +0 -66
- data/app/views/casein/users/index.html.erb +0 -35
- data/app/views/casein/users/new.html.erb +0 -46
- data/app/views/casein/users/show.html.erb +0 -94
- data/lib/generators/casein/install/templates/app/views/casein/layouts/_right_navigation.html.erb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45f9e6702ce5255b36808ef8c835fbc4664079d6
|
4
|
+
data.tar.gz: 246672dcad1b749e1a7c2f5e7a7e12f279b3b72e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 672fea6ef92b66735c2def637c841234b57e410c7ed2fc03f3eabab0cbaa56cc6730c240dcb0e8f9d7eb9aa5249438e03f2daa6650bae8565ff7203cf5b9f678
|
7
|
+
data.tar.gz: 6fa09b6fef02b73a21223216f91c296b813ac33f003e40c2c095354e0f54bf5b9c794a0b40a5d1e3c99a4dfc6ed614e582324f996488ba666dd344f3cba47735
|
data/LICENSE
ADDED
@@ -0,0 +1,246 @@
|
|
1
|
+
CASEIN v5.x — A lightweight CMS toolkit for Ruby on Rails, based on Bootstrap.
|
2
|
+
|
3
|
+
Copyright (c) 2013 Russell Quinn. Previously copyright (c) 2010-2012 Spoiled Milk ApS and Russell Quinn.
|
4
|
+
|
5
|
+
www.russellquinn.com
|
6
|
+
|
7
|
+
- - -
|
8
|
+
|
9
|
+
Casein is released under the MIT License:
|
10
|
+
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
12
|
+
a copy of this software and associated documentation files (the
|
13
|
+
"Software"), to deal in the Software without restriction, including
|
14
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
15
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
16
|
+
permit persons to whom the Software is furnished to do so, subject to
|
17
|
+
the following conditions:
|
18
|
+
|
19
|
+
The above copyright notice and this permission notice shall be
|
20
|
+
included in all copies or substantial portions of the Software.
|
21
|
+
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
23
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
24
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
25
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
26
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
27
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
28
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
29
|
+
|
30
|
+
- - -
|
31
|
+
|
32
|
+
Casein uses Bootstrap and Glyphicons.
|
33
|
+
|
34
|
+
Bootstrap is copyright (c) 2013 Twitter and is used under the Apache 2.0 license.
|
35
|
+
http://getbootstrap.com
|
36
|
+
|
37
|
+
Glyphicons is an extensive glyph library created by Jan Kovařík and made available for Bootstrap under the same Apache 2.0 license.
|
38
|
+
http://glyphicons.com
|
39
|
+
|
40
|
+
Bootstrap-glyphicons is copyright (c) 2013 Mark Otto and is used under the MIT License.
|
41
|
+
http://glyphicons.getbootstrap.com
|
42
|
+
|
43
|
+
- - -
|
44
|
+
|
45
|
+
Bootstrap and Glyphicons license:
|
46
|
+
|
47
|
+
Apache License
|
48
|
+
Version 2.0, January 2004
|
49
|
+
http://www.apache.org/licenses/
|
50
|
+
|
51
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
52
|
+
|
53
|
+
1. Definitions.
|
54
|
+
|
55
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
56
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
57
|
+
|
58
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
59
|
+
the copyright owner that is granting the License.
|
60
|
+
|
61
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
62
|
+
other entities that control, are controlled by, or are under common
|
63
|
+
control with that entity. For the purposes of this definition,
|
64
|
+
"control" means (i) the power, direct or indirect, to cause the
|
65
|
+
direction or management of such entity, whether by contract or
|
66
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
67
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
68
|
+
|
69
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
70
|
+
exercising permissions granted by this License.
|
71
|
+
|
72
|
+
"Source" form shall mean the preferred form for making modifications,
|
73
|
+
including but not limited to software source code, documentation
|
74
|
+
source, and configuration files.
|
75
|
+
|
76
|
+
"Object" form shall mean any form resulting from mechanical
|
77
|
+
transformation or translation of a Source form, including but
|
78
|
+
not limited to compiled object code, generated documentation,
|
79
|
+
and conversions to other media types.
|
80
|
+
|
81
|
+
"Work" shall mean the work of authorship, whether in Source or
|
82
|
+
Object form, made available under the License, as indicated by a
|
83
|
+
copyright notice that is included in or attached to the work
|
84
|
+
(an example is provided in the Appendix below).
|
85
|
+
|
86
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
87
|
+
form, that is based on (or derived from) the Work and for which the
|
88
|
+
editorial revisions, annotations, elaborations, or other modifications
|
89
|
+
represent, as a whole, an original work of authorship. For the purposes
|
90
|
+
of this License, Derivative Works shall not include works that remain
|
91
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
92
|
+
the Work and Derivative Works thereof.
|
93
|
+
|
94
|
+
"Contribution" shall mean any work of authorship, including
|
95
|
+
the original version of the Work and any modifications or additions
|
96
|
+
to that Work or Derivative Works thereof, that is intentionally
|
97
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
98
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
99
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
100
|
+
means any form of electronic, verbal, or written communication sent
|
101
|
+
to the Licensor or its representatives, including but not limited to
|
102
|
+
communication on electronic mailing lists, source code control systems,
|
103
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
104
|
+
Licensor for the purpose of discussing and improving the Work, but
|
105
|
+
excluding communication that is conspicuously marked or otherwise
|
106
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
107
|
+
|
108
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
109
|
+
on behalf of whom a Contribution has been received by Licensor and
|
110
|
+
subsequently incorporated within the Work.
|
111
|
+
|
112
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
113
|
+
this License, each Contributor hereby grants to You a perpetual,
|
114
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
115
|
+
copyright license to reproduce, prepare Derivative Works of,
|
116
|
+
publicly display, publicly perform, sublicense, and distribute the
|
117
|
+
Work and such Derivative Works in Source or Object form.
|
118
|
+
|
119
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
120
|
+
this License, each Contributor hereby grants to You a perpetual,
|
121
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
122
|
+
(except as stated in this section) patent license to make, have made,
|
123
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
124
|
+
where such license applies only to those patent claims licensable
|
125
|
+
by such Contributor that are necessarily infringed by their
|
126
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
127
|
+
with the Work to which such Contribution(s) was submitted. If You
|
128
|
+
institute patent litigation against any entity (including a
|
129
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
130
|
+
or a Contribution incorporated within the Work constitutes direct
|
131
|
+
or contributory patent infringement, then any patent licenses
|
132
|
+
granted to You under this License for that Work shall terminate
|
133
|
+
as of the date such litigation is filed.
|
134
|
+
|
135
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
136
|
+
Work or Derivative Works thereof in any medium, with or without
|
137
|
+
modifications, and in Source or Object form, provided that You
|
138
|
+
meet the following conditions:
|
139
|
+
|
140
|
+
(a) You must give any other recipients of the Work or
|
141
|
+
Derivative Works a copy of this License; and
|
142
|
+
|
143
|
+
(b) You must cause any modified files to carry prominent notices
|
144
|
+
stating that You changed the files; and
|
145
|
+
|
146
|
+
(c) You must retain, in the Source form of any Derivative Works
|
147
|
+
that You distribute, all copyright, patent, trademark, and
|
148
|
+
attribution notices from the Source form of the Work,
|
149
|
+
excluding those notices that do not pertain to any part of
|
150
|
+
the Derivative Works; and
|
151
|
+
|
152
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
153
|
+
distribution, then any Derivative Works that You distribute must
|
154
|
+
include a readable copy of the attribution notices contained
|
155
|
+
within such NOTICE file, excluding those notices that do not
|
156
|
+
pertain to any part of the Derivative Works, in at least one
|
157
|
+
of the following places: within a NOTICE text file distributed
|
158
|
+
as part of the Derivative Works; within the Source form or
|
159
|
+
documentation, if provided along with the Derivative Works; or,
|
160
|
+
within a display generated by the Derivative Works, if and
|
161
|
+
wherever such third-party notices normally appear. The contents
|
162
|
+
of the NOTICE file are for informational purposes only and
|
163
|
+
do not modify the License. You may add Your own attribution
|
164
|
+
notices within Derivative Works that You distribute, alongside
|
165
|
+
or as an addendum to the NOTICE text from the Work, provided
|
166
|
+
that such additional attribution notices cannot be construed
|
167
|
+
as modifying the License.
|
168
|
+
|
169
|
+
You may add Your own copyright statement to Your modifications and
|
170
|
+
may provide additional or different license terms and conditions
|
171
|
+
for use, reproduction, or distribution of Your modifications, or
|
172
|
+
for any such Derivative Works as a whole, provided Your use,
|
173
|
+
reproduction, and distribution of the Work otherwise complies with
|
174
|
+
the conditions stated in this License.
|
175
|
+
|
176
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
177
|
+
any Contribution intentionally submitted for inclusion in the Work
|
178
|
+
by You to the Licensor shall be under the terms and conditions of
|
179
|
+
this License, without any additional terms or conditions.
|
180
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
181
|
+
the terms of any separate license agreement you may have executed
|
182
|
+
with Licensor regarding such Contributions.
|
183
|
+
|
184
|
+
6. Trademarks. This License does not grant permission to use the trade
|
185
|
+
names, trademarks, service marks, or product names of the Licensor,
|
186
|
+
except as required for reasonable and customary use in describing the
|
187
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
188
|
+
|
189
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
190
|
+
agreed to in writing, Licensor provides the Work (and each
|
191
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
192
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
193
|
+
implied, including, without limitation, any warranties or conditions
|
194
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
195
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
196
|
+
appropriateness of using or redistributing the Work and assume any
|
197
|
+
risks associated with Your exercise of permissions under this License.
|
198
|
+
|
199
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
200
|
+
whether in tort (including negligence), contract, or otherwise,
|
201
|
+
unless required by applicable law (such as deliberate and grossly
|
202
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
203
|
+
liable to You for damages, including any direct, indirect, special,
|
204
|
+
incidental, or consequential damages of any character arising as a
|
205
|
+
result of this License or out of the use or inability to use the
|
206
|
+
Work (including but not limited to damages for loss of goodwill,
|
207
|
+
work stoppage, computer failure or malfunction, or any and all
|
208
|
+
other commercial damages or losses), even if such Contributor
|
209
|
+
has been advised of the possibility of such damages.
|
210
|
+
|
211
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
212
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
213
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
214
|
+
or other liability obligations and/or rights consistent with this
|
215
|
+
License. However, in accepting such obligations, You may act only
|
216
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
217
|
+
of any other Contributor, and only if You agree to indemnify,
|
218
|
+
defend, and hold each Contributor harmless for any liability
|
219
|
+
incurred by, or claims asserted against, such Contributor by reason
|
220
|
+
of your accepting any such warranty or additional liability.
|
221
|
+
|
222
|
+
END OF TERMS AND CONDITIONS
|
223
|
+
|
224
|
+
- - -
|
225
|
+
|
226
|
+
Bootstrap-glyphicons license:
|
227
|
+
|
228
|
+
Copyright (c) 2013 Mark Otto
|
229
|
+
|
230
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
231
|
+
of this software and associated documentation files (the "Software"), to deal
|
232
|
+
in the Software without restriction, including without limitation the rights
|
233
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
234
|
+
copies of the Software, and to permit persons to whom the Software is
|
235
|
+
furnished to do so, subject to the following conditions:
|
236
|
+
|
237
|
+
The above copyright notice and this permission notice shall be included in
|
238
|
+
all copies or substantial portions of the Software.
|
239
|
+
|
240
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
241
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
242
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
243
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
244
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
245
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
246
|
+
THE SOFTWARE.
|
data/PUBLIC_VERSION.yml
CHANGED
data/README.rdoc
CHANGED
@@ -1,37 +1,39 @@
|
|
1
|
-
=Casein - a lightweight Ruby on Rails
|
1
|
+
=Casein - a lightweight CMS toolkit for Ruby on Rails, based on Bootstrap
|
2
2
|
|
3
|
-
**CASEIN
|
3
|
+
** ALL-NEW CASEIN 5.0.0 — featuring new responsive UI based on Bootstrap 3! **
|
4
4
|
|
5
5
|
Casein is a Rails 4.x gem that provides scaffolding generators and helper functions to quickly create a clean and minimal CRUD (Create, Read, Update and Delete) interface for your data. It also comes with a pre-rolled user authentication system. As Casein is completely decoupled from the front-end, it can be added to a new or existing Rails project, or used as a standalone CMS to drive platforms built on other technologies.
|
6
6
|
|
7
|
+
Screenshots at: http://www.caseincms.com
|
8
|
+
|
7
9
|
==Requirements
|
8
10
|
|
9
11
|
This version of Casein is designed for Ruby on Rails 4.x and Ruby 2.x.
|
10
12
|
|
11
13
|
Legacy versions:
|
12
14
|
|
13
|
-
|
15
|
+
Rails 3.x: http://github.com/spoiledmilk/casein3
|
14
16
|
|
15
17
|
Rails 2.x: http://github.com/spoiledmilk/casein
|
16
18
|
|
17
19
|
==Disclaimer
|
18
20
|
|
19
|
-
Casein was created and is maintained by Russell Quinn
|
20
|
-
|
21
|
-
Previous versions of Casein were sponsored by Spoiled Milk (http://www.spoiledmilk.com)
|
21
|
+
Casein was created and is maintained by Russell Quinn. http://www.russellquinn.com
|
22
22
|
|
23
23
|
Casein is available to use under the terms of the MIT License. See the LICENSE file for more details.
|
24
24
|
|
25
25
|
==What’s New
|
26
26
|
|
27
|
-
Casein
|
27
|
+
Casein 5.x is built for Ruby on Rails 4.x and has the following major updates:
|
28
28
|
|
29
|
+
* Now based on Bootstrap 3
|
30
|
+
* Complete UI overhaul, now mobile-first
|
29
31
|
* Support for strong parameters
|
30
32
|
* Support for asset pipeline
|
31
33
|
* Rails 4 compatibility fixes
|
32
|
-
* Many other tweaks and improvements over Casein 3.x
|
34
|
+
* Many other tweaks and improvements over Casein 3.x and 4.x
|
33
35
|
|
34
|
-
There is no real upgrade path from previous versions of Casein. It’s recommended to only use Casein
|
36
|
+
There is no real upgrade path from previous versions of Casein, including v4.x. It’s recommended to only use Casein v5.x on new projects.
|
35
37
|
|
36
38
|
==Installation
|
37
39
|
|
@@ -39,13 +41,13 @@ There is no real upgrade path from previous versions of Casein. It’s recommend
|
|
39
41
|
|
40
42
|
— Add the Casein gem to your Gemfile:
|
41
43
|
|
42
|
-
gem 'casein'
|
44
|
+
gem 'casein', '5.0.0'
|
43
45
|
|
44
46
|
— Then use bundler to install Casein and its dependencies:
|
45
47
|
|
46
48
|
bundle install
|
47
49
|
|
48
|
-
— If you have just created a new project
|
50
|
+
— If you have just created a new project — and don't want to use the default SQLite settings — then remember to add your database details to /config/database.yml at this point.
|
49
51
|
|
50
52
|
— To enable Casein notification emails (used for new users and forgotten passwords) then add your SMTP server information to your initializers. For development, you can use something cool like MailCatcher (http://mailcatcher.me)
|
51
53
|
|
@@ -58,7 +60,7 @@ There is no real upgrade path from previous versions of Casein. It’s recommend
|
|
58
60
|
rake db:create (if needed)
|
59
61
|
rake db:migrate
|
60
62
|
|
61
|
-
— Run the following Rake task to set up an initial user. The default
|
63
|
+
— Run the following Rake task to set up an initial user. The default username and a random password will be displayed once the task has completed. You should specify your email address. If you've set up an SMTP server in your Rails environment then you’ll also receive an email notification about the new account.
|
62
64
|
|
63
65
|
rake casein:users:create_admin email=you@yourdomain.com
|
64
66
|
|
@@ -66,11 +68,11 @@ There is no real upgrade path from previous versions of Casein. It’s recommend
|
|
66
68
|
|
67
69
|
— You can access Casein at http://yourdomain.com/casein or http://yourdomain.com/admin
|
68
70
|
|
69
|
-
<b>Casein should now be running
|
71
|
+
<b>Casein should now be running!</b>
|
70
72
|
|
71
73
|
==Usage
|
72
74
|
|
73
|
-
The default Casein install supports user authentication. Users may have a
|
75
|
+
The default Casein install supports user authentication. Users may have a role of either ‘administrator’ or ‘user’. The former is allowed to add, edit and delete other Casein users. The latter is only allowed to edit their own profile.
|
74
76
|
|
75
77
|
Casein is a framework allowing you to quickly build up an interface to edit and create new records from your database model. As well as the user support and user interface, there are many configurations and generators to help you along the way.
|
76
78
|
|
@@ -84,23 +86,25 @@ The command to run the scaffolding generator is:
|
|
84
86
|
|
85
87
|
Where:
|
86
88
|
|
87
|
-
* ModelName – The singular name of your model, e.g.
|
89
|
+
* ModelName – The *singular* name of your model, e.g. Customer
|
88
90
|
* field:type – The name of your database fields and their types, e.g. name:string. The field name must match the name in your migrations and the type must be one of the Rails migration types (string, text, integer, float, decimal, datetime, timestamp, time, date, binary, boolean). Note that you do not have to specify all of the fields in your model, but just the ones that you wish to be editable in Casein.
|
89
91
|
|
90
92
|
e.g. a typical scaffolding command might look like:
|
91
93
|
|
92
|
-
rails g casein:scaffold
|
94
|
+
rails g casein:scaffold Customer name:string age:integer date_of_birth:date is_male:boolean
|
93
95
|
|
94
|
-
|
96
|
+
Command-line options that can be added to the end of the generate command:
|
95
97
|
|
96
98
|
--create-model-and-migration = Also creates a model and migration. By default the scaffold generator will work from existing models, but this option will generate the model and database migration files for you. This means you can also use Casein to set up a new project quickly as well.
|
99
|
+
--read-only = Creates scaffolding to view model data only (you will not be able to edit, create, or delete records). This is useful if you want to create a read-only viewer of data that's generated elsewhere.
|
100
|
+
--no-index = Excludes the index view and does not add to the model to the navigation. The _table partial is still generated. This is useful generating has/belongs relationships.
|
97
101
|
|
98
102
|
Once the command has been executed, the generator will:
|
99
103
|
|
100
|
-
* Add a new tab for the model to: app/views/casein/layouts/
|
104
|
+
* Add a new tab for the model to: app/views/casein/layouts/_tab_navigation.html.erb
|
101
105
|
* Create a controller with the name: app/controllers/casein/model_controller.erb
|
102
106
|
* Add views for index, new and show to: app/views/casein/model/
|
103
|
-
* If you restart and run your application now, you’ll be able to
|
107
|
+
* If you restart and run your application now, you’ll be able to sign in to Casein and directly edit and create new instances of your model data right away!
|
104
108
|
|
105
109
|
However, you’ll probably want to customise your views and side bars and extend your controller to suit your project. The scaffold generator just sets up the defaults for you.
|
106
110
|
|
@@ -112,13 +116,13 @@ However, you’ll probably want to customise your views and side bars and extend
|
|
112
116
|
|
113
117
|
This is the main Casein configuration file that allows you to change things such as the website name, logo, notification email address, dashboard URL, etc. The options are documented within the file.
|
114
118
|
|
115
|
-
<b>views/casein/layouts/
|
119
|
+
<b>views/casein/layouts/_tab_navigation.html.erb</b>
|
116
120
|
|
117
121
|
An ERB partial for the the left navigation tabs. Note that using the scaffolding generator will automatically add tabs into this file, but it can also be manually edited and rearranged.
|
118
122
|
|
119
|
-
<b>view/casein/layouts/
|
123
|
+
<b>view/casein/layouts/_top_navigation.html.erb</b>
|
120
124
|
|
121
|
-
An ERB partial for
|
125
|
+
An ERB partial for adding items to the top navigation.
|
122
126
|
|
123
127
|
<b>/assets/javascripts/casein/custom.js & /assets/stylesheets/casein/custom.css.scss</b>
|
124
128
|
|
@@ -134,17 +138,17 @@ Once you have the Casein core installed and configured, and have added support f
|
|
134
138
|
* Casein extension controllers should derive from Casein::CaseinController and not ApplicationController
|
135
139
|
* To set the page title, your controller action should set @casein_page_title. If this is not set, then Casein will use a default created from your project name.
|
136
140
|
|
137
|
-
<b>
|
141
|
+
<b>Sidebar</b>
|
138
142
|
|
139
|
-
The
|
143
|
+
The sidebar in Casein should be used for view specific actions, e.g. "Add user" for users/index, or "Back to list", "Delete user" for users/show.
|
140
144
|
|
141
145
|
To specify the contents of the sidebar, you must add a 'content_for :sidebar' block in the relevant view file (index, show, etc.) e.g.:
|
142
146
|
|
143
147
|
<%= content_for :sidebar do %>
|
144
|
-
<li><%= link_to "#{casein_show_icon('
|
148
|
+
<li><%= link_to "#{casein_show_icon('th-list')}Back to list".html_safe, casein_admin_users_path %></li>
|
145
149
|
<% end %>
|
146
150
|
|
147
|
-
The casein_show_icon function will display any icon
|
151
|
+
The casein_show_icon function will display any icon from the Glyphicon collection (http://glyphicons.com). Simply enter the short name.
|
148
152
|
|
149
153
|
<b>Helper functions</b>
|
150
154
|
|
@@ -158,7 +162,7 @@ Your Rails application may discover what version of Casein it is currently runni
|
|
158
162
|
|
159
163
|
casein_get_version_info
|
160
164
|
|
161
|
-
This will return an array with the keys 'major', 'minor' and '
|
165
|
+
This will return an array with the keys 'major', 'minor', 'patch', and 'build'.
|
162
166
|
|
163
167
|
<b>Rake tasks</b>
|
164
168
|
|
@@ -168,29 +172,37 @@ There are several Casein Rake tasks available to manage users. To see what is av
|
|
168
172
|
|
169
173
|
The Casein Rake tasks are all namespaced with ‘casein:’
|
170
174
|
|
175
|
+
===Bootstrap
|
176
|
+
|
177
|
+
Casein is now based on Bootstrap (http://getbootstrap.com) and jQuery. Bootstrap offers a wealth of UI components, CSS styles, and JavaScript plugins. See the Bootstrap website for full details.
|
178
|
+
|
179
|
+
Note that Casein runs from the shortlived Bootstrap v3.0.0 and hasn't yet been updated to Bootstrap v3.1.x. Some of the Bootstrap syntax might be different if you're used to 3.1.x. (Update coming soon!)
|
180
|
+
|
171
181
|
===Changing form elements / other helpers
|
172
182
|
|
173
183
|
Casein will insert form elements suitable for the field types you specified in the command line. However, you may wish to customise these, e.g. swap a text field for a password field, swap an integer field for a select dropdown, or swap a date field for a full calendar picker, etc.
|
174
184
|
|
175
|
-
You will find the form used for both new and show in a partial named
|
185
|
+
You will find the form used for both new and show in a partial named _form.html.erb
|
176
186
|
|
177
187
|
All of the standard Rails form helpers are available, but the Casein versions are prefixed with casein_. These versions are styled for the Casein interface and have automatic support for validation error reporting.
|
178
188
|
|
179
|
-
casein_text_field form,
|
180
|
-
casein_password_field form,
|
181
|
-
casein_text_area form,
|
182
|
-
casein_text_area_big form,
|
183
|
-
casein_check_box form,
|
184
|
-
casein_check_box_group form,
|
185
|
-
casein_radio_button form,
|
186
|
-
casein_radio_button_group form,
|
187
|
-
casein_select form,
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
189
|
+
casein_text_field form, obj, attribute, options = {}
|
190
|
+
casein_password_field form, obj, attribute, options = {}
|
191
|
+
casein_text_area form, obj, attribute, options = {}
|
192
|
+
casein_text_area_big form, obj, attribute, options = {}
|
193
|
+
casein_check_box form, obj, attribute, options = {}
|
194
|
+
casein_check_box_group form, obj, check_boxes = {}
|
195
|
+
casein_radio_button form, obj, attribute, tag_value, options = {}
|
196
|
+
casein_radio_button_group form, obj, radio_buttons = {}
|
197
|
+
casein_select form, obj, attribute, option_tags, options = {}
|
198
|
+
casein_time_zone_select form, obj, attribute, option_tags, options = {}
|
199
|
+
casein_collection_select form, obj, object, attribute, collection, value_method, text_method, options = {}
|
200
|
+
casein_date_select form, obj, attribute, options = {}
|
201
|
+
casein_time_select form, obj, attribute, options = {}
|
202
|
+
casein_datetime_select form, obj, attribute, options = {}
|
203
|
+
casein_file_field form, obj, object_name, attribute, options = {}
|
204
|
+
casein_hidden_field form, obj, attribute, options = {}
|
205
|
+
casein_custom_field form, obj, attribute, custom_contents, options = {}
|
194
206
|
|
195
207
|
For more information on each function, check the app/helpers/casein/casein_helper.rb file within the project. The method parameters are typically the same as the Rails form tag helpers. There are some extra Casein options that can be passed through as part of the options hash:
|
196
208
|
|
@@ -200,13 +212,19 @@ For more information on each function, check the app/helpers/casein/casein_helpe
|
|
200
212
|
|
201
213
|
===Changing form layout
|
202
214
|
|
203
|
-
A
|
215
|
+
A Bootstrap responsive two-column layout is automatically created by the scaffold generator. You can manually edit this to be any Bootstrap grid configuration. See Bootstrap documentation for full details: http://getbootstrap.com/css/#grid
|
216
|
+
|
217
|
+
===Using alerts
|
204
218
|
|
205
|
-
|
219
|
+
Casein can display three types of styled alerts: Warning, Notice, and Help.
|
206
220
|
|
207
|
-
|
221
|
+
Warning and Notice are set using Rail’s flash variables. Set flash[:warning] and flash[:notice] respectively.
|
208
222
|
|
209
|
-
|
223
|
+
Help is set on a page by adding a content_for block to a view:
|
224
|
+
|
225
|
+
<%= content_for :help do %>
|
226
|
+
This is some help text. It describes what this page is for in more detail.
|
227
|
+
<% end %>
|
210
228
|
|
211
229
|
===Routes
|
212
230
|
|
@@ -220,6 +238,12 @@ e.g.
|
|
220
238
|
|
221
239
|
Every Casein user can set their own timezone via their profile. To change the default timezone for new users, set config.time_zone in your app.
|
222
240
|
|
223
|
-
|
241
|
+
===Acknowledgements
|
242
|
+
|
243
|
+
Casein uses Bootstrap and Glyphicons.
|
244
|
+
|
245
|
+
Bootstrap is copyright (c) 2014 Twitter and is used under the MIT license. http://getbootstrap.com
|
246
|
+
|
247
|
+
Glyphicons is an extensive glyph library created by Jan Kovařík and made available for Bootstrap under the same Apache 2.0 license. http://glyphicons.com
|
224
248
|
|
225
|
-
|
249
|
+
Bootstrap-glyphicons is copyright (c) 2013 Mark Otto and is used under the MIT License. http://glyphicons.getbootstrap.com
|