wco_models 3.4.0.4 → 3.4.0.6
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/app/controllers/wco/reports_controller.rb +6 -5
- data/app/models/wco/report.rb +6 -0
- data/app/views/wco/reports/_form.haml +13 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7f85118ba510731af3b3371536213d34ec86a4e542e7b73cc526f5a3d83ba9cd
|
|
4
|
+
data.tar.gz: 263d6de8e8efdbf929cee0729bd19263ec27bafaf896522b311a7c37c4e45a16
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b8d394f91959a7e252f1459add6a6c12481adcb06145895d05413dc271cf3dd01f47824c3535d238fb6b2bb873bcdac14dcea532a916252a32fdee01c35893b9
|
|
7
|
+
data.tar.gz: a75b11c2553523528b6d1c458cbdd42aa0ff278dd2e5473bcbbb39f4603261b44e3350b393d3020745b1d0dcd749cdb2ab7421585fb34c150a0fe64e24841dcd
|
|
@@ -5,16 +5,18 @@ class Wco::ReportsController < Wco::ApplicationController
|
|
|
5
5
|
|
|
6
6
|
def create
|
|
7
7
|
params[:report][:tag_ids]&.delete ''
|
|
8
|
+
img_thumb_params = params[:report][:image_thumb]
|
|
9
|
+
params[:report].delete :image_thumb
|
|
8
10
|
|
|
9
11
|
@report = Wco::Report.new params[:report].permit!
|
|
10
12
|
authorize! :create, @report
|
|
11
13
|
|
|
12
14
|
@report.author = current_profile
|
|
13
15
|
|
|
14
|
-
if
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
if img_thumb_params.present?
|
|
17
|
+
@photo = Wco::Photo.new photo: img_thumb_params
|
|
18
|
+
@photo.save!
|
|
19
|
+
@report.image_thumb = @photo
|
|
18
20
|
end
|
|
19
21
|
|
|
20
22
|
if @report.save
|
|
@@ -205,7 +207,6 @@ class Wco::ReportsController < Wco::ApplicationController
|
|
|
205
207
|
params[:report][:tag_ids]&.delete ''
|
|
206
208
|
img_thumb_params = params[:report][:image_thumb]
|
|
207
209
|
params[:report].delete :image_thumb
|
|
208
|
-
# puts! img_thumb_params, 'img_thumb_params'
|
|
209
210
|
|
|
210
211
|
@report = Wco::Report.unscoped.find params[:id]
|
|
211
212
|
authorize! :update, @report
|
data/app/models/wco/report.rb
CHANGED
|
@@ -27,10 +27,16 @@ class Wco::Report
|
|
|
27
27
|
def body_json
|
|
28
28
|
body.gsub(/\r/, '').gsub(/\n\n+/, '<br /><br />').to_json
|
|
29
29
|
end
|
|
30
|
+
FORMAT_PLAINTEXT = 'format-plaintext'
|
|
31
|
+
FORMAT_FULLHTML = 'format-fullhtml'
|
|
32
|
+
FORMATS = [ FORMAT_PLAINTEXT, FORMAT_FULLHTML ]
|
|
33
|
+
field :body_format, type: :string, default: FORMAT_PLAINTEXT
|
|
30
34
|
|
|
31
35
|
field :x, :type => Float
|
|
32
36
|
field :y, :type => Float
|
|
33
37
|
field :z, :type => Float
|
|
38
|
+
field :source_url, type: :string
|
|
39
|
+
field :summary, type: :string
|
|
34
40
|
|
|
35
41
|
belongs_to :author, class_name: 'Wco::Profile', optional: true
|
|
36
42
|
|
|
@@ -11,7 +11,18 @@
|
|
|
11
11
|
%label Slug
|
|
12
12
|
= f.text_field :slug, class: 'w-100'
|
|
13
13
|
|
|
14
|
+
.field.flex-row
|
|
15
|
+
%label source_url
|
|
16
|
+
= f.text_field :source_url, class: 'w-100'
|
|
17
|
+
|
|
14
18
|
.field
|
|
19
|
+
%label Summary
|
|
20
|
+
= f.text_area :summary
|
|
21
|
+
|
|
22
|
+
.field.d-flex.flex-column
|
|
23
|
+
%label body_format
|
|
24
|
+
= f.select :body_format, options_for_select(Wco::Report::FORMATS, selected: report.body_format)
|
|
25
|
+
|
|
15
26
|
%label Body
|
|
16
27
|
= f.text_area :body, class: 'tinymce'
|
|
17
28
|
|
|
@@ -25,9 +36,9 @@
|
|
|
25
36
|
%label image
|
|
26
37
|
= f.file_field :image_thumb
|
|
27
38
|
|
|
28
|
-
- if report.image_thumb
|
|
39
|
+
- if report.image_thumb
|
|
29
40
|
%p Current:
|
|
30
|
-
= image_tag report.image_thumb.
|
|
41
|
+
= image_tag report.image_thumb.photo.url(:thumb)
|
|
31
42
|
|
|
32
43
|
-# .field
|
|
33
44
|
-# %label Newsvideo:
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: wco_models
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.4.0.
|
|
4
|
+
version: 3.4.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Victor Pudeyev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: aws-sdk-s3
|