cmor_files 0.0.53.pre → 0.0.58.pre

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
  SHA256:
3
- metadata.gz: c03359f09f93bbbb4242d6ff7bbc6b29469826814803138cd3a18668e53f0283
4
- data.tar.gz: 075d3ff2a8cad0e405722ca40cd1ced55df0c87911f8ded0c5ae832302918826
3
+ metadata.gz: 8904ee3f437b85d8f3570c038bc98a8ed8e593ad06da00ed9667524148c29128
4
+ data.tar.gz: 9584cfafb37feff7829860f6cab15ecb8ddbca79f329f23c50bf0908734fd810
5
5
  SHA512:
6
- metadata.gz: 26edec2be7d27ab232aad4ff3a2e29d85a53485fc8c2da8a0268e0745b60a17d72186ad8702ddb34b54d31f972c2f60f6ce77d691f4446f77cf00157721192a8
7
- data.tar.gz: ffc316aab2a66558504a864b456ce57a2685063a29571078f5b380f220fa5b3f98bcfb2f7defe7f24680ee49d7cf32bae2b0b55f6cd1cff0c603d1e367c1430e
6
+ metadata.gz: ee0a78e36951915a9bfbd2df07117d8a34de8168f155132b3f1e43d95f93a0ec13b58149cc218aa7ded8412c6cf5a00adcfebca85ddded219dc9a7f7c2c60396
7
+ data.tar.gz: 0e6cebd1e07f928fd2be94a6967cf47bae29285d3521210062112bcb9d0b723c65877be3fe43e148c4bcff9f51daa4be50a425b99ea602def33c10092ee602fb
@@ -11,11 +11,33 @@ module Cmor
11
11
  # Example:
12
12
  #
13
13
  # # app/views/layouts/application.html.haml
14
- # = files_helper(self).render_download(name: 'Quick reference manual')
14
+ # = files_helper(self).render_file(identifier: 'Quick reference manual')
15
15
  #
16
16
  def render_file(identifier:)
17
- resource = Cmor::Files::FileDetail.where(identifier: identifier).first
18
- render resource: resource
17
+ resource = Cmor::Files::FileDetail.published.where(identifier: identifier).first
18
+ if resource.nil?
19
+ "Could not find published file detail with identifier: '#{identifier}'."
20
+ else
21
+ render resource: resource
22
+ end
23
+ end
24
+
25
+ # Example:
26
+ #
27
+ # # app/views/layouts/application.html.haml
28
+ # = files_helper(self).render_folder(identifier: 'Manuals')
29
+ #
30
+ def render_folder(identifier:)
31
+ resource = Cmor::Files::Folder.published.where(identifier: identifier).first
32
+ if resource.nil?
33
+ "Could not find published folder with identifier: '#{identifier}'."
34
+ else
35
+ render resource: resource
36
+ end
37
+ end
38
+
39
+ def asset_download_button_label(asset)
40
+ "#{c.t(".download")} (#{asset.blob.content_type.split('/').last}, #{c.number_to_human_size(asset.blob.byte_size)})"
19
41
  end
20
42
  end
21
43
  end
@@ -0,0 +1,15 @@
1
+ .row
2
+ .col-12
3
+ %h4= resource.name
4
+
5
+ .row
6
+ .col-12
7
+ .table-responsive
8
+ = collection_table(collection: resource.file_details, resource_class: Cmor::Files::FileDetail, header: false) do |table|
9
+ = table.column :filename do |resource|
10
+ - resource.asset.blob.filename.to_s.truncate(64)
11
+ = table.column :actions, html: "text-right" do |resource|
12
+ - capture_haml do
13
+ .text-right
14
+ = link_to(main_app.url_for(resource.asset), class: 'btn btn-primary') do
15
+ = files_helper(self).asset_download_button_label(resource.asset)
@@ -5,5 +5,5 @@
5
5
  = collection_table(collection: @collection, resource_class: resource_class) do |t|
6
6
  = t.column :name
7
7
  = t.column :assets_count
8
- = t.column :actions do |resource|
8
+ = t.column :actions, title: false do |resource|
9
9
  - link_to(t('.show'), [resource], class: 'btn btn-primary')
@@ -1,15 +1,20 @@
1
- %h1= @resource.name
1
+ .row
2
+ .col-12
3
+ %h1= @resource.name
2
4
 
3
5
  .row
4
6
  .col-12
