ecm_core 0.0.4 → 0.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: 05d383cb32f673f5d898128593de5307e12d6122
4
- data.tar.gz: 7b345867e07ede11a98dba6fe230f740849b30de
3
+ metadata.gz: ec4537282c739d5c8aae6df1463575abe919c881
4
+ data.tar.gz: 37a3ad7ac9fb9c28a68af66a8213a2107adcfbaa
5
5
  SHA512:
6
- metadata.gz: 8027929a57cfa06819184884acdcb068e9a8f04f0e466623e9be3416de196f6bc870cd7c421c854599d659f01fa21748c1afc70beca586c200a00db6be10305c
7
- data.tar.gz: 9f58d935e6ab26191d58a3030d2941f37d7e35891d4a89cdc2fd901f409b2ab47ba3f566f5e35b0f627f7c0bd7708e302ce3c03d0f9aafa4d82813b09776d267
6
+ metadata.gz: 25ead955105221f88118021c7ae6ea847063924ffc190e7debe58d75d31faf04e0451363b0f08e3c1ecde6fd605030c5ba7f31940fe169979dedf70caeb3eeaf
7
+ data.tar.gz: 76998f1fa011b24b2923b499a5b249a6a1e047eeff903f04ae5264d6f60ea549bc9e7eaebe8240d115ccdc42db8bba36cd02cc69b45219eb764f35075d16d9e2
@@ -0,0 +1,19 @@
1
+ module Ecm
2
+ module Core
3
+ module Backend
4
+ module ActiveStorage
5
+ class AttachmentsController < Itsf::Backend::Resource::BaseController
6
+ def self.resource_class
7
+ ::ActiveStorage::Attachment
8
+ end
9
+
10
+ private
11
+
12
+ def permitted_params
13
+ params.require(:attachment).permit()
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ module Ecm
2
+ module Core
3
+ module Backend
4
+ module ActiveStorage
5
+ class BlobsController < Itsf::Backend::Resource::BaseController
6
+ def self.resource_class
7
+ ::ActiveStorage::Blob
8
+ end
9
+
10
+ private
11
+
12
+ def permitted_params
13
+ params.require(:blob).permit()
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,7 @@
1
+ = table.column :name
2
+ = table.column :record
3
+ = table.column :blob do |resource|
4
+ - link_to(resource.blob.filename, [:active_storage, resource.blob])
5
+ = table.column :created_at
6
+ = table.column :additional_actions do |resource|
7
+ - link_to(t('.download'), main_app.url_for(resource.blob), class: 'btn btn-primary btn-xs')
@@ -0,0 +1,15 @@
1
+ = table.column :key
2
+ = table.column :filename do |resource|
3
+ - resource.filename.to_s
4
+ = table.column :content_type
5
+ = table.column :metadata do |resource|
6
+ - capture_haml do
7
+ %ul
8
+ - resource.metadata.each do |key, value|
9
+ %li= "#{key}: #{value}"
10
+ = table.column :byte_size do |resource|
11
+ - number_to_human_size(resource.byte_size)
12
+ = table.column :checksum
13
+ = table.column :created_at
14
+ = table.column :additional_actions do |resource|
15
+ - link_to(t('.download'), main_app.url_for(resource), class: 'btn btn-primary btn-xs')
@@ -1,5 +1,9 @@
1
1
  Ecm::Core::Backend::Engine.routes.draw do
2
2
  resources :delayed_jobs
3
+ namespace :active_storage do
4
+ resources :blobs
5
+ resources :attachments
6
+ end if Ecm::Core::Backend::Configuration.enable_active_storage_backend
3
7
 
4
8
  root to: 'home#index'
5
9
  end
@@ -1,4 +1,45 @@
1
1
  de:
2
2
  classes:
3
3
  ecm/core/backend/engine: Core
