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 +4 -4
- data/README.md +8 -2
- data/app/assets/stylesheets/_preview-media.sass +9 -0
- data/app/views/ds_media_library/manage/resources/_image_preview.html.slim +5 -2
- data/db/migrate/001_create_folders.rb +14 -0
- data/db/migrate/002_add_folder_id_to_resources.rb +6 -0
- data/db/migrate/003_add_hidden_to_resources.rb +5 -0
- data/lib/ds_media_library/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6eb5518995e64293e2846b0aa1bb88d467cbf174
|
4
|
+
data.tar.gz: 807d296496b8a1ede571aa7ad396904d532bf502
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
-
|
65
|
+
6. Profit!
|
60
66
|
|
61
67
|
## Development
|
62
68
|
|
@@ -6,12 +6,15 @@
|
|
6
6
|
- if preview
|
7
7
|
- if image.video?
|
8
8
|
= video_tag image.url, controls: true
|
9
|
-
-
|
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
|
-
|
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
|
+
|
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.
|
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-
|
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
|