cmor_files 0.0.54.pre → 0.0.55.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/view_helpers/cmor/files/application_view_helper.rb +19 -1
- data/app/views/cmor/files/application_view_helper/_render_folder.html.haml +15 -0
- data/app/views/cmor/files/folders/index.html.haml +1 -1
- data/app/views/cmor/files/folders/show.html.haml +14 -9
- data/config/locales/de.yml +2 -0
- data/config/locales/en.yml +2 -0
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c636ad641994d0576b4703e82cf2bfa703ba98a6311ae14e009c1e5cafa102fd
|
4
|
+
data.tar.gz: 6a718171090d4c602326e4fb96afd798995c34f6794b7192f8c2e87e4758fe18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a46235174b805124158dd2c4501229d9e967e84e4a10a99bd1de3cbaf4cb819b4f1f545fa23757eea4dac602724623b5754daeb638098698d1258342c156e94
|
7
|
+
data.tar.gz: f0ef76e6a5817afcb69acfb0851fbd8fa9469b6b6b19d3e3dfbaf9094ed337525d5515434c6c6bffe74414ca250170d853205ba9b20546cdbca1b1727d2eed92
|
@@ -11,7 +11,7 @@ module Cmor
|
|
11
11
|
# Example:
|
12
12
|
#
|
13
13
|
# # app/views/layouts/application.html.haml
|
14
|
-
# = files_helper(self).
|
14
|
+
# = files_helper(self).render_file(identifier: 'Quick reference manual')
|
15
15
|
#
|
16
16
|
def render_file(identifier:)
|
17
17
|
resource = Cmor::Files::FileDetail.published.where(identifier: identifier).first
|
@@ -21,6 +21,24 @@ module Cmor
|
|
21
21
|
render resource: resource
|
22
22
|
end
|
23
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)})"
|
41
|
+
end
|
24
42
|
end
|
25
43
|
end
|
26
44
|
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
|
-
|
1
|
+
.row
|
2
|
+
.col-12
|
3
|
+
%h1= @resource.name
|
2
4
|
|
3
5
|
.row
|
4
6
|
.col-12
|
5
|
-
|
6
|
-
=
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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 :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
|
data/config/locales/de.yml
CHANGED
@@ -36,12 +36,14 @@ de:
|
|
36
36
|
updated_at: Aktualisiert am
|
37
37
|
cmor/files/folder:
|
38
38
|
id: ID
|
39
|
+
append_assets: Dateien hinzufügen
|
39
40
|
assets: Dateien
|
40
41
|
assets_count: Dateien
|
41
42
|
description: Beschreibung
|
42
43
|
identifier: Bezeichner
|
43
44
|
locale: Sprache
|
44
45
|
name: Name
|
46
|
+
overwrite_assets: Dateien ersetzen
|
45
47
|
position: Position
|
46
48
|
published: Veröffentlicht
|
47
49
|
published_at: Veröffentlicht am
|
data/config/locales/en.yml
CHANGED
@@ -36,12 +36,14 @@ en:
|
|
36
36
|
updated_at: Updated at
|
37
37
|
cmor/files/folder:
|
38
38
|
id: ID
|
39
|
+
append_assets: Append files
|
39
40
|
assets: Files
|
40
41
|
assets_count: Files
|
41
42
|
description: Description
|
42
43
|
identifier: Identifier
|
43
44
|
locale: Locale
|
44
45
|
name: Name
|
46
|
+
overwrite_assets: Overwrite files
|
45
47
|
position: Position
|
46
48
|
published: Published
|
47
49
|
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.
|
4
|
+
version: 0.0.55.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-
|
11
|
+
date: 2020-06-28 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.
|
33
|
+
version: 0.0.55.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.
|
40
|
+
version: 0.0.55.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.
|
47
|
+
version: 0.0.55.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.
|
54
|
+
version: 0.0.55.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.
|
455
|
+
rubygems_version: 3.1.4
|
455
456
|
signing_key:
|
456
457
|
specification_version: 4
|
457
458
|
summary: Cmor Files Module.
|