4
- or: oder
4
+ or: oder
5
+ activerecord:
6
+ models:
7
+ delayed/job:
8
+ one: Hintergrundjob
9
+ other: Hintergrundjobs
10
+ active_storage/attachment:
11
+ one: Anhang
12
+ other: Anhänge
13
+ active_storage/blob:
14
+ one: Datei
15
+ other: Dateien
16
+ attributes:
17
+ delayed/job:
18
+ priority: Priorität
19
+ attempts: Versuche
20
+ handler: handler
21
+ last_error: Letzter Fehler
22
+ run_at: Gestartet am
23
+ locked_at: Gesperrt am
24
+ failed_at: Gescheitert am
25
+ locked_by: Gesperrt durch
26
+ Queue: Warteschlange
27
+ created_at: Erstellt am
28
+ updated_at: Aktualisiert am
29
+ active_storage/attachment:
30
+ additional_actions: Weitere Aktionen
31
+ name: Name
32
+ record: Angehängt an
33
+ record_id: Angehängt an
34
+ blob: Datei
35
+ blob_id: Datei
36
+ created_at: Erstellt am
37
+ active_storage/blob:
38
+ additional_actions: Weitere Aktionen
39
+ key: Schlüssel
40
+ filename: Dateiname
41
+ content_type: Dateityp
42
+ metadata: Metadaten
43
+ byte_size: Dateigröße
44
+ checksum: Checksumme
45
+ created_at: Erstellt am
@@ -22,6 +22,16 @@ module Ecm
22
22
  []
23
23
  end
24
24
  end
25
+
26
+ mattr_accessor(:enable_active_storage_backend) { false }
27
+
28
+ def self.registered_controllers
29
+ if enable_active_storage_backend
30
+ @@registered_controllers
31
+ else
32
+ -> { @@registered_controllers.call.reject { |c| c.name =~ /.*ActiveStorage.*/ } }
33
+ end
34
+ end
25
35
  end
26
36
  end
27
37
  end
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module Core
3
- VERSION = '0.0.4'
3
+ VERSION = '0.1.0'
4
4
  end
5
5
  end
@@ -2,11 +2,15 @@ Ecm::Core::Backend.configure do |config|
2
2
  # Set the resources, that will be shown in the backend menu.
3
3
  #
4
4
  # Default: config.registered_controllers = -> {[
5
- # Ecm::Core::Backend::DelayedJobsController
5
+ # Ecm::Core::Backend::DelayedJobsController,
6
+ # Ecm::Core::Backend::ActiveStorage::BlobsController,
7
+ # Ecm::Core::Backend::ActiveStorage::AttachmentsController
6
8
  # ]}
7
9
  #
8
10
  config.registered_controllers = -> {[
9
- Ecm::Core::Backend::DelayedJobsController
11
+ Ecm::Core::Backend::DelayedJobsController,
12
+ Ecm::Core::Backend::ActiveStorage::BlobsController,
13
+ Ecm::Core::Backend::ActiveStorage::AttachmentsController
10
14
  ]}
11
15
 
12
16
  # Set the services, that will be shown in the backend menu.
@@ -16,4 +20,10 @@ Ecm::Core::Backend.configure do |config|
16
20
  #
17
21
  config.registered_services = -> {[
18
22
  ]}
23
+
24
+ # Enable support for ActiveStorage.
25
+ #
26
+ # default: config.enable_active_storage_backend = false
27
+ #
28
+ config.enable_active_storage_backend = false
19
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.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-11-05 00:00:00.000000000 Z
11
+ date: 2018-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -288,6 +288,8 @@ files:
288
288
  - app/assets/stylesheets/ecm_core_backend.css
289
289
  - app/concerns/controller/store_remote_ip_concern.rb
290
290
  - app/controllers/ecm/core/application_controller.rb
291
+ - app/controllers/ecm/core/backend/active_storage/attachments_controller.rb
292
+ - app/controllers/ecm/core/backend/active_storage/blobs_controller.rb
291
293
  - app/controllers/ecm/core/backend/delayed_jobs_controller.rb
292
294
  - app/controllers/ecm/core/backend/home_controller.rb
293
295
  - app/controllers/ecm/core/home_controller.rb
@@ -295,6 +297,8 @@ files:
295
297
  - app/jobs/ecm/core/application_job.rb
296
298
  - app/mailers/ecm/core/application_mailer.rb
297
299
  - app/models/ecm/core/application_record.rb
300
+ - app/views/ecm/core/backend/active_storage/attachments/_table.haml
301
+ - app/views/ecm/core/backend/active_storage/blobs/_table.haml
298
302
  - app/views/layouts/ecm/core/application.html.erb
299
303
  - config/backend/routes.rb
300
304
  - config/initializers/assets.rb