You need to sign in or sign up before continuing.
active_scaffold_camera 0.2.0 → 0.3.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 +4 -4
- data/README.md +7 -0
- data/app/assets/javascripts/active_scaffold_camera.js +0 -3
- data/lib/active_scaffold_camera/engine.rb +2 -0
- data/lib/active_scaffold_camera/version.rb +3 -1
- data/lib/active_scaffold_camera/view_helpers.rb +8 -5
- data/lib/active_scaffold_camera.rb +6 -4
- metadata +4 -17
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8497b20150f3eb5d4fcea8deadbc50b702ce52343dd07059d3622a9a356c9401
|
|
4
|
+
data.tar.gz: b45f7073b101da915f5d9b6c121e50402b8b68c6a4d9998c708a15bdea04289a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ca95676e84b4f6467efa21b5b63f19616065607603ff382f769a3aae3a346211cfbdd195e1128f6f3ccefd48ae47ae948e0c4163bdf58489cf835018005d39e8
|
|
7
|
+
data.tar.gz: 867931f1ff2105a56ef1c5427550161ec2d3963655a14ab1b3baebcd74b4adb9860c3fd6e1511262591b0699432b6c3320d64409fb212dc226e78c257a1addcc
|
data/README.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Camera for ActiveScaffold
|
|
2
2
|
|
|
3
|
+
[](https://github.com/activescaffold/active_scaffold_camera/actions/workflows/ci.yml)
|
|
4
|
+
[](https://qlty.sh/gh/activescaffold/projects/active_scaffold_camera)
|
|
5
|
+
[](https://qlty.sh/gh/activescaffold/projects/active_scaffold_camera)
|
|
6
|
+
[](https://badge.fury.io/rb/active_scaffold_camera)
|
|
7
|
+
[](https://inch-ci.org/github/activescaffold/active_scaffold_camera)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
|
|
3
10
|
Currently, this plugin is compatible with ActiveScaffold >= 3.4 gem.
|
|
4
11
|
|
|
5
12
|
## Overview
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module ActiveScaffoldCamera
|
|
2
4
|
module ViewHelpers
|
|
3
|
-
I18N_ATTRIBUTES = [
|
|
5
|
+
I18N_ATTRIBUTES = %i[video_not_supported audio_not_supported media_forbidden].freeze
|
|
4
6
|
def snapshot_attributes(column, ui_options: column.options)
|
|
5
|
-
attributes =
|
|
7
|
+
attributes = I18N_ATTRIBUTES.index_with { |attr| ui_options[attr] || attr }
|
|
6
8
|
attributes[:source] = ui_options[:source] if ui_options[:source]
|
|
7
9
|
I18N_ATTRIBUTES.each { |attr| attributes[attr] = as_(attributes[attr]) if attributes[attr].is_a? Symbol }
|
|
8
10
|
attributes
|
|
9
11
|
end
|
|
10
12
|
|
|
11
13
|
def active_scaffold_input_snapshot(column, html_options, ui_options: column.options)
|
|
12
|
-
content_tag :div, :
|
|
13
|
-
|
|
14
|
+
content_tag :div, class: "snapshot-input #{html_options[:class]}", id: html_options[:id],
|
|
15
|
+
data: snapshot_attributes(column, ui_options: ui_options) do
|
|
16
|
+
hidden_field :record, column.name, name: html_options[:name]
|
|
14
17
|
end
|
|
15
18
|
end
|
|
16
19
|
|
|
17
20
|
def active_scaffold_column_snapshot(record, column, ui_options: column.options)
|
|
18
21
|
value = record.send(column.name)
|
|
19
|
-
tag
|
|
22
|
+
tag.img(src: value) if value
|
|
20
23
|
end
|
|
21
24
|
end
|
|
22
25
|
end
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'active_scaffold_camera/engine'
|
|
2
4
|
|
|
3
5
|
module ActiveScaffoldCamera
|
|
4
6
|
def self.root
|
|
5
|
-
File.dirname(__FILE__)
|
|
7
|
+
"#{File.dirname(__FILE__)}/.."
|
|
6
8
|
end
|
|
7
|
-
autoload
|
|
9
|
+
autoload :ViewHelpers, 'active_scaffold_camera/view_helpers.rb'
|
|
8
10
|
end
|
|
9
11
|
|
|
10
12
|
ActiveScaffold.stylesheets << 'active_scaffold_camera'
|
|
11
|
-
ActiveScaffold.javascripts
|
|
13
|
+
ActiveScaffold.javascripts.push('say-cheese', 'active_scaffold_camera')
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: active_scaffold_camera
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sergio Cambra
|
|
@@ -10,20 +10,6 @@ bindir: bin
|
|
|
10
10
|
cert_chain: []
|
|
11
11
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: bundler
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '2.0'
|
|
20
|
-
type: :development
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - "~>"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '2.0'
|
|
27
13
|
- !ruby/object:Gem::Dependency
|
|
28
14
|
name: active_scaffold
|
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -61,7 +47,8 @@ files:
|
|
|
61
47
|
homepage: http://github.com/activescaffold/active_scaffold_camera
|
|
62
48
|
licenses:
|
|
63
49
|
- MIT
|
|
64
|
-
metadata:
|
|
50
|
+
metadata:
|
|
51
|
+
rubygems_mfa_required: 'true'
|
|
65
52
|
rdoc_options: []
|
|
66
53
|
require_paths:
|
|
67
54
|
- lib
|
|
@@ -69,7 +56,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
69
56
|
requirements:
|
|
70
57
|
- - ">="
|
|
71
58
|
- !ruby/object:Gem::Version
|
|
72
|
-
version: '
|
|
59
|
+
version: '3.2'
|
|
73
60
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
61
|
requirements:
|
|
75
62
|
- - ">="
|