ecm_downloads2_backend 2.0.2 → 2.1.0

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: 9a72b3402250d60d3ced937f20ac8e1e17618d7e
4
- data.tar.gz: 65af1bc8edf2ee6e26607df31c7eddf2a16b4c90
3
+ metadata.gz: cf02c9d4882c0f8457e0aab7b7b70c869f61d918
4
+ data.tar.gz: a865dd5267f7cc310cb438ba4a74db9c4a38a564
5
5
  SHA512:
6
- metadata.gz: dd8584b6a45f694d58a6994ab21dd424184e3dc4f790a419aa7f54adb14186d9540a1edf057e575413c7a6fe00032e723600161572366316b5c85fb442163257
7
- data.tar.gz: a5f5b1607d8d69c17be11edfcf98c59b1e30983c362eea44203e80d3c4ba99a771f3411773bd385cfbd6aa3fe919191ba3fae25fe334f65d453d4648e102d108
6
+ metadata.gz: c72a132c8ba6d5a597f580478d50fac7ee8e3b0d54aa048eb5bca11e534cbac56605031cdd5f7543a065ae827f346f88fb0935926441b061dc93a20011755f35
7
+ data.tar.gz: 25f0d5e203643ad301cc252080be6104d24b46098348ec142ac891e4c83f2aadb2081d068e5c732ea2b9ca29fdde6aaaa8be5b3c57921f847e01c316a2b649ae
@@ -1,17 +1,22 @@
1
- class Ecm::Downloads::Backend::DownloadCategoriesController < Itsf::Backend::Resource::BaseController
2
- def self.resource_class
3
- Ecm::Downloads::DownloadCategory
4
- end
1
+ module Ecm
2
+ module Downloads
3
+ module Backend
4
+ class DownloadCategoriesController < Itsf::Backend::Resource::BaseController
5
+ include ResourcesController::Sorting
6
+ include ResourcesController::FriendlyIdConcern
5
7
 
6
- private
8
+ def self.resource_class
9
+ Ecm::Downloads::DownloadCategory
10
+ end
7
11
 
8
- def permitted_params
9
- params
10
- .require(:download_category)
11
- .permit(:name, :description, :locale)
12
- end
12
+ private
13
13
 
14
- def load_resource
15
- load_scope.friendly.find(params[:id])
14
+ def permitted_params
15
+ params
16
+ .require(:download_category)
17
+ .permit(:name, :description, :locale)
18
+ end
19
+ end
20
+ end
16
21
  end
17
22
  end
@@ -1,22 +1,27 @@
1
- class Ecm::Downloads::Backend::DownloadsController < Itsf::Backend::Resource::BaseController
2
- def self.resource_class
3
- Ecm::Downloads::Download
4
- end
1
+ module Ecm
2
+ module Downloads
3
+ module Backend
4
+ class DownloadsController < Itsf::Backend::Resource::BaseController
5
+ include ResourcesController::Sorting
6
+ include ResourcesController::FriendlyIdConcern
5
7
 
6
- def download
7
- @download = Ecm::Downloads::Download.friendly.find(params[:id]).decorate
8
- redirect_to @download.asset.expiring_url(100)
9
- end
8
+ def self.resource_class
9
+ Ecm::Downloads::Download
10
+ end
10
11
 
11
- private
12
+ def download
13
+ @download = load_resource_scope.find(params[:id]).decorate
14
+ redirect_to @download.asset.expiring_url(100)
15
+ end
12
16
 
13
- def permitted_params
14
- params
15
- .require(:download)
16
- .permit(:download_category_id, :asset, :name, :description, :published)
17
- end
17
+ private
18
18
 
19
- def load_resource
20
- load_scope.friendly.find(params[:id])
19
+ def permitted_params
20
+ params
21
+ .require(:download)
22
+ .permit(:download_category_id, :asset, :name, :description, :published)
23
+ end
24
+ end
25
+ end
21
26
  end
22
27
  end
@@ -1,6 +1,6 @@
1
- = table.column :locale, sortable: true
2
- = table.column :name, sortable: true, class: 'truncate-chars truncate-chars-30'
3
- = table.column :description, sortable: true, class: 'truncate-chars truncate-chars-30'
4
- = table.column :downloads_count, sortable: true
5
- = table.association :parent, sortable: true
6
- = table.timestamps
1
+ = table.column :locale, sort: true
2
+ = table.column :name, sort: true, class: 'truncate-chars truncate-chars-30'
3
+ = table.column :description, sort: true, class: 'truncate-chars truncate-chars-30'
4
+ = table.column :downloads_count
5
+ = table.association :parent, sort: true
6
+ = table.timestamps sort: true
@@ -1,7 +1,7 @@
1
- = table.association :download_category, sortable: true, url: ->(category) { download_category_path(category) }
2
- = table.column :name, sortable: true, class: 'truncate-chars truncate-chars-30'
3
- = table.column(:asset_file_size, sortable: true) { |download| number_to_human_size(download.asset_file_size) }
4
- = table.column :asset_content_type, sortable: true
5
- = table.timestamps
1
+ = table.association :download_category, sort: true, url: ->(category) { download_category_path(category) }
2
+ = table.column :name, sort: true, class: 'truncate-chars truncate-chars-30'
3
+ = table.column(:asset_file_size, sort: true) { |download| number_to_human_size(download.asset_file_size) }
4
+ = table.column :asset_content_type, sort: true
5
+ = table.timestamps sort: true
6
6
  = table.column(:additional_actions, class: 'table-data-centered') { |download| link_to(t('.download'), download_download_path(download), class: 'btn btn-xs btn-primary') }
7
7
  = table.acts_as_published_actions
@@ -1,7 +1,7 @@
1
1
  module Ecm
2
2
  module Downloads
3
3
  module Backend
4
- VERSION = '2.0.2'.freeze
4
+ VERSION = '2.1.0'.freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_downloads2_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-16 00:00:00.000000000 Z
11
+ date: 2018-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails