lalala 4.0.0.dev.416 → 4.1.0.dev.299

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/Gemfile +1 -3
  4. data/Haraway.md +14 -0
  5. data/app/assets/javascripts/lalala/base.js +8 -0
  6. data/app/assets/javascripts/lalala/initializers/chosen.module.js +3 -0
  7. data/app/assets/javascripts/lalala/initializers/haraway.module.js +8 -0
  8. data/app/assets/javascripts/lalala/lib/overlay.js +335 -0
  9. data/app/assets/javascripts/lalala/modules/collapsible_pages_tree.module.js +26 -33
  10. data/app/assets/javascripts/lalala/modules/editor.module.js +37 -23
  11. data/app/assets/javascripts/lalala/modules/file-uploader-metadata.module.js +248 -0
  12. data/app/assets/javascripts/lalala/modules/file-uploader.module.js +376 -0
  13. data/app/assets/javascripts/lalala/modules/init.module.js +1 -5
  14. data/app/assets/javascripts/lalala/modules/media_selector.module.js +250 -0
  15. data/app/assets/javascripts/lalala/modules/overlay.module.js +33 -0
  16. data/app/assets/stylesheets/lalala/_base.css.scss +5 -2
  17. data/app/assets/stylesheets/lalala/components/_buttons.css.scss +11 -3
  18. data/app/assets/stylesheets/lalala/components/_forms.css.scss +14 -64
  19. data/app/assets/stylesheets/lalala/lib/_overlay.css.scss +66 -0
  20. data/app/assets/stylesheets/lalala/modules/_dashboard.css.scss +10 -51
  21. data/app/assets/stylesheets/lalala/modules/_editor-cheatsheet.css.scss +1 -17
  22. data/app/assets/stylesheets/lalala/modules/_file-uploader-metadata.css.scss +118 -0
  23. data/app/assets/stylesheets/lalala/modules/_file-uploader.css.scss +289 -0
  24. data/app/assets/stylesheets/lalala/modules/_media-selector.css.scss +113 -0
  25. data/app/assets/stylesheets/lalala/modules/_title-bar.css.scss +0 -17
  26. data/app/controllers/lalala/public/errors_controller.rb +7 -0
  27. data/app/models/lalala/page.rb +0 -1
  28. data/app/views/lalala/markdown/cheatsheet.html.erb +0 -2
  29. data/config/routes.rb +12 -1
  30. data/lalala-assets.gemspec +3 -3
  31. data/lalala-development.gemspec +1 -1
  32. data/lalala-test.gemspec +1 -1
  33. data/lalala.gemspec +4 -5
  34. data/lib/formtastic/form_builder_ext.rb +10 -0
  35. data/lib/formtastic/inputs/haraway_input.rb +151 -0
  36. data/lib/generators/lalala/assets/templates/bower.json.erb +1 -1
  37. data/lib/generators/lalala/install/install_generator.rb +0 -23
  38. data/lib/lalala/admin/pages.rb +1 -26
  39. data/lib/lalala/engine.rb +0 -7
  40. data/lib/lalala/ext_action_dispatch.rb +0 -1
  41. data/lib/lalala/ext_active_record/i18n_translations_writer.rb +0 -1
  42. data/lib/lalala/ext_active_record.rb +0 -1
  43. data/lib/lalala/ext_i18n/input_helper.rb +0 -1
  44. data/lib/lalala/ext_i18n/negotiation_adapter.rb +0 -4
  45. data/lib/lalala/ext_i18n/test_negotiation_adapter.rb +0 -4
  46. data/lib/lalala/ext_rack/i18n_negotiator.rb +7 -9
  47. data/lib/lalala/markdown/handlers/asset.rb +24 -0
  48. data/lib/lalala/markdown/handlers/youtube.rb +9 -13
  49. data/lib/lalala/markdown/html_renderer.rb +2 -2
  50. data/lib/lalala/markdown.rb +2 -3
  51. data/lib/lalala/utils/install_template.rb +3 -9
  52. data/lib/lalala/version.rb +2 -2
  53. data/lib/lalala.rb +6 -7
  54. data/script/ci +33 -30
  55. data/test/dummy/app/admin/articles.rb +26 -12
  56. data/test/dummy/app/admin/dashboard.rb +5 -8
  57. data/test/dummy/app/admin/tags.rb +1 -3
  58. data/test/dummy/app/assets/stylesheets/_normalize.css +423 -0
  59. data/test/dummy/app/assets/stylesheets/application.css.scss +2 -0
  60. data/test/dummy/app/assets/stylesheets/base/_base.css.scss +4 -0
  61. data/test/dummy/app/controllers/pages_controller.rb +4 -0
  62. data/test/dummy/app/models/article.rb +10 -4
  63. data/test/dummy/app/pages/application_page.rb +7 -2
  64. data/test/dummy/app/pages/basic_page.rb +5 -6
  65. data/test/dummy/app/pages/home_page.rb +10 -10
  66. data/test/dummy/app/pages/media_page.rb +23 -0
  67. data/test/dummy/app/views/admin/_stats.html.erb +7 -14
  68. data/test/dummy/app/views/layouts/application.html.erb +6 -2
  69. data/test/dummy/app/views/pages/media.html.erb +3 -0
  70. data/test/dummy/config/initializers/haraway.rb +29 -0
  71. data/test/dummy/config/routes.rb +1 -0
  72. data/test/dummy/db/migrate/20130528092721_create_articles.rb +1 -0
  73. data/test/dummy/db/migrate/20130729125648_create_home_page.rb +4 -0
  74. data/test/dummy/db/migrate/20131122144302_enable_haraway.rb +16 -0
  75. data/test/dummy/db/migrate/20140228141749_create_media_page.rb +8 -0
  76. data/test/dummy/db/schema.rb +2 -4
  77. data/test/integration/aricles_test.rb +0 -1
  78. metadata +59 -81
  79. data/app/assets/javascripts/jquery-ui/sortable.js +0 -0
  80. data/app/assets/javascripts/lalala/lib/jquery-ui.js +0 -16617
  81. data/app/assets/javascripts/lalala/modules/grid.module.js +0 -284
  82. data/app/assets/javascripts/lalala/modules/input_group.module.js +0 -36
  83. data/app/assets/stylesheets/lalala/modules/_grid.css.scss +0 -197
  84. data/app/assets/stylesheets/lalala/modules/_index-as-sortable.css.scss +0 -89
  85. data/app/models/lalala/abstract_asset.rb +0 -24
  86. data/app/models/lalala/file_asset.rb +0 -3
  87. data/app/models/lalala/image_asset.rb +0 -3
  88. data/config/initializers/carrierwave.rb +0 -34
  89. data/lib/formtastic/inputs/grid_input.rb +0 -159
  90. data/lib/formtastic/inputs/single_file_input.rb +0 -44
  91. data/lib/generators/lalala/install/templates/application.html.erb +0 -64
  92. data/lib/generators/lalala/install/templates/helpers/application_helper.rb +0 -16
  93. data/lib/generators/lalala/install/templates/helpers/html_helper.rb +0 -60
  94. data/lib/generators/lalala/install/templates/helpers/open_graph_helper.rb.erb +0 -92
  95. data/lib/generators/lalala/install/templates/helpers/pages_helper.rb +0 -15
  96. data/lib/generators/lalala/install/templates/locales/en.yml +0 -6
  97. data/lib/generators/lalala/install/templates/uploaders/file_uploader.rb +0 -2
  98. data/lib/generators/lalala/install/templates/uploaders/image_uploader.rb +0 -11
  99. data/lib/lalala/ext_action_dispatch/multi_file_upload.rb +0 -55
  100. data/lib/lalala/ext_active_record/assets.rb +0 -25
  101. data/lib/lalala/markdown/handlers/soundcloud.rb +0 -36
  102. data/lib/lalala/markdown/handlers/vimeo.rb +0 -40
  103. data/lib/lalala/uploaders/file.rb +0 -50
  104. data/lib/lalala/uploaders/image.rb +0 -13
  105. data/lib/lalala/uploaders.rb +0 -6
  106. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  107. data/test/dummy/app/models/file_asset.rb +0 -2
  108. data/test/dummy/app/models/image_asset.rb +0 -2
  109. data/test/dummy/app/uploaders/file_uploader.rb +0 -2
  110. data/test/dummy/app/uploaders/image_uploader.rb +0 -11
  111. data/test/dummy/db/migrate/20140926152646_add_pre_and_postpend_test_columns_to_articles.rb +0 -6
@@ -1,44 +1,58 @@
1
1
  ActiveAdmin.register Article do
2
-
3
2
  scope :all, :default => true
4
3
  scope :catA
5
4
  scope :catB
6
5
  scope :catC
7
6
 
7
+ #
8
+ # Form
9
+ #
8
10
  form do |f|
9
11
  f.inputs do
10
12
  f.input :title
11
13
  f.input :body
12
14
  f.input :tags
13
15
  f.input :category, as: :select, collection: %w(A B C)
14
- f.input :url, input_html: { placeholder: 'http://', class: 'js-prepend-placeholder' }
15
- f.input :price, input_html: { placeholder: '€', class: 'js-append-placeholder' }
16
- f.input :image, as: :single_file
16
+
17
+ f.input :images, as: :haraway do |h|
18
+ h.inputs do
19
+ h.input :title, as: :string
20
+ h.input :caption, as: :text
21
+ end
22
+ end
23
+
24
+ f.input :downloads, as: :haraway do |h|
25
+ h.inputs do
26
+ h.input :title, as: :string
27
+ h.input :category, as: :select, collection: %w(X Y Z)
28
+ h.input :featured, as: :boolean
29
+ end
30
+ end
17
31
  end
32
+
18
33
  f.actions
19
34
  end
20
35
 
36
+
37
+ #
38
+ # Sidebar
39
+ #
21
40
  sidebar "Actions", :only => [:edit] do
22
41
 
23
42
  div :class =>"lalala sidebar actions", :id => "lalala_sidebar_actions" do
24
-
25
-
26
-
27
43
  end
28
44
 
29
45
  end
30
46
 
31
- sidebar "Information", :only => [:edit] do
32
47
 
48
+ sidebar "Information", :only => [:edit] do
33
49
  div :class => "lalala sidebar message", :id => "lalala_sidebar_message" do
34
50
  "This item has been updated last at <strong>Feb 14th, 2014</strong> by <a href='#link-to-hans-profile'>Hans</a>.".html_safe
35
51
  end
36
-
37
52
  end
38
53
 
39
54
 
40
55
  sidebar "Related tags", :only => [:show] do
41
-
42
56
  div :class => "lalala sidebar message", :id => "lalala_sidebar_message" do
43
57
  "This is an intro block.... It is yours. It is the best <strong>intro block</strong> in the world. Click the link for a tag detail.".html_safe
44
58
  end
@@ -65,9 +79,9 @@ ActiveAdmin.register Article do
65
79
  end
66
80
 
67
81
  end
68
-
69
82
  end
70
83
 
84
+
71
85
  sidebar "Help", :only => [:show] do
72
86
  div :class => "lalala sidebar message", :id => "lalala_sidebar_message" do
73
87
  "Test".html_safe
@@ -86,9 +100,9 @@ ActiveAdmin.register Article do
86
100
  end
87
101
 
88
102
  end
89
-
90
103
  end
91
104
 
105
+
92
106
  sidebar "User Information", :only => [:show] do
93
107
  div :class => "lalala sidebar person" do
94
108
 
@@ -1,8 +1,11 @@
1
1
  ActiveAdmin.register_page "Dashboard" do
2
-
3
2
  menu :priority => 1, :label => proc{ I18n.t("active_admin.dashboard") }
4
3
 
4
+ #
5
+ # Content
6
+ #
5
7
  content :title => proc{ I18n.t("active_admin.dashboard") } do
8
+
6
9
  div :class => "blank_slate_container", :id => "dashboard_default_message" do
7
10
  span :class => "blank_slate" do
8
11
  span "Howdy, partner! You’ve reached your own personal LALALA dashboard, full of stats, data and extravaganza!"
@@ -12,17 +15,13 @@ ActiveAdmin.register_page "Dashboard" do
12
15
  # Here is an example of a simple dashboard with columns and panels.
13
16
  #
14
17
  columns do
15
-
16
18
  column do
17
-
18
19
  render partial: "/admin/stats", :locals => { :matches => "test" }