5
- = collection_table(collection: @resource.file_details, resource_class: Cmor::Files::FileDetail, header: false) do |table|
6
- = table.column :filename do |resource|
7
- - resource.asset.blob.filename
8
- = table.column :blob_byte_size do |resource|
9
- - number_to_human_size(resource.asset.blob.byte_size)
10
- = table.column :actions do |resource|
11
- - capture_haml do
12
- = link_to(t('.download'), main_app.url_for(resource.asset), class: 'btn btn-primary')
7
+ .table-responsive
8
+ = collection_table(collection: @resource.file_details, resource_class: Cmor::Files::FileDetail, header: false) do |table|
9
+ = table.column :filename do |resource|
10
+ - resource.asset.blob.filename.to_s.truncate(64)
11
+ = table.column :blob_byte_size do |resource|
12
+ - number_to_human_size(resource.asset.blob.byte_size)
13
+ = table.column :actions do |resource|
14
+ - capture_haml do
15
+ .text-right
16
+ = link_to(main_app.url_for(resource.asset), class: 'btn btn-primary') do
17
+ = files_helper(self).asset_download_button_label(resource.asset)
13
18
 
14
19
 
15
20
  .row.mt-4
@@ -18,10 +18,15 @@ de:
18
18
  id: ID
19
19
  asset: Datei
20
20
  asset_id: Datei
21
+ asset_permanent_path: Permanenter Datei-Pfad
22
+ asset_permanent_url: Permanente Datei-URL
21
23
  blob_byte_size: Dateigröße
22
24
  blob_checksum: Checksumme
25
+ blob_content_type: Dateityp
26
+ blob_created_at: Datei erstellt am
23
27
  blob_filename: Dateiname
24
28
  description: Beschreibung
29
+ filename: Dateiname
25
30
  folder: Ordner
26
31
  folder_id: Ordner
27
32
  identifier: Bezeichner
@@ -34,12 +39,14 @@ de:
34
39
  updated_at: Aktualisiert am
35
40
  cmor/files/folder:
36
41
  id: ID
42
+ append_assets: Dateien hinzufügen
37
43
  assets: Dateien
38
44
  assets_count: Dateien
39
45
  description: Beschreibung
40
46
  identifier: Bezeichner
41
47
  locale: Sprache
42
48
  name: Name
49
+ overwrite_assets: Dateien ersetzen
43
50
  position: Position
44
51
  published: Veröffentlicht
45
52
  published_at: Veröffentlicht am
@@ -18,10 +18,15 @@ en:
18
18
  id: ID
19
19
  asset: Asset
20
20
  asset_id: Asset
21
+ asset_permanent_path: Permanent asset path
22
+ asset_permanent_url: Permanent asset ur
21
23
  blob_byte_size: Filesize
22
24
  blob_checksum: Checksum
25
+ blob_content_type: Content-Type
26
+ blob_created_at: File created at
23
27
  blob_filename: Filename
24
28
  description: Description
29
+ filename: Filename
25
30
  folder: Folder
26
31
  folder_id: Folder
27
32
  identifier: Identifier
@@ -34,12 +39,14 @@ en:
34
39
  updated_at: Updated at
35
40
  cmor/files/folder:
36
41
  id: ID
42
+ append_assets: Append files
37
43
  assets: Files
38
44
  assets_count: Files
39
45
  description: Description
40
46
  identifier: Identifier
41
47
  locale: Locale
42
48
  name: Name
49
+ overwrite_assets: Overwrite files
43
50
  position: Position
44
51
  published: Published
45
52
  published_at: Published at
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cmor_files
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.53.pre
4
+ version: 0.0.58.pre
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: 2020-03-26 00:00:00.000000000 Z
11
+ date: 2020-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.53.pre
33
+ version: 0.0.58.pre
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.53.pre
40
+ version: 0.0.58.pre
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: cmor_core_frontend
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.0.53.pre
47
+ version: 0.0.58.pre
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.0.53.pre
54
+ version: 0.0.58.pre
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: sqlite3
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -401,6 +401,7 @@ files:
401
401
  - app/models/cmor/files/folder.rb
402
402
  - app/view_helpers/cmor/files/application_view_helper.rb
403
403
  - app/views/cmor/files/application_view_helper/_render_file.html.haml
404
+ - app/views/cmor/files/application_view_helper/_render_folder.html.haml
404
405
  - app/views/cmor/files/file_details/index.html.haml
405
406
  - app/views/cmor/files/file_details/show.html.haml
406
407
  - app/views/cmor/files/folders/index.html.haml
@@ -451,7 +452,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
451
452
  - !ruby/object:Gem::Version
452
453
  version: 1.3.1
453
454
  requirements: []
454
- rubygems_version: 3.1.2
455
+ rubygems_version: 3.1.4
455
456
  signing_key:
456
457
  specification_version: 4
457
458
  summary: Cmor Files Module.