lalala 4.0.0.dev.59 → 4.0.0.dev.60

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e155b5eaa44f5404e533fa1b34ed2c022c8cbfb3
4
- data.tar.gz: 80ca6f3dcd83419994e83b77a4f64756c86bf54a
3
+ metadata.gz: d45165d6eb01c7a399a1a3c65b3cba801970c56e
4
+ data.tar.gz: 0a7dd6a6a8a37c1ac557ac2d2e1341264c446471
5
5
  SHA512:
6
- metadata.gz: 88785acc4ae3cba0cfaadb7d3d4f07367fdeb56eee02bac3e01127d8b4d56e433284a9c83a3c3e7929e20f2acd2f9e9e4a60a8ba51b420ef436cc5b37931737a
7
- data.tar.gz: 925eb61bfffb558d6e4f9ca9ab188313a4d2d182b3532da2babb4f21125a5fc0d3286a1fd8a3785913503f306b66b5d8a740aacc12e1cb2cd58d3aafa9d3fcba
6
+ metadata.gz: d968fe1178068b322d6d4c1baa9edea4220354c9efa2fd4472aaea174d4548533c162c1a43fde8a89e62e388c1b99f1b1351cabaf899bf1245a7ab2b7a0e9dba
7
+ data.tar.gz: 4dbb37c1e019ff85d1103e29faacc9a970a7d87e316b1d06a61e485d969c797cc2dec42e3a02bd4546018814d11fb49c4c36f8bf511505b3c22891c3b3832ff2
@@ -0,0 +1,63 @@
1
+ def storage_config
2
+ path = File.join(Rails.root.to_s, 'config/filesystem.yml')
3
+ unless File.file?(path)
4
+ return nil
5
+ end
6
+
7
+ config = YAML::load(ERB.new(File.read(path)).result)
8
+ unless Hash === config
9
+ return nil
10
+ end
11
+
12
+ config = config[Rails.env.to_s]
13
+ unless Hash === config
14
+ return nil
15
+ end
16
+
17
+ config
18
+ end
19
+
20
+
21
+
22
+ #
23
+ # Configuration types
24
+ #
25
+ def configure_s3(config, s3)
26
+ config.storage = :fog
27
+ config.root = Rails.root.join('tmp')
28
+ config.cache_dir = 'uploads'
29
+
30
+ credentials = {
31
+ provider: 'AWS',
32
+ aws_access_key_id: s3['access_key_id'],
33
+ aws_secret_access_key: s3['secret_access_key'],
34
+ region: 'eu-west-1'
35
+ }
36
+
37
+ if s3['vhost']
38
+ credentials.merge!(host: s3['vhost'])
39
+ end
40
+
41
+ config.fog_credentials = credentials
42
+ config.fog_directory = s3['vhost'] || s3['bucket']
43
+ end
44
+
45
+
46
+ def configure_filesystem(config)
47
+ config.storage = :file
48
+ end
49
+
50
+
51
+
52
+ #
53
+ # Carrier Wave configuration block
54
+ #
55
+ CarrierWave.configure do |config|
56
+ s3 = storage_config
57
+
58
+ if s3
59
+ configure_s3(config, s3)
60
+ else
61
+ configure_filesystem(config)
62
+ end
63
+ end
data/lalala.gemspec CHANGED
@@ -32,6 +32,7 @@ Gem::Specification.new do |gem|
32
32
 
33
33
  # generic
34
34
  gem.add_runtime_dependency 'carrierwave', '= 0.8.0'
35
+ gem.add_runtime_dependency 'fog', '= 1.10.0'
35
36
  gem.add_runtime_dependency 'globalize3', '= 0.3.0'
36
37
  gem.add_runtime_dependency 'jquery-rails', '= 2.2.1'
37
38
  gem.add_runtime_dependency 'meta_search', '= 1.1.3'
@@ -4,10 +4,8 @@ class Lalala::Uploaders::Image < CarrierWave::Uploader::Base
4
4
  include Sprockets::Helpers::RailsHelper
5
5
  include Sprockets::Helpers::IsolatedHelper
6
6
 
7
- storage :file
8
-
9
7
  def store_dir