19
-
20
20
  end
21
-
22
21
  end
23
22
 
24
- columns do
25
23
 
24
+ columns do
26
25
  column :span => 2 do
27
26
  panel "Recent Posts List" do
28
27
  ul do
@@ -45,7 +44,6 @@ ActiveAdmin.register_page "Dashboard" do
45
44
  end
46
45
  end
47
46
  end
48
-
49
47
  end
50
48
 
51
49
 
@@ -59,7 +57,6 @@ ActiveAdmin.register_page "Dashboard" do
59
57
  end
60
58
  end
61
59
  end
62
-
63
60
  end
64
61
 
65
62
 
@@ -1,7 +1,5 @@
1
1
  ActiveAdmin.register Tag do
2
-
3
- #menu priority: 50, html_options: { class: 'icon-tag-purple' }
4
-
2
+ # menu priority: 50, html_options: { class: 'icon-tag-purple' }
5
3
 
6
4
  form do |f|
7
5
  f.inputs do
@@ -0,0 +1,423 @@
1
+ /*! normalize.css v3.0.0 | MIT License | git.io/normalize */
2
+
3
+ /**
4
+ * 1. Set default font family to sans-serif.
5
+ * 2. Prevent iOS text size adjust after orientation change, without disabling
6
+ * user zoom.
7
+ */
8
+
9
+ html {
10
+ font-family: sans-serif; /* 1 */
11
+ -ms-text-size-adjust: 100%; /* 2 */
12
+ -webkit-text-size-adjust: 100%; /* 2 */
13
+ }
14
+
15
+ /**
16
+ * Remove default margin.
17
+ */
18
+
19
+ body {
20
+ margin: 0;
21
+ }
22
+
23
+ /* HTML5 display definitions
24
+ ========================================================================== */
25
+
26
+ /**
27
+ * Correct `block` display not defined in IE 8/9.
28
+ */
29
+
30
+ article,
31
+ aside,
32
+ details,
33
+ figcaption,
34
+ figure,
35
+ footer,
36
+ header,
37
+ hgroup,
38
+ main,
39
+ nav,
40
+ section,
41
+ summary {
42
+ display: block;
43
+ }
44
+
45
+ /**
46
+ * 1. Correct `inline-block` display not defined in IE 8/9.
47
+ * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
48
+ */
49
+
50
+ audio,
51
+ canvas,
52
+ progress,
53
+ video {
54
+ display: inline-block; /* 1 */
55
+ vertical-align: baseline; /* 2 */
56
+ }
57
+
58
+ /**
59
+ * Prevent modern browsers from displaying `audio` without controls.
60
+ * Remove excess height in iOS 5 devices.
61
+ */
62
+
63
+ audio:not([controls]) {
64
+ display: none;
65
+ height: 0;
66
+ }
67
+
68
+ /**
69
+ * Address `[hidden]` styling not present in IE 8/9.
70
+ * Hide the `template` element in IE, Safari, and Firefox < 22.
71
+ */
72
+
73
+ [hidden],
74
+ template {
75
+ display: none;
76
+ }
77
+
78
+ /* Links
79
+ ========================================================================== */
80
+
81
+ /**
82
+ * Remove the gray background color from active links in IE 10.
83
+ */
84
+
85
+ a {
86
+ background: transparent;
87
+ }
88
+
89
+ /**
90
+ * Improve readability when focused and also mouse hovered in all browsers.
91
+ */
92
+
93
+ a:active,
94
+ a:hover {
95
+ outline: 0;
96
+ }
97
+
98
+ /* Text-level semantics
99
+ ========================================================================== */
100
+
101
+ /**
102
+ * Address styling not present in IE 8/9, Safari 5, and Chrome.
103
+ */
104
+
105
+ abbr[title] {
106
+ border-bottom: 1px dotted;
107
+ }
108
+
109
+ /**
110
+ * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
111
+ */
112
+
113
+ b,
114
+ strong {
115
+ font-weight: bold;
116
+ }
117
+
118
+ /**
119
+ * Address styling not present in Safari 5 and Chrome.
120
+ */
121
+
122
+ dfn {
123
+ font-style: italic;
124
+ }
125
+
126
+ /**
127
+ * Address variable `h1` font-size and margin within `section` and `article`
128
+ * contexts in Firefox 4+, Safari 5, and Chrome.
129
+ */
130
+
131
+ h1 {
132
+ font-size: 2em;
133
+ margin: 0.67em 0;
134
+ }
135
+
136
+ /**
137
+ * Address styling not present in IE 8/9.
138
+ */
139
+
140
+ mark {
141
+ background: #ff0;
142
+ color: #000;
143
+ }
144
+
145
+ /**
146
+ * Address inconsistent and variable font size in all browsers.
147
+ */
148
+
149
+ small {
150
+ font-size: 80%;
151
+ }
152
+
153
+ /**
154
+ * Prevent `sub` and `sup` affecting `line-height` in all browsers.
155
+ */
156
+
157
+ sub,
158
+ sup {
159
+ font-size: 75%;
160
+ line-height: 0;
161
+ position: relative;
162
+ vertical-align: baseline;
163
+ }
164
+
165
+ sup {
166
+ top: -0.5em;
167
+ }
168
+
169
+ sub {
170
+ bottom: -0.25em;
171
+ }
172
+
173
+ /* Embedded content
174
+ ========================================================================== */
175
+
176
+ /**
177
+ * Remove border when inside `a` element in IE 8/9.
178
+ */
179
+
180
+ img {
181
+ border: 0;
182
+ }
183
+
184
+ /**
185
+ * Correct overflow displayed oddly in IE 9.
186
+ */
187
+
188
+ svg:not(:root) {
189
+ overflow: hidden;
190
+ }
191
+
192
+ /* Grouping content
193
+ ========================================================================== */
194
+
195
+ /**
196
+ * Address margin not present in IE 8/9 and Safari 5.
197
+ */
198
+
199
+ figure {
200
+ margin: 1em 40px;
201
+ }
202
+
203
+ /**
204
+ * Address differences between Firefox and other browsers.
205
+ */
206
+
207
+ hr {
208
+ -moz-box-sizing: content-box;
209
+ box-sizing: content-box;
210
+ height: 0;
211
+ }
212
+
213
+ /**
214
+ * Contain overflow in all browsers.
215
+ */
216
+
217
+ pre {
218
+ overflow: auto;
219
+ }
220
+
221
+ /**
222
+ * Address odd `em`-unit font size rendering in all browsers.
223
+ */
224
+
225
+ code,
226
+ kbd,
227
+ pre,
228
+ samp {
229
+ font-family: monospace, monospace;
230
+ font-size: 1em;
231
+ }
232
+
233
+ /* Forms
234
+ ========================================================================== */
235
+
236
+ /**
237
+ * Known limitation: by default, Chrome and Safari on OS X allow very limited
238
+ * styling of `select`, unless a `border` property is set.
239
+ */
240
+
241
+ /**
242
+ * 1. Correct color not being inherited.
243
+ * Known issue: affects color of disabled elements.
244
+ * 2. Correct font properties not being inherited.
245
+ * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
246
+ */
247
+
248
+ button,
249
+ input,
250
+ optgroup,
251
+ select,
252
+ textarea {
253
+ color: inherit; /* 1 */
254
+ font: inherit; /* 2 */
255
+ margin: 0; /* 3 */
256
+ }
257
+
258
+ /**
259
+ * Address `overflow` set to `hidden` in IE 8/9/10.
260
+ */
261
+
262
+ button {
263
+ overflow: visible;
264
+ }
265
+
266
+ /**
267
+ * Address inconsistent `text-transform` inheritance for `button` and `select`.
268
+ * All other form control elements do not inherit `text-transform` values.
269
+ * Correct `button` style inheritance in Firefox, IE 8+, and Opera
270
+ * Correct `select` style inheritance in Firefox.
271
+ */
272
+
273
+ button,
274
+ select {
275
+ text-transform: none;
276
+ }
277
+
278
+ /**
279
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
280
+ * and `video` controls.
281
+ * 2. Correct inability to style clickable `input` types in iOS.
282
+ * 3. Improve usability and consistency of cursor style between image-type
283
+ * `input` and others.
284
+ */
285
+
286
+ button,
287
+ html input[type="button"], /* 1 */
288
+ input[type="reset"],
289
+ input[type="submit"] {
290
+ -webkit-appearance: button; /* 2 */
291
+ cursor: pointer; /* 3 */
292
+ }
293
+
294
+ /**
295
+ * Re-set default cursor for disabled elements.
296
+ */
297
+
298
+ button[disabled],
299
+ html input[disabled] {
300
+ cursor: default;
301
+ }
302
+
303
+ /**
304
+ * Remove inner padding and border in Firefox 4+.
305
+ */
306
+
307
+ button::-moz-focus-inner,
308
+ input::-moz-focus-inner {
309
+ border: 0;
310
+ padding: 0;
311
+ }
312
+
313
+ /**
314
+ * Address Firefox 4+ setting `line-height` on `input` using `!important` in
315
+ * the UA stylesheet.
316
+ */
317
+
318
+ input {
319
+ line-height: normal;
320
+ }
321
+
322
+ /**
323
+ * It's recommended that you don't attempt to style these elements.
324
+ * Firefox's implementation doesn't respect box-sizing, padding, or width.
325
+ *
326
+ * 1. Address box sizing set to `content-box` in IE 8/9/10.
327
+ * 2. Remove excess padding in IE 8/9/10.
328
+ */
329
+
330
+ input[type="checkbox"],
331
+ input[type="radio"] {
332
+ box-sizing: border-box; /* 1 */
333
+ padding: 0; /* 2 */
334
+ }
335
+
336
+ /**
337
+ * Fix the cursor style for Chrome's increment/decrement buttons. For certain
338
+ * `font-size` values of the `input`, it causes the cursor style of the
339
+ * decrement button to change from `default` to `text`.
340
+ */
341
+
342
+ input[type="number"]::-webkit-inner-spin-button,
343
+ input[type="number"]::-webkit-outer-spin-button {
344
+ height: auto;
345
+ }
346
+
347
+ /**
348
+ * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
349
+ * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
350
+ * (include `-moz` to future-proof).
351
+ */
352
+
353
+ input[type="search"] {
354
+ -webkit-appearance: textfield; /* 1 */
355
+ -moz-box-sizing: content-box;
356
+ -webkit-box-sizing: content-box; /* 2 */
357
+ box-sizing: content-box;
358
+ }
359
+
360
+ /**
361
+ * Remove inner padding and search cancel button in Safari and Chrome on OS X.
362
+ * Safari (but not Chrome) clips the cancel button when the search input has
363
+ * padding (and `textfield` appearance).
364
+ */
365
+
366
+ input[type="search"]::-webkit-search-cancel-button,
367
+ input[type="search"]::-webkit-search-decoration {
368
+ -webkit-appearance: none;
369
+ }
370
+
371
+ /**
372
+ * Define consistent border, margin, and padding.
373
+ */
374
+
375
+ fieldset {
376
+ border: 1px solid #c0c0c0;
377
+ margin: 0 2px;
378
+ padding: 0.35em 0.625em 0.75em;
379
+ }
380
+
381
+ /**
382
+ * 1. Correct `color` not being inherited in IE 8/9.
383
+ * 2. Remove padding so people aren't caught out if they zero out fieldsets.
384
+ */
385
+
386
+ legend {
387
+ border: 0; /* 1 */
388
+ padding: 0; /* 2 */
389
+ }
390
+
391
+ /**
392
+ * Remove default vertical scrollbar in IE 8/9.
393
+ */
394
+
395
+ textarea {
396
+ overflow: auto;
397
+ }
398
+
399
+ /**
400
+ * Don't inherit the `font-weight` (applied by a rule above).
401
+ * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
402
+ */
403
+
404
+ optgroup {
405
+ font-weight: bold;
406
+ }
407
+
408
+ /* Tables
409
+ ========================================================================== */
410
+
411
+ /**
412
+ * Remove most spacing between table cells.
413
+ */
414
+
415
+ table {
416
+ border-collapse: collapse;
417
+ border-spacing: 0;
418
+ }
419
+
420
+ td,
421
+ th {
422
+ padding: 0;
423
+ }
@@ -0,0 +1,2 @@
1
+ @import "normalize";
2
+ @import "base/base";
@@ -0,0 +1,4 @@
1
+ body {
2
+ font: normal 22px/30px "Adobe Caslon Pro", serif;
3
+ margin: 70px;
4
+ }
@@ -1,2 +1,6 @@
1
1
  class PagesController < Lalala::Public::PagesController
