llab-generators 0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. data/CHANGELOG +1 -0
  2. data/LICENSE +21 -0
  3. data/Manifest +57 -0
  4. data/README +8 -0
  5. data/Rakefile +2 -0
  6. data/lib/generators/scaffold/USAGE +13 -0
  7. data/lib/generators/scaffold/scaffold_generator.rb +184 -0
  8. data/lib/generators/scaffold/templates/actions/create.rb +8 -0
  9. data/lib/generators/scaffold/templates/actions/destroy.rb +5 -0
  10. data/lib/generators/scaffold/templates/actions/edit.rb +3 -0
  11. data/lib/generators/scaffold/templates/actions/index.rb +3 -0
  12. data/lib/generators/scaffold/templates/actions/new.rb +3 -0
  13. data/lib/generators/scaffold/templates/actions/show.rb +3 -0
  14. data/lib/generators/scaffold/templates/actions/update.rb +8 -0
  15. data/lib/generators/scaffold/templates/controller.rb +3 -0
  16. data/lib/generators/scaffold/templates/helper.rb +2 -0
  17. data/lib/generators/scaffold/templates/migration.rb +16 -0
  18. data/lib/generators/scaffold/templates/model.rb +3 -0
  19. data/lib/generators/scaffold/templates/views/haml/_form.html.haml +12 -0
  20. data/lib/generators/scaffold/templates/views/haml/edit.html.haml +11 -0
  21. data/lib/generators/scaffold/templates/views/haml/index.html.haml +26 -0
  22. data/lib/generators/scaffold/templates/views/haml/new.html.haml +8 -0
  23. data/lib/generators/scaffold/templates/views/haml/show.html.haml +15 -0
  24. data/lib/generators/setup/USAGE +14 -0
  25. data/lib/generators/setup/setup_generator.rb +91 -0
  26. data/lib/generators/setup/templates/css/_constants.sass +17 -0
  27. data/lib/generators/setup/templates/css/_mixins.sass +156 -0
  28. data/lib/generators/setup/templates/css/blueprint.css +254 -0
  29. data/lib/generators/setup/templates/css/ie.css +60 -0
  30. data/lib/generators/setup/templates/css/print.css +61 -0
  31. data/lib/generators/setup/templates/css/screen.sass +289 -0
  32. data/lib/generators/setup/templates/devise/authorization_rules.rb +23 -0
  33. data/lib/generators/setup/templates/devise/devise_migration.rb +26 -0
  34. data/lib/generators/setup/templates/devise/devise_user.rb +30 -0
  35. data/lib/generators/setup/templates/devise/users_controller.rb +52 -0
  36. data/lib/generators/setup/templates/devise/views/_form.html.haml +29 -0
  37. data/lib/generators/setup/templates/devise/views/change_password.haml +15 -0
  38. data/lib/generators/setup/templates/devise/views/edit.html.haml +7 -0
  39. data/lib/generators/setup/templates/devise/views/forgot_password.haml +10 -0
  40. data/lib/generators/setup/templates/devise/views/index.html.haml +28 -0
  41. data/lib/generators/setup/templates/devise/views/login.haml +18 -0
  42. data/lib/generators/setup/templates/devise/views/new.html.haml +6 -0
  43. data/lib/generators/setup/templates/devise/views/show.html.haml +11 -0
  44. data/lib/generators/setup/templates/images/alert.gif +0 -0
  45. data/lib/generators/setup/templates/images/bullet_black.gif +0 -0
  46. data/lib/generators/setup/templates/images/edit.gif +0 -0
  47. data/lib/generators/setup/templates/images/error.gif +0 -0
  48. data/lib/generators/setup/templates/images/help_triangle.gif +0 -0
  49. data/lib/generators/setup/templates/images/logo_learninglab.gif +0 -0
  50. data/lib/generators/setup/templates/images/navbar_bkg.gif +0 -0
  51. data/lib/generators/setup/templates/images/new.gif +0 -0
  52. data/lib/generators/setup/templates/images/notice.gif +0 -0
  53. data/lib/generators/setup/templates/info_controller.rb +4 -0
  54. data/lib/generators/setup/templates/layout.erb +62 -0
  55. data/lib/generators/setup/templates/layout_helper.rb +20 -0
  56. data/lib/generators/setup/templates/root_index.erb +4 -0
  57. data/lib/generators/setup/templates/sass_config.rb +2 -0
  58. data/llab-generators.gemspec +30 -0
  59. metadata +183 -0