10
- "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
8
+ "uploads/#{model.class.to_s.underscore}/#{model.id}"
11
9
  end
12
10
 
13
11
  def extension_white_list
@@ -1,6 +1,6 @@
1
1
  module Lalala
2
2
  VERSION = "4.0.0"
3
- BUILD = "59"
3
+ BUILD = "60"
4
4
 
5
5
  if BUILD != ("{{BUILD_NUMBER" + "}}") # prevent sed replacement (see script/ci)
6
6
  BUILD_VERSION = "#{VERSION}.dev.#{BUILD}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lalala
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.dev.59
4
+ version: 4.0.0.dev.60
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Menke
@@ -29,6 +29,20 @@ dependencies:
29
29
  - - '='
30
30
  - !ruby/object:Gem::Version
31
31
  version: 0.8.0
32
+ - !ruby/object:Gem::Dependency
33
+ name: fog
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - '='
37
+ - !ruby/object:Gem::Version
38
+ version: 1.10.0
39
+ type: :runtime
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - '='
44
+ - !ruby/object:Gem::Version
45
+ version: 1.10.0
32
46
  - !ruby/object:Gem::Dependency
33
47
  name: globalize3
34
48
  requirement: !ruby/object:Gem::Requirement
@@ -1396,7 +1410,6 @@ files:
1396
1410
  - app/assets/stylesheets/lalala/modules/_flashes.css.scss
1397
1411
  - app/assets/stylesheets/lalala/modules/_footer.css.scss
1398
1412
  - app/assets/stylesheets/lalala/modules/_grid.css.scss
1399
- - app/assets/stylesheets/lalala/modules/_grids.css.scss
1400
1413
  - app/assets/stylesheets/lalala/modules/_header.css.scss
1401
1414
  - app/assets/stylesheets/lalala/modules/_index-as-table.css.scss
1402
1415
  - app/assets/stylesheets/lalala/modules/_index-as-tree-table.css.scss
@@ -1418,6 +1431,7 @@ files:
1418
1431
  - app/views/lalala/public/pages/show.html.erb
1419
1432
  - app/views/layouts/lalala/markdown.html.erb
1420
1433
  - config/initializers/active_admin.rb
1434
+ - config/initializers/carrierwave.rb
1421
1435
  - config/routes.rb
1422
1436
  - lalala-assets.gemspec
1423
1437
  - lalala-development.gemspec
@@ -1,75 +0,0 @@
1
- /*
2
-
3
- GRIDS
4
- --------
5
-
6
- */
7
-
8
- .mod-grid {
9
- .images,
10
- .input-fields {
11
- overflow: hidden;
12
- }
13
-
14
- // [row]
15
- li {
16
- float: left;
17
- margin: 0 11px 11px 0;
18
- position: relative;
19
-
20
- &, .image, .overlay {
21
- height: 100px;
22
- width: 100px;
23
- }
24
-
25
- &.move,
26
- &.properties,
27
- &.selected,
28
- &.will-destroy { .overlay { display: block; }}
29
- }
30
-
31
- // [row]:types
32
- li.move label { cursor: move; }
33
- li.properties { cursor: pointer; }
34
- li.selected .overlay { background: rgba($yellow, .5); }
35
- li.will-destroy .overlay,
36
- li.selected.will-destroy .overlay { background: rgba($red, .5); }
37
-
38
- // image + overlay
39
- li .image,
40
- li .overlay {
41
- left: 0;
42
- position: absolute;
43
- top: 0;
44
- }
45
-
46
- li .image {
47
- z-index: 0;
48
- }
49
-
50
- li .overlay {
51
- background: rgba(black, .5);
52
- display: none;
53
- z-index: 1;
54
- }
55
-
56
- // label
57
- li label {
58
- @include border-radius(2px);
59
- background: #fff;
60
- bottom: 6px;
61
- color: #4f4f4f;
62
- font-size: 9px;
63
- height: 16px;
64
- line-height: 16px;
65
- left: 9px;
66
- overflow: hidden;
67
- padding: 2px 6px 1px;
68
- position: absolute;
69
- right: 9px;
70
- text-overflow: ellipsis;
71
- white-space: nowrap;
72
- z-index: 2;
73
- }
74
-
75
- }