2
+
3
+ def media
4
+ end
5
+
2
6
  end
@@ -1,17 +1,23 @@
1
1
  class Article < ActiveRecord::Base
2
- attr_accessible :body, :title, :category, :tag_ids, :url, :price
3
-
4
- has_one_asset :image
2
+ attr_accessible :body, :title, :category, :tag_ids, :images, :downloads
5
3
 
6
4
  # Translations
7
5
  translates :title, :body
8
6
 
7
+ # Markdown
8
+ markdown :body
9
+
10
+ # Assets
11
+ has_many_assets :images, :images
12
+ has_many_assets :downloads, :downloads
13
+
9
14
  # Validations
10
15
  validates :title, presence: true
11
16
 
12
17
  # Markdown columns
13
18
  markdown :body, tables: true, link_schemes: {
14
- "youtube" => Lalala::Markdown::Handlers::YouTube.new(width: 520, height: 292)
19
+ "youtube" => Lalala::Markdown::Handlers::YouTube.new(width: 520, height: 292),
20
+ "asset" => Lalala::Markdown::Handlers::Asset.new
15
21
  }
16
22
 
17
23
  # Scopes
@@ -1,10 +1,15 @@
1
1
  class ApplicationPage < Lalala::Page
2
+ attr_accessible :images
2
3
 
3
4
  # All translated columns should be defined here:
4
5
  # translates :body
5
6
 
6
7
  # All page associations should be placed here:
7
- # has_many :comments
8
+ has_many_assets :images, :images
9
+
10
+ markdown :body, tables: true, link_schemes: {
11
+ "youtube" => Lalala::Markdown::Handlers::YouTube.new(width: 520, height: 292),
12
+ "asset" => Lalala::Markdown::Handlers::Asset.new
13
+ }
8
14
 
9
- markdown :body
10
15
  end
@@ -1,11 +1,10 @@
1
1
  class BasicPage < ApplicationPage
2
2
 
3
- # self.route = nil # slug
4
- # self.allow_create = true
5
- # self.allow_destroy = true
6
- # self.minimum_children = nil
7
- # self.minimum_children = nil
8
- self.allowed_children = ['BasicPage']
3
+ # self.route = nil # slug
4
+ # self.allow_create = true
5
+ # self.allow_destroy = true
6
+ # self.minimum_children = nil
7
+ self.allowed_children = ['BasicPage']
9
8
 
10
9
  # form do |f|
11
10
  # f.inputs
@@ -1,20 +1,20 @@
1
1
  class HomePage < ApplicationPage
2
2
 
3
- self.route = ''
4
- self.allow_create = false
5
- self.allow_destroy = false
6
- # self.minimum_children = nil
7
- # self.minimum_children = nil
8
- self.allowed_children = ['BasicPage']
3
+ # self.minimum_children = nil
4
+ self.route = ''
5
+ self.allow_create = false
6
+ self.allow_destroy = false
7
+ self.allowed_children = ['BasicPage', 'MediaPage']
9
8
 
10
9
  # form do |f|
11
10
  # f.inputs
12
11
  # f.buttons
13
12
  # end
14
13
 
15
- # def static_children
16
- # {}
17
- # end
18
- #
14
+ def static_children
15
+ {
16
+ media: MediaPage.new
17
+ }
18
+ end
19
19
 
20
20
  end
@@ -0,0 +1,23 @@
1
+ class MediaPage < BasicPage
2
+
3
+ self.route = "media"
4
+ self.allow_create = false
5
+ self.allow_destroy = false
6
+
7
+ form do |f|
8
+ f.inputs do
9
+ f.input :title
10
+ f.input :body
11
+ f.input :images, as: :haraway do |h|
12
+ h.inputs do
13
+ h.input :title, as: :string
14
+ h.input :choice, as: :select, collection: %w(A B C)
15
+ h.input :check_it, as: :boolean
16
+ end
17
+ end
18
+ end
19
+
20
+ f.actions
21
+ end
22
+
23
+ end