@@ -0,0 +1,60 @@
1
+ body {
2
+ text-align: center; }
3
+ * html body legend {
4
+ margin: 0px -8px 16px 0;
5
+ padding: 0; }
6
+ html > body p code {
7
+ *white-space: normal; }
8
+
9
+ .container {
10
+ text-align: left; }
11
+
12
+ ol {
13
+ margin-left: 2em; }
14
+
15
+ sup {
16
+ vertical-align: text-top; }
17
+
18
+ sub {
19
+ vertical-align: text-bottom; }
20
+
21
+ hr {
22
+ margin: -8px auto 11px; }
23
+
24
+ img {
25
+ -ms-interpolation-mode: bicubic; }
26
+
27
+ fieldset {
28
+ padding-top: 0; }
29
+
30
+ input.text {
31
+ margin: 0.5em 0;
32
+ background-color: white;
33
+ border: 1px solid #bbbbbb; }
34
+ input.text:focus {
35
+ border: 1px solid #666666; }
36
+ input.title {
37
+ margin: 0.5em 0;
38
+ background-color: white;
39
+ border: 1px solid #bbbbbb; }
40
+ input.title:focus {
41
+ border: 1px solid #666666; }
42
+ input.checkbox {
43
+ position: relative;
44
+ top: 0.25em; }
45
+ input.radio {
46
+ position: relative;
47
+ top: 0.25em; }
48
+ input.button {
49
+ position: relative;
50
+ top: 0.25em; }
51
+
52
+ textarea {
53
+ margin: 0.5em 0; }
54
+
55
+ select {
56
+ margin: 0.5em 0; }
57
+
58
+ button {
59
+ position: relative;
60
+ top: 0.25em; }
@@ -0,0 +1,61 @@
1
+ body {
2
+ line-height: 1.5;
3
+ font-family: Helvetica Neue, Arial, Helvetica, sans-serif;
4
+ color: black;
5
+ background: none;
6
+ font-size: 10pt; }
7
+
8
+ .container {
9
+ width: auto;
10
+ margin: 0;
11
+ padding: 0;
12
+ background: none; }
13
+
14
+ hr {
15
+ background: #cccccc;
16
+ color: #cccccc;
17
+ width: 100%;
18
+ height: 2px;
19
+ margin: 2em 0;
20
+ padding: 0;
21
+ border: none; }
22
+ hr.space {
23
+ background: white;
24
+ color: white; }
25
+
26
+ h1, h2, h3, h4, h5, h6 {
27
+ font-family: Helvetica Neue, Arial, Helvetica, sans-serif; }
28
+
29
+ code {
30
+ font-size: 0.9em;
31
+ font-family: 'andale mono', 'lucida console', monospace; }
32
+
33
+ img {
34
+ display: inline;
35
+ float: left;
36
+ }
37
+
38
+ a img {
39
+ border: none; }
40
+ a:link, a:visited {
41
+ background: transparent;
42
+ font-weight: 700;
43
+ text-decoration: none; }
44
+
45
+ p img.top {
46
+ margin-top: 0; }
47
+
48
+ blockquote {
49
+ margin: 1.5em;
50
+ padding: 1em;
51
+ font-style: italic;
52
+ font-size: 0.9em; }
53
+
54
+ .small {
55
+ font-size: 0.9em; }
56
+
57
+ .large {
58
+ font-size: 1.1em; }
59
+
60
+ .quiet {
61
+ color: #999999; }
@@ -0,0 +1,289 @@
1
+ @import constants.sass
2
+ @import mixins.sass
3
+
4
+ /* GENERAL TYPOGRAPHY AND STYLING */
5
+
6
+ html, body
7
+ margin: 0
8
+ height: 100%
9
+
10
+ body
11
+ background: $body_background_color
12
+ font-family: $normal_fonts
13
+ color: $font_color
14
+ text-align: left
15
+
16
+ h1, h2, h3, h4, h5, h6
17
+ font-family: $headline_fonts
18
+ color: $headline_color
19
+ font-weight: bold
20
+ padding-left: 0.1em
21
+ .alt
22
+ font-size: 70%
23
+ color: #aaa
24
+
25
+ p, ul
26
+ padding-left: 0.1em
27
+
28
+ ul
29
+ @include no-bullets
30
+ margin-left: 0
31
+ li
32
+ padding-left: 20px
33
+ background: transparent url(../../images/icons/bullet_black.gif) top left no-repeat
34
+
35
+ ul.no_bullets
36
+ li
37
+ padding-left: 0
38
+ background-image: none
39
+
40
+ a
41
+ color: $link_color
42
+ text-decoration: none
43
+ outline: 0
44
+ &:visited
45
+ color: $link_color
46
+ &:hover
47
+ color: $link_hover_color
48
+ text-decoration: underline
49
+ &:active
50
+ color: $link_active_color
51
+ text-decoration: none
52
+ &.cancel
53
+ color: red
54
+ &.cancel:active
55
+ color: $link_active_color
56
+ background: red
57
+
58
+ a
59
+ img
60
+ border: 0
61
+
62
+ img.icon
63
+ vertical-align: middle
64
+
65
+ /* UTILITY CLASSES AND ELEMENTS */
66
+
67
+ .float_left
68
+ display: inline
69
+ float: left
70
+ .float_right
71
+ float: right
72
+ display: inline
73
+
74
+ .aligncenter
75
+ text-align: center
76
+ .alignleft
77
+ text-align: left
78
+ .alignright
79
+ text-align: right
80
+
81
+ br.clear
82
+ clear: both
83
+
84
+ .weak, .quiet, small
85
+ @include weak
86
+ .strong, .loud, strong
87
+ font-weight: bold
88
+ color: $strong_color
89
+ .italic
90
+ font-style: italic
91
+ .hidden
92
+ display: none
93
+ small
94
+ font-size: 85%
95
+
96
+ table
97
+ :width 98%
98
+ :margin-left 0.1em
99
+ :border-collapse collapse
100
+ tbody
101
+ :border-bottom 1px solid #bbb
102
+ tfoot
103
+ :font-style normal
104
+ th
105
+ :text-align left
106
+ :border 1px solid #ccc
107
+ :border-bottom 1px solid #bbb
108
+ :color #000
109
+ tr.odd td
110
+ :background #fafafa
111
+ tr.even td
112
+ :background #eee
113
+
114
+ hr
115
+ color: #ccc
116
+ background-color: #ccc
117
+ border: 1px solid #ccc
118
+
119
+ span.handle
120
+ cursor: move
121
+
122
+ .hide_container
123
+ .hide_element
124
+ display: none
125
+ .hide_container:hover
126
+ .hide_element
127
+ display: inline
128
+
129
+ /* FORMS */
130
+
131
+ label
132
+ font-weight: bold
133
+ input
134
+ padding: 0.1em 0.2em
135
+ font-size: 160%
136
+ max-width: 300px
137
+ textarea
138
+ width: 99%
139
+ height: 150px
140
+ padding: 0.2em
141
+ font-family: courier
142
+ font-size: 14px
143
+ line-height: 18px
144
+ .help
145
+ padding: 0.8em 0.8em 0.8em 1.6em
146
+ margin-bottom: 1em
147
+ background: #fff6bf url(../../images/help_triangle.gif) top left no-repeat
148
+ color: #514721
149
+
150
+ .required
151
+ @include weak
152
+
153
+ p.buttons
154
+ @include clearfix
155
+ margin-bottom: 1.5em
156
+
157
+ a.button
158
+ @include anchor-button(left)
159
+ @include button-colors
160
+ @include button-hover-colors
161
+ @include button-active-colors
162
+
163
+ button
164
+ @include button-button(left)
165
+ @include button-colors
166
+ @include button-hover-colors
167
+ @include button-active-colors
168
+
169
+ a.positive, button.positive
170
+ color: #529214
171
+ @include button-hover-colors(#529214, #E6EFC2, #C6D880)
172
+ @include button-active-colors(#FFF, #529214, #529214)
173
+
174
+ a.negative, button.negative
175
+ color: #D12F19
176
+ @include button-hover-colors(#D12F19, #FBE3E4, #FBC2C4)
177
+ @include button-active-colors(#FFF, #D12F19, #D12F19)
178
+
179
+ /* LAYOUT ELEMENTS */
180
+
181
+ #wrap
182
+ min-width: 1000px
183
+ background: $content_background_color
184
+ #header
185
+ @include clearfix
186
+ background: $header_background_color
187
+ text-align: left
188
+ #logo
189
+ width: 950px
190
+ margin: 0 auto
191
+ h1
192
+ margin-top: 0.3em
193
+ font-size: 2em
194
+ color: #fff
195
+ font-family: $headline_fonts
196
+ a
197
+ color: #fff
198
+ text-decoration: none
199
+ &:hover
200
+ color: #eee
201
+ &:active
202
+ color: #ddd
203
+ .alt
204
+ margin-left: 0.5em
205
+ font-size: 70%
206
+ color: #aaa
207
+ #navbar
208
+ @include clearfix
209
+ padding: 5px 0
210
+ background:
211
+ color: $navbar_background_color
212
+ image: url(../../images/navbar_bkg.gif)
213
+ position: center center
214
+ repeat: repeat-x
215
+ border:
216
+ top: 1px solid #ccc
217
+ bottom: 1px solid #ccc
218
+ #menu
219
+ width: 950px
220
+ margin: 0 auto
221
+ ul
222
+ @include float(right)
223
+ @include horizontal-list(1em)
224
+ font-family: $headline_fonts
225
+ border-left: 1px solid #ccc
226
+ li
227
+ background-image: none
228
+ border:
229
+ left: 1px solid #fff
230
+ right: 1px solid #ccc
231
+ text-shadow: 1px 1px 0px #fff
232
+ a
233
+ @include link-colors(#464646,#000)
234
+ text-decoration: none
235
+ font-weight: bold
236
+ #flash_box
237
+ left: 0
238
+ padding: 1em 0
239
+ position: absolute
240
+ width: 100%
241
+ z-index: 100
242
+ opacity: 0.8
243
+ background-color: #FCFCFF
244
+ border-bottom: 1px solid #CCCCCC
245
+ cursor: pointer
246
+ #notice, #alert, #error
247
+ font-weight: bold
248
+ text-align: center
249
+ #notice
250
+ color: #264409
251
+ #alert
252
+ color: #514721
253
+ #error
254
+ color: #8A1F11
255
+ #content
256
+ @include clearfix
257
+ margin: 1.5em auto 0
258
+ padding: 0 0 1.5em
259
+ text-align: left
260
+ background: transparent
261
+ #title
262
+ #main
263
+ min-height: 500px
264
+ height: auto !important
265
+ height: 500px
266
+ #footer
267
+ @include clearfix
268
+ border-top: 1px solid #ccc
269
+ background: $footer_background_color
270
+ #footer_content
271
+ @include clearfix
272
+ margin: 0 auto
273
+ padding: 1.5em 0 1.5em
274
+ h3
275
+ margin-bottom: 0
276
+ text-shadow: 1px 1px 0px #fff
277
+ p, ul
278
+ color: #aaa
279
+ margin: 0
280
+ text-shadow: 1px 1px 0px #fff
281
+ ul
282
+ li
283
+ background-image: none
284
+ padding-left: 0
285
+ a, a:visited, a:focus, a:active
286
+ @include strong
287
+ color: #aaa
288
+ a:hover
289
+ color: #666
@@ -0,0 +1,23 @@
1
+ authorization do
2
+ role :guest do
3
+ end
4
+
5
+ role :user do
6
+ includes :guest
7
+ has_permission_on :users, :to => :show do
8
+ if_attribute :id => is {user.id}
9
+ end
10
+ end
11
+
12
+ role :admin do
13
+ has_permission_on :users, :to => :manage
14
+ end
15
+ end
16
+
17
+ privileges do
18
+ privilege :manage, :includes => [:create, :read, :update, :delete]
19
+ privilege :read, :includes => [:index, :show]
20
+ privilege :create, :includes => :new
21
+ privilege :update, :includes => :edit
22
+ privilege :delete, :includes => :destroy
23
+ end
@@ -0,0 +1,26 @@
1
+ class DeviseCreateUsers < ActiveRecord::Migration
2
+ def self.up
3
+ create_table(:users) do |t|
4
+ t.database_authenticatable :null => false
5
+ t.recoverable
6
+ t.rememberable
7
+ t.trackable
8
+ t.integer :roles_mask, :default => 1
9
+
10
+ # t.confirmable
11
+ # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
12
+ # t.token_authenticatable
13
+
14
+ t.timestamps
15
+ end
16
+
17
+ add_index :users, :email, :unique => true
18
+ add_index :users, :reset_password_token, :unique => true
19
+ # add_index :users, :confirmation_token, :unique => true
20
+ # add_index :users, :unlock_token, :unique => true
21
+ end
22
+
23
+ def self.down
24
+ drop_table :users
25
+ end
26
+ end