ds_media_library 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 756365ace30672e2a046780b8c7123926acb967e
4
- data.tar.gz: 22a096743f629de3ffebf60764ea13966aa7d3b0
3
+ metadata.gz: 6eb5518995e64293e2846b0aa1bb88d467cbf174
4
+ data.tar.gz: 807d296496b8a1ede571aa7ad396904d532bf502
5
5
  SHA512:
6
- metadata.gz: 8575fc7cf04eefa3dc557f0f805ed457da8d13e855795c5ba23982fc9fb395af0dd0832bb68af9c981fc9e42a188586aae1f4dbdd20972bcf16f813ef6b6a9db
7
- data.tar.gz: 61b79818139cab8eb4d80b54fb541c439c54ff44822f780cdb0141c944e09e5793a1bf0b040999359f6e01b54a415ad008c20f0998eb0e6ce8784b3a140a78c1
6
+ metadata.gz: 186dfe5540330e2009add500d0d85bbff6b3b9dc88f8243be5dd5cfe97a2cfd13876c339e5a8c16a0eb47c1e96302274900f43ca20d99c3baf55e3f7a5137bdb
7
+ data.tar.gz: 5641c7b18489a2377ea9b610f4050ced911857f59cecadfb620c468391aa8e83a0e117b399e69cf86b552f7953c48e949fe38514c158bd4a95608ea7fcbf5562
data/README.md CHANGED
@@ -45,7 +45,13 @@ class Widget < ActiveRecord::Base
45
45
  end
46
46
  ```
47
47
 
48
- 4. Use the `#media_library` form helper where you would normally use the `#file_field` form helper:
48
+ 4. Install and run the migrations
49
+ ```
50
+ rails ds_media_library:migrations:install
51
+ rails db:migrate
52
+ ```
53
+
54
+ 5. Use the `#media_library` form helper where you would normally use the `#file_field` form helper:
49
55
  ```slim
50
56
  / app/views/widgets/form.html.slim
51
57
  = form_for @widget do |form|
@@ -56,7 +62,7 @@ end
56
62
  = form.media_library :dog_pictures, multiple: true
57
63
  ```
58
64
 
59
- 5. Profit!
65
+ 6. Profit!
60
66
 
61
67
  ## Development
62
68
 
@@ -86,3 +86,12 @@
86
86
  &:hover
87
87
  &:before
88
88
  color: #444
89
+
90
+ .dsml-pdf-icon
91
+ font-style: normal
92
+ &:before
93
+ font-family: fontawesome
94
+ content: "\f1c1"
95
+ display: inline-block
96
+ margin-right: 3px
97
+
@@ -6,12 +6,15 @@
6
6
  - if preview
7
7
  - if image.video?
8
8
  = video_tag image.url, controls: true
9
- - else
9
+ - if image.image?
10
10
  = image_tag image.url
11
11
 
12
12
  = yield
13
13
 
14
14
  - unless defined?(hide_file_name) && hide_file_name
15
15
  dt
16
- figcaption = image.original_file_name
16
+ - if image.pdf?
17
+ figcaption = link_to image.original_file_name, image.url, class: "dsml-pdf-icon", target: "_blank"
18
+ - else
19
+ figcaption = image.original_file_name
17
20
 
@@ -0,0 +1,14 @@
1
+ class CreateFolders < ActiveRecord::Migration[4.2]
2
+ def change
3
+ create_table :folders do |t|
4
+ t.string :name
5
+ t.integer :parent_id, index: true
6
+ t.integer :lft, null: false, index: true
7
+ t.integer :rgt, null: false, index: true
8
+ t.datetime :created_at, null: false
9
+ t.datetime :updated_at, null: false
10
+ t.integer :depth, default: 0, null: false
11
+ end
12
+ end
13
+ end
14
+
@@ -0,0 +1,6 @@
1
+ class AddFolderIdToResources < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_column :resources, :folder_id, :integer, null: true, index: true
4
+ end
5
+ end
6
+
@@ -0,0 +1,5 @@
1
+ class AddHiddenToResources < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_column :resources, :hidden, :boolean, default: false
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module DSMediaLibrary
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ds_media_library
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-10 00:00:00.000000000 Z
11
+ date: 2018-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -351,6 +351,9 @@ files:
351
351
  - bin/server
352
352
  - bin/setup
353
353
  - config/routes.rb
354
+ - db/migrate/001_create_folders.rb
355
+ - db/migrate/002_add_folder_id_to_resources.rb
356
+ - db/migrate/003_add_hidden_to_resources.rb
354
357
  - ds_media_library.gemspec
355
358
  - dummy/app.rb
356
359
  - dummy/config.rb