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,284 +0,0 @@
1
- var Grid;
2
-
3
-
4
- exports.init = function() {
5
- var instances = [];
6
- this.$el = $(".grid");
7
- this.$el.each(function() { instances.push(new Grid(this)); });
8
- };
9
-
10
-
11
- Grid = (function() {
12
- var __bind = function(fn, me) {
13
- return function() { return fn.apply(me, arguments); };
14
- };
15
-
16
-
17
- function G(grid_element) {
18
- this.selected_assets = [];
19
-
20
- this.transform_html(grid_element);
21
- this.bind_mouse_events();
22
- this.setup_mouse_selection();
23
- }
24
-
25
-
26
- G.prototype.transform_html = function(grid_element) {
27
- var fragment, clear_element, el, el_assets, el_actions, el_errors,
28
- $grid, $original_list;
29
-
30
- // elements
31
- $grid = $(grid_element);
32
- $original_list = $grid.children("ul:first-child");
33
-
34
- // document fragment for the assets
35
- fragment = document.createDocumentFragment();
36
-
37
- // transform assets html
38
- $grid.find("li.asset").not(":last-child").each(function() {
39
- var grid_piece = document.createElement("li");
40
- grid_piece.className = "asset";
41
- grid_piece.innerHTML = this.innerHTML.replace("<a", "<a class=\"thumbnail\"");
42
-
43
- var overlay = document.createElement("div");
44
- overlay.className = "overlay";
45
- $(overlay).attr("title", $(this).attr("title"));
46
-
47
- grid_piece.appendChild(overlay);
48
- fragment.appendChild(grid_piece);
49
- });
50
-
51
- // create new container elements
52
- el = document.createElement("div");
53
- el.className = "mod-grid";
54
-
55
- clear_element = document.createElement("div");
56
- clear_element.className = "clear";
57
-
58
- el_assets = document.createElement("ul");
59
- el_assets.className = "assets";
60
- el_assets.appendChild(fragment);
61
- el_assets.appendChild(clear_element);
62
-
63
- el_actions = document.createElement("div");
64
- el_actions.className = "actions";
65
- el_actions.innerHTML = "" +
66
- $grid.find("li.actions").html() +
67
- '<a class="button" rel="choose-files">Choose files</a>' +
68
- '<div class="files-description"></div>' +
69
- '<a class="button unavailable" rel="edit">Edit selected</a>' +
70
- '<a class="button unavailable" rel="destroy">destroy selected</a>';
71
-
72
- // merge
73
- el.appendChild(el_actions);
74
- el.appendChild(el_assets);
75
-
76
- // errors
77
- if ($grid.find("li.errors").length) {
78
- el_errors = document.createElement("div");
79
- el_errors.className = "errors";
80
- el_errors.innerHTML = $grid.find("li.errors").html();
81
- el.appendChild(el_errors);
82
- }
83
-
84
- // replace original with new
85
- $original_list.replaceWith(el);
86
-
87
- // bind to instance
88
- this.$el = $(el);
89
-
90
- // other layout stuff
91
- this.$el.closest(".inputs").addClass("next");
92
- };
93
-
94
-
95
- G.prototype.check_edit_and_destroy_buttons = function() {
96
- var grid = this;
97
-
98
- this.$el.children(".actions").find('[rel="edit"], [rel="destroy"]').each(function() {
99
- var $btn = $(this);
100
-
101
- if (grid.selected_assets.length === 0) {
102
- $btn.addClass("unavailable");
103
- } else {
104
- $btn.removeClass("unavailable");
105
- }
106
- });
107
- };
108
-
109
-
110
- //
111
- // Events
112
- //
113
- G.prototype.bind_mouse_events = function() {
114
- this.$el.children(".assets")
115
- .on("mouseleave", "li", this.row_mouseleave)
116
- .on("mouseleave", "li label", this.row_label_mouseleave)
117
- .on("mouseenter", "li label", this.row_label_mouseenter)
118
- .on("mouseenter", "li .thumbnail", this.row_thumbnail_mouseenter)
119
- .on("click", "li a", function(e) { e.preventDefault(); })
120
- .on("click", "li .attributes .close-button", this.close_button_click);
121
-
122
- this.$el.children(".actions")
123
- .children("a[rel=\"choose-files\"]").on("click", this.choose_files_button_click).end()
124
- .children("input[type=\"file\"]").on("change", this.file_input_change).trigger("change").end()
125
- .children("a[rel=\"edit\"]").on("click", __bind(this.edit_or_destroy_selected_button_click, this)).end()
126
- .children("a[rel=\"destroy\"]").on("click", __bind(this.edit_or_destroy_selected_button_click, this));
127
- };
128
-
129
- G.prototype.row_mouseleave = function(e) {
130
- $(this).removeClass("properties");
131
- };
132
-
133
- G.prototype.row_label_mouseenter = function(e) {
134
- $(this).parent().addClass("move");
135
- };
136
-
137
- G.prototype.row_label_mouseleave = function(e) {
138
- $(this).parent().addClass("properties").removeClass("move");
139
- };
140
-
141
- G.prototype.row_thumbnail_mouseenter = function(e) {
142
- var $p = $(this).parent();
143
- if ($p.hasClass("edit-block")) return;
144
- $p.addClass("properties");
145
- };
146
-
147
- G.prototype.choose_files_button_click = function(e) {
148
- $(this).parent().children("input[type=\"file\"]").trigger("click");
149
- };
150
-
151
- G.prototype.file_input_change = function(e) {
152
- var val = this.files || $(this).val();
153
- var $fd = $(this).parent().children(".files-description");
154
-
155
- if (typeof val === "object") {
156
- val = val.length;
157
- $fd[0].innerHTML = val + " file" + (val === 1 ? "" : "s") + " chosen";
158
- $fd.show();
159
- }
160
- };
161
-
162
- G.prototype.edit_or_destroy_selected_button_click = function(e) {
163
- var i = 0, j = this.selected_assets.length,
164
- $e = $(e.currentTarget), action = $e.attr("rel");
165
-
166
- if ($e.hasClass("unavailable")) return;
167
-
168
- for (; i<j; ++i) {
169
- var id = this.selected_assets[i];
170
- var $row = $("#" + id).parent();
171
- $row.removeClass("selected");
172
- this["set_to_" + action]($row[0]);
173
- }
174
-
175
- this.selected_assets.length = 0;
176
- this.check_edit_and_destroy_buttons();
177
- };
178
-
179
- G.prototype.close_button_click = function(e) {
180
- $(this).closest("li").removeClass("edit-block");
181
- };
182
-
183
-
184
-
185
- //
186
- // Mouse selection
187
- //
188
- G.prototype.setup_mouse_selection = function() {
189
- var grid = this;
190
-
191
- this.$el.selectable({
192
- filter: "li.asset",
193
- cancel: ".actions,.button,input,textarea,button",
194
- selecting: function(e, ui) {
195
- $row = $(ui.selecting);
196
- if (!$row.hasClass("will-destroy") && !$row.hasClass("edit-block")) {
197
- $row.addClass("selected");
198
- }
199
- },
200
- unselecting: function(e, ui) {
201
- $(ui.unselecting).removeClass("selected");
202
- },
203
- stop: function(e, ui) {
204
- var new_selected_assets = [];
205
- grid.$el.find(".assets > li").each(function() {
206
- var $t = $(this), id;
207
- if ($t.hasClass("selected")) {
208
- id = $t.children('input[type="hidden"]:first').attr("id");
209
- new_selected_assets.push(id + "");
210
- id = null;
211
- }
212
- });
213
- grid.selected_assets = new_selected_assets;
214
- grid.check_edit_and_destroy_buttons();
215
- }
216
- });
217
- };
218
-
219
-
220
-
221
- //
222
- // Edit
223
- //
224
- G.prototype.toggle_edit = function(row) {
225
- if ($(row).hasClass("edit-block")) {
226
- this.set_to_not_edit(row);
227
- } else {
228
- this.set_to_edit(row);
229
- }
230
- };
231
-
232
-
233
- G.prototype.set_to_edit = function(row) {
234
- $(row).addClass("edit-block");
235
- };
236
-
237
-
238
- G.prototype.set_to_not_edit = function(row) {
239
- $(row).removeClass("edit-block");
240
- };
241
-
242
-
243
-
244
- //
245
- // Destroy
246
- //
247
- G.prototype.toggle_destroy = function(row) {
248
- if ($(row).find('input[name$="[_destroy]"]').length) {
249
- this.set_to_not_destroy(row);
250
- } else {
251
- this.set_to_destroy(row);
252
- }
253
- };
254
-
255
-
256
- G.prototype.set_to_destroy = function(row) {
257
- var $row = $(row);
258
- var input_id_name = $row.find('input[name$="[id]"]')[0].name;
259
- var input_destroy = document.createElement("input");
260
-
261
- $(input_destroy).attr({
262
- name: input_id_name.replace("[id]", "[_destroy]"),
263
- type: "hidden",
264
- value: "1"
265
- });
266
-
267
- $row.append(input_destroy);
268
- $row.addClass("will-destroy");
269
- };
270
-
271
-
272
- G.prototype.set_to_not_destroy = function(row) {
273
- $(row).find('input[name$="[_destroy]"]').remove();
274
- $(row).removeClass("will-destroy");
275
- };
276
-
277
-
278
-
279
- //
280
- // The end
281
- //
282
- return G;
283
-
284
- })();
@@ -1,36 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * Append or prepend placeholders to certain inputs
5
- */
6
-
7
- exports.init = function () {
8
- $('.js-prepend-placeholder[placeholder], .js-append-placeholder[placeholder]').each(function () {
9
- var $this = $(this);
10
- replace_input_with_group($this, $this.attr('placeholder'), $this.hasClass('js-append-placeholder'));
11
- });
12
- }
13
-
14
- /**
15
- * Replace an <input> element with an appended/prepended placeholder
16
- * @param {jQuery} $input
17
- * @param {string} placeholder
18
- * @param {optional} {bool} reverse - false: prepend, true: append (default false)
19
- * @return {jQuery} The new input group
20
- */
21
- function replace_input_with_group ($input, placeholder, reverse) {
22
- var placeholder = placeholder || '',
23
- reverse = (typeof reverse === 'undefined') ? false : reverse,
24
- span_class = !!reverse ? 'input-append' : 'input-prepend',
25
- $clone = $input.clone(),
26
- $input_group = $('<div class="input-group"></div>'),
27
- $prepend = $('<span class="' + span_class + '">' + placeholder + '</span>');
28
-
29
- $prepend.prependTo($input_group);
30
- $clone.attr('placeholder', '')
31
- .appendTo($input_group);
32
- $input.replaceWith($input_group);
33
- $clone.css(!!reverse ? 'padding-right' : 'padding-left', (parseInt($clone.css('padding-right'), 10) + parseInt($prepend.outerWidth(), 10)) + 'px');
34
-
35
- return $input_group;
36
- }
@@ -1,197 +0,0 @@
1
- /*
2
-
3
- GRIDS
4
- --------
5
-
6
- */
7
-
8
- .mod-grid {
9
- border: 1px solid #ddd;
10
- padding: 18px;
11
-
12
- @include border-radius(5px);
13
-
14
- .actions {
15
- overflow: hidden;
16
- }
17
-
18
- .clear {
19
- clear: both;
20
- }
21
-
22
- .assets {
23
- padding-top: 10px - 3px;
24
- }
25
-
26
- // [row]
27
- .asset {
28
- float: left;
29
- margin: 0 11px 11px 0;
30
- position: relative;
31
-
32
- &, .thumbnail, .overlay {
33
- height: 100px;
34
- width: 100px;
35
- }
36
-
37
- &.move,
38
- &.properties,
39
- &.selected,
40
- &.will-destroy {
41
- .overlay { display: block; }
42
- }
43
-
44
- &.edit-block .attributes {
45
- display: block;
46
- }
47
- }
48
-
49
- // [row]:types
50
- .asset.move label { cursor: move; }
51
- .asset.properties { cursor: pointer; }
52
- .asset.selected .overlay { background: rgba($yellow, .5); }
53
- .asset.will-destroy .overlay,
54
- .asset.selected.will-destroy .overlay { background: rgba($red, .5); }
55
-
56
- // thumbnail + file-icon + overlay
57
- .asset .thumbnail,
58
- .asset .overlay {
59
- left: 0;
60
- position: absolute;
61
- top: 0;
62
- }
63
-
64
- .asset .thumbnail {
65
- z-index: 0;
66
- }
67
-
68
- .asset .file-icon {
69
- background: #E4E4E4;
70
- display: block;
71
- height: 100%;
72
- width: 100%;
73
- }
74
-
75
- .asset .overlay {
76
- background: rgba(black, .5);
77
- display: none;
78
- z-index: 1;
79
- }
80
-
81
- // [row].edit-block
82
- .asset.edit-block {
83
- clear: both;
84
- height: auto;
85
- min-height: 100px;
86
- width: 100%;
87
- }
88
-
89
- // label
90
- .asset .filename {
91
- @include border-radius(2px);
92
- background: #fff;
93
- bottom: 6px;
94
- color: #4f4f4f;
95
- font-size: 9px;
96
- height: 16px;
97
- line-height: 16px;
98
- left: 9px;
99
- overflow: hidden;
100
- padding: 2px 6px 1px;
101
- position: absolute;
102
- right: 9px;
103
- text-overflow: ellipsis;
104
- white-space: nowrap;
105
- z-index: 2;
106
- }
107
-
108
- // attributes
109
- .asset .attributes {
110
- display: none;
111
- margin-left: 115px;
112
- position: relative;
113
- }
114
-
115
- .asset .attributes input,
116
- .asset .attributes textarea,
117
- .asset .attributes select {
118
- margin-bottom: 6px;
119
- resize: none;
120
- width: 300px;
121
- }
122
-
123
- .asset .attributes textarea {
124
- height: 100px !important;
125
- }
126
-
127
- .asset .attributes li {
128
- margin: 0;
129
- }
130
-
131
- .asset .attributes label {
132
- display: none;
133
- }
134
-
135
- .asset .attributes .close-button {
136
- color: #c5c5c5;
137
- cursor: pointer;
138
- display: inline-block;
139
- font-size: 18px;
140
- padding: 4px 6px;
141
- position: absolute;
142
- right: 0;
143
- top: -4px;
144
-
145
- &:hover { color: $black }
146
- }
147
-
148
- //
149
- // Actions
150
- //
151
- .actions {
152
- & > div {
153
- float: left;
154
- }
155
-
156
- input[type="file"] {
157
- display: none;
158
- }
159
-
160
- .button {
161
- background: $button_green;
162
- color: white;
163
- cursor: pointer;
164
- float: left;
165
- font-size: 10px;
166
- font-weight: 600;
167
- margin-bottom: 3px;
168
- margin-right: 7px;
169
- padding: 7px 9px 6px;
170
- text-transform: uppercase;
171
-
172
- @include border-radius(3px);
173
- }
174
-
175
- .button.unavailable {
176
- background-color: #ddd !important;
177
- cursor: default;
178
- }
179
-
180
- .button[rel="edit"] { background-color: $button_yellow; }
181
- .button[rel="destroy"] { background-color: $button_red; }
182
-
183
- .files-description {
184
- color: #999;
185
- display: none;
186
- font-size: 9px;
187
- height: 23px;
188
- letter-spacing: 1px;
189
- line-height: 25px;
190
- margin-right: 12px;
191
- overflow: hidden;
192
- text-transform: uppercase;
193
- }
194
- }
195
-
196
-
197
- }
@@ -1,89 +0,0 @@
1
- body.active_admin .index.index_as_sortable {
2
- .resource_selection_toggle_panel {
3
- background-color: #1f73ff;
4
- border-top-left-radius: 5px;
5
- border-top-right-radius: 5px;
6
- padding: 13px 15px 12px 15px;
7
- }
8
-
9
- #collection_selection_toggle_explaination {
10
- display: none;
11
- }
12
-
13
- .resource_selection_cell {
14
- width: 25px;
15
- }
16
-
17
- a.member_link {
18
- opacity: 0;
19
- transition: opacity 300ms;
20
- display: inline-block;
21
- height: 16px;
22
- margin: 0 3px;
23
- text-indent: -9999px;
24
- width: 16px;
25
- }
26
-
27
- a.new_link {
28
- background-image: url(/assets/lalala/icons/add.png);
29
- background-repeat: no-repeat;
30
- }
31
-
32
- a.view_link {
33
- background-image: url(/assets/lalala/icons/eye.png);
34
- background-repeat: no-repeat;
35
- }
36
-
37
- a.edit_link {
38
- background-image: url(/assets/lalala/icons/page_white_edit.png);
39
- background-repeat: no-repeat;
40
- }
41
-
42
- a.delete_link {
43
- background-image: url(/assets/lalala/icons/delete.png);
44
- background-repeat: no-repeat;
45
- }
46
-
47
- ol {
48
- border-radius: 5px;
49
- border: 1px solid #e0e0e0;
50
- margin: 0 0 1em 0;
51
- overflow: hidden;
52
-
53
- li {
54
- &:last-child .item {
55
- border-bottom: 0;
56
- }
57
-
58
- &:hover {
59
- a.member_link {
60
- opacity: 1;
61
- }
62
- }
63
-
64
- .item {
65
- border-top: 0;
66
- box-sizing: border-box;
67
- font-size: 14px;
68
- line-height: 16px;
69
- overflow: hidden;
70
-
71
- &.odd {
72
- background-color: #fafafa;
73
- }
74
-
75
- .cell.left {
76
- font-size: 14px;
77
- line-height: 16px;
78
- float: left;
79
- padding: 13px 15px 12px 15px;
80
- }
81
-
82
- .cell.right {
83
- float: right;
84
- padding: 13px 15px 12px 15px;
85
- }
86
- }
87
- }
88
- }
89
- }
@@ -1,24 +0,0 @@
1
- class Lalala::AbstractAsset < ActiveRecord::Base
2
- include Lalala::ExtActiveRecord::I18nTranslationsWriter::Writer
3
-
4
- self.abstract_class = true
5
- self.table_name = "assets"
6
-
7
- attr_accessible :asset, :title, :caption, :translations_writer
8
-
9
- translates :title, :caption
10
- Lalala::AbstractAsset::Translation.table_name = 'asset_translations'
11
-
12
- belongs_to :asset_owner, polymorphic: true
13
-
14
- def self.extension_white_list
15
- if self.uploaders and self.uploaders[:asset]
16
- list = self.uploaders[:asset].new.try(:extension_white_list) || []
17
- else
18
- list = []
19
- end
20
-
21
- list.map { |e| ".#{e}" }.join(",")
22
- end
23
-
24
- end
@@ -1,3 +0,0 @@
1
- class Lalala::FileAsset < Lalala::AbstractAsset
2
- mount_uploader :asset, ::FileUploader
3
- end
@@ -1,3 +0,0 @@
1
- class Lalala::ImageAsset < Lalala::AbstractAsset
2
- mount_uploader :asset, ::ImageUploader
3
- end
@@ -1,34 +0,0 @@
1
- #
2
- # Carrier Wave configuration block
3
- #
4
- CarrierWave.configure do |config|
5
-
6
- if (Rails.env.production? or Rails.env.staging?) and ENV["LALALA_S3_BUCKET"]
7
-
8
- config.storage = :fog
9
- config.root = Rails.root.join('tmp')
10
- config.cache_dir = 'uploads'
11
-
12
- config.fog_credentials = {
13
- provider: 'AWS',
14
- aws_access_key_id: ENV["LALALA_S3_ACCESS_KEY"],
15
- aws_secret_access_key: ENV["LALALA_S3_SECRET_KEY"]
16
- }
17
-
18
- config.fog_directory = File.join(
19
- ENV["LALALA_S3_BUCKET"],
20
- "storage",
21
- ENV["APP_NAME"],
22
- Rails.env.to_s,
23
- "assets"
24
- )
25
-
26
- config.fog_attributes = {'Cache-Control'=>'max-age=315576000'}
27
- config.asset_host = ""
28
-
29
-
30
- else # dev
31
- config.storage = :file
32
-
33
- end
34
- end