ds_media_library 0.4.0 → 0.5.0

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: 08e8e9c3cc846e24f62ccbcbe842e73097651869
4
- data.tar.gz: cf45e915c6f8919887bb2b9e48f7afb717e8a0cf
3
+ metadata.gz: 756365ace30672e2a046780b8c7123926acb967e
4
+ data.tar.gz: 22a096743f629de3ffebf60764ea13966aa7d3b0
5
5
  SHA512:
6
- metadata.gz: 25ed42f1e044501f68aaad34d25f23011124639cacb3179d14be350f0dce6e18abbb0d622da0adc888491b8fe907d41ae808578c6f7b2fcb3bbb787aed6bc9fc
7
- data.tar.gz: 2df9907a4b0fa46de097ddb69d4fa7a3a17016ea4178b811c59e7d75727282bc4a201c026c0bb8e41e28f3d05107d26046b18bda5024ec1b1c4710bf9716bcff
6
+ metadata.gz: 8575fc7cf04eefa3dc557f0f805ed457da8d13e855795c5ba23982fc9fb395af0dd0832bb68af9c981fc9e42a188586aae1f4dbdd20972bcf16f813ef6b6a9db
7
+ data.tar.gz: 61b79818139cab8eb4d80b54fb541c439c54ff44822f780cdb0141c944e09e5793a1bf0b040999359f6e01b54a415ad008c20f0998eb0e6ce8784b3a140a78c1
@@ -83,9 +83,6 @@ $ ->
83
83
  $tree.find(resourceSelector).each ->
84
84
  searchText = $(this).attr("data-dsml-search-text").toLowerCase()
85
85
  isFound = searchText.indexOf(term) != -1
86
- console.log searchText
87
- console.log term
88
- console.log isFound
89
86
  $(this).toggle isFound
90
87
 
91
88
  $tree.find(folderSelector).each ->
@@ -1,5 +1,29 @@
1
1
  $itemHeight: 40px
2
2
 
3
+ .dsml-media-nav-header
4
+ display: flex
5
+ justify-content: flex-end
6
+ .dsml-media-file-col
7
+ padding: 0
8
+
9
+ .dsml-media-type-col, .dsml-media-date-col
10
+ font-size: 0.9em
11
+ color: #b0b0b0
12
+ margin: 0 0px 0 10px
13
+ .dsml-media-type-col
14
+ flex: 0 0 120px
15
+ .dsml-media-date-col
16
+ flex: 0 0 120px
17
+ margin: 0 90px 0 10px
18
+
19
+ .dsml-resource
20
+ .dsml-expand-label
21
+ max-width: calc(100% - 350px)
22
+ overflow: hidden
23
+ white-space: nowrap
24
+ .dsml-media-date-col
25
+ margin-right: 0
26
+
3
27
  .dsml-media-nav
4
28
  @extend %dsml-reset-list
5
29
  width: 100%
@@ -17,7 +41,7 @@ $itemHeight: 40px
17
41
  width: 100%
18
42
  border: 1px solid #e0e0e0
19
43
  line-height: $itemHeight
20
- flex-wrap: wrap
44
+ //flex-wrap: wrap
21
45
  padding: 0 10px
22
46
  .dsml-expand-label, .dsml-media-links
23
47
  display: inline-block
@@ -1,6 +1,8 @@
1
- li.dsml-resource class=("hidden" if resource.hidden?) data-dsml-search-text=resource.original_file_name
1
+ li.dsml-resource class=("hidden" if resource.hidden?) data-dsml-search-text=[resource.original_file_name, resource.type_name, resource.updated_on].join(" ")
2
2
  .dsml-media-container
3
3
  label.dsml-expand-label
4
4
  input.dsml-modal-input.media-choice name="ds_media_library" type=helper.field_type value=resource.id checked=helper.ids.include?(resource.id) data=resource.attributes
5
5
  span.dsml-media-link alt=resource.original_file_name = resource.original_file_name
6
+ .dsml-media-type-col = resource.type_name
7
+ .dsml-media-date-col = resource.updated_on
6
8
 
@@ -5,6 +5,9 @@
5
5
  label.hidden for="dsml-search-media" Search media library
6
6
  input.dsml-text#dsml-search-media type="text" placeholder="Type keywords to search media" data-dsml-search-media=".dsml-resource"
7
7
  ul.dsml-media-nav#dsml-media-tree
8
+ li.dsml-media-nav-header
9
+ .dsml-media-type-col Type
10
+ .dsml-media-date-col Date modified
8
11
  = render collection: helper.root_folders, partial: "ds_media_library/form_helper/folder", as: :folder, locals: { helper: helper }
9
12
  = render collection: helper.root_resources, partial: "ds_media_library/form_helper/resource", as: :resource, locals: { helper: helper }
10
13
 
@@ -25,6 +25,9 @@
25
25
  label.hidden for="dsml-search-media" Search media library
26
26
  input.dsml-text#dsml-search-media type="text" placeholder="Type keywords to search media" data-dsml-search-media=".dsml-resource"
27
27
  ul.dsml-media-nav#dsml-media-tree
28
+ li.dsml-media-nav-header
29
+ .dsml-media-type-col Type
30
+ .dsml-media-date-col Date modified
28
31
  = render collection: root.children, partial: "ds_media_library/manage/folders/folder"
29
32
  = render collection: root.resources, partial: "ds_media_library/manage/resources/resource"
30
33
 
@@ -1,10 +1,11 @@
1
- li.dsml-resource class=("hidden" if resource.hidden?) data-dsml-search-text=resource.original_file_name
1
+ li.dsml-resource class=("hidden" if resource.hidden?) data-dsml-search-text=[resource.original_file_name, resource.type_name, resource.updated_on].join(" ")
2
2
  .dsml-media-container
3
3
  input.dsml-move-input type="checkbox" name="resource_ids[]" id="media-#{resource.id}" value=resource.id
4
4
  label.dsml-expand-label for="media-#{resource.id}"
5
5
  = link_to resource.original_file_name, edit_resource_path(resource), class: resource.css_class, alt: resource.original_file_name
6
6
  span.dsml-move-span.dsml-media-link alt=resource.original_file_name = resource.original_file_name
7
-
7
+ .dsml-media-type-col = resource.type_name
8
+ .dsml-media-date-col = resource.updated_on
8
9
  .dsml-media-links
9
10
  = link_to "Edit media", edit_resource_path(resource), class: "dsml-edit-icon", title: "Edit media"
10
11
  = link_to "Delete media", resource_path(resource), method: :delete, class: "dsml-delete-icon", title: "Delete media",
@@ -31,6 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency "phantomjs"
32
32
  spec.add_development_dependency "capybara-screenshot"
33
33
  spec.add_development_dependency "database_cleaner"
34
+ spec.add_development_dependency "timecop"
34
35
  spec.add_development_dependency "byebug"
35
36
 
36
37
  spec.add_dependency "rails"
@@ -51,7 +51,12 @@ Then "I should see the following media tree:" do |table|
51
51
  def recurse_tree root, structure = [], prefix = ""
52
52
  root.all(:xpath, "./li").each do |li|
53
53
  if label = li.first("label")
54
- structure << [prefix + label.text]
54
+ type_name, created_at = if label[:class].include?("folder")
55
+ 2.times.map { "" }
56
+ else
57
+ li.all("div")[1..2].map(&:text)
58
+ end
59
+ structure << [prefix + label.text, type_name, created_at]
55
60
  end
56
61
  if root = li.first("ul")
57
62
  new_prefix = prefix.empty? ? "- #{prefix}" : prefix + " "
@@ -21,6 +21,20 @@ module DSMediaLibrary
21
21
  def css_class
22
22
  "dsml-media-link"
23
23
  end
24
+
25
+ def type_name
26
+ case media_type
27
+ when "i" then "Image"
28
+ when "v" then "Video"
29
+ when "a" then "Audio"
30
+ when "p" then "PDF"
31
+ else "Unknown"
32
+ end
33
+ end
34
+
35
+ def updated_on
36
+ updated_at.try(:to_date)
37
+ end
24
38
  end
25
39
  end
26
40
 
@@ -1,3 +1,3 @@
1
1
  module DSMediaLibrary
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
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.4.0
4
+ version: 0.5.0
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-05 00:00:00.000000000 Z
11
+ date: 2018-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: timecop
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: byebug
155
169
  requirement: !ruby/object:Gem::Requirement