wco_models 3.1.0.144 → 3.1.0.146
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/vendor/jquery-ui@1.13.2.js +19062 -0
- data/app/assets/javascripts/wco/application.js +6 -0
- data/app/assets/stylesheets/wco/utils.scss +1 -1
- data/app/controllers/wco/galleries_controller.rb +5 -5
- data/app/controllers/wco/photos_controller.rb +6 -4
- data/app/mailers/wco_email/application_mailer.rb +1 -21
- data/app/mailers/wco_email/application_mailer.rb-trash +18 -0
- data/app/models/wco_email/email_template.rb +1 -0
- data/app/views/wco/galleries/show.haml +24 -26
- data/app/views/wco/photos/_meta_manager.haml +1 -1
- data/config/routes.rb +1 -0
- metadata +4 -2
@@ -5,6 +5,7 @@
|
|
5
5
|
//= require ../vendor/bootstrap-4.6.2.min
|
6
6
|
//= require ../vendor/select2-4.0.0
|
7
7
|
//= require ../vendor/jquery.dataTables-1.10.16
|
8
|
+
//= require ../vendor/jquery-ui@1.13.2.js
|
8
9
|
//
|
9
10
|
// Skip for now b/c I need to move fonts, too:
|
10
11
|
// require ../vendor/summernote-0.8.18
|
@@ -28,6 +29,11 @@
|
|
28
29
|
|
29
30
|
$(function() {
|
30
31
|
|
32
|
+
/* sortable */
|
33
|
+
$( function() {
|
34
|
+
$( ".orderable-items" ).sortable();
|
35
|
+
} );
|
36
|
+
|
31
37
|
/* DataTable */
|
32
38
|
if ('function' === typeof $('body').DataTable) {
|
33
39
|
const _props = {
|
@@ -93,12 +93,12 @@ class Wco::GalleriesController < Wco::ApplicationController
|
|
93
93
|
|
94
94
|
def update_ordering
|
95
95
|
authorize! :update, @gallery
|
96
|
-
|
97
|
-
params[:
|
98
|
-
|
96
|
+
flags = []
|
97
|
+
params[:ids].each_with_index do |id, idx|
|
98
|
+
flags.push Wco::Photo.find( id ).update( weight: idx )
|
99
99
|
end
|
100
|
-
|
101
|
-
redirect_to
|
100
|
+
flash_notice "Ordering photos: #{flags}"
|
101
|
+
redirect_to request.referrer
|
102
102
|
end
|
103
103
|
|
104
104
|
def update
|
@@ -66,12 +66,14 @@ class Wco::PhotosController < Wco::ApplicationController
|
|
66
66
|
authorize! :move, Wco::Photo
|
67
67
|
photos = Wco::Photo.where({ :id.in => params[:ids] })
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
69
|
+
if params['delete'] == '1'
|
70
|
+
flash_notice 'deleting'
|
71
|
+
flag = photos.map &:delete
|
72
72
|
else
|
73
|
-
|
73
|
+
flag = photos.update_all({ gallery_id: params[:gallery_id] })
|
74
|
+
flash_notice 'moving'
|
74
75
|
end
|
76
|
+
flash_notice flag
|
75
77
|
redirect_to request.referrer
|
76
78
|
end
|
77
79
|
|
@@ -52,28 +52,8 @@ class WcoEmail::ApplicationMailer < ActionMailer::Base
|
|
52
52
|
rendered_str = @renderer.render_to_string("/wco_email/email_layouts/_#{@ctx.tmpl.layout}")
|
53
53
|
|
54
54
|
|
55
|
-
|
56
55
|
rendered_subject = ERB.new( @ctx.subject ).result( @ctx.get_binding )
|
57
|
-
if @ctx.lead.leadset.mangle_subject
|
58
|
-
## From: https://www.fileformat.info/info/unicode/char/a.htm
|
59
|
-
## From: https://stackoverflow.com/questions/7019034/utf-8-encoding-in-ruby-using-a-variable
|
60
|
-
## From: https://stackoverflow.com/questions/52654509/random-generate-a-valid-unicode-character-in-ruby
|
61
|
-
## latin
|
62
|
-
# n1 = 0x192
|
63
|
-
# n2 = 0x687
|
64
|
-
##
|
65
|
-
## weird punctuation
|
66
|
-
# n1 = 0x133
|
67
|
-
# n2 = 0x255
|
68
|
-
|
69
|
-
# random_utf8 = Enumerator.new do |yielder|
|
70
|
-
# loop do
|
71
|
-
# yielder << ( rand(n2-n1)+n1 ).chr('UTF-8')
|
72
|
-
# rescue RangeError
|
73
|
-
# end
|
74
|
-
# end
|
75
|
-
# rendered_subject = "#{rendered_subject} #{ random_utf8.next }#{ random_utf8.next }"
|
76
|
-
|
56
|
+
if @ctx.lead.leadset.mangle_subject || @ctx.email_template.mangle_subject
|
77
57
|
## From: https://www.ascii-code.com/
|
78
58
|
n1 = 33
|
79
59
|
n2 = 64
|
@@ -0,0 +1,18 @@
|
|
1
|
+
## From: https://www.fileformat.info/info/unicode/char/a.htm
|
2
|
+
## From: https://stackoverflow.com/questions/7019034/utf-8-encoding-in-ruby-using-a-variable
|
3
|
+
## From: https://stackoverflow.com/questions/52654509/random-generate-a-valid-unicode-character-in-ruby
|
4
|
+
## latin
|
5
|
+
# n1 = 0x192
|
6
|
+
# n2 = 0x687
|
7
|
+
##
|
8
|
+
## weird punctuation
|
9
|
+
# n1 = 0x133
|
10
|
+
# n2 = 0x255
|
11
|
+
|
12
|
+
# random_utf8 = Enumerator.new do |yielder|
|
13
|
+
# loop do
|
14
|
+
# yielder << ( rand(n2-n1)+n1 ).chr('UTF-8')
|
15
|
+
# rescue RangeError
|
16
|
+
# end
|
17
|
+
# end
|
18
|
+
# rendered_subject = "#{rendered_subject} #{ random_utf8.next }#{ random_utf8.next }"
|
@@ -40,6 +40,7 @@ class WcoEmail::EmailTemplate
|
|
40
40
|
field :config_exe, default: "" ## unused! _vp_ 2023-09-24
|
41
41
|
field :config_json, type: Object, default: '{}'
|
42
42
|
field :layout, default: 'plain'
|
43
|
+
field :mangle_subject, type: :boolean, default: false
|
43
44
|
|
44
45
|
DEFAULT_FROM_EMAIL = 'Victor Pudeyev <no-reply@wasya.co>'
|
45
46
|
FROM_EMAILS = [
|
@@ -21,34 +21,31 @@
|
|
21
21
|
= link_to image_tag(photo.photo.url( :mini ), :alt => ''), "#large_#{photo.id}"
|
22
22
|
|
23
23
|
.row-thumbs
|
24
|
-
%i.fa.fa-expand.collapse-expand#rowMovableThumbs Movable Thumbs
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
24
|
+
%i.fa.fa-expand.collapse-expand#rowMovableThumbs Deletable, Movable Thumbs
|
25
|
+
= form_tag wco.move_photos_path, { method: :post } do
|
26
|
+
.d-flex
|
27
|
+
= select_tag :gallery_id, options_for_select(@galleries_list), class: 'select2'
|
28
|
+
= check_box_tag :delete
|
29
|
+
%label Delete?
|
30
|
+
= submit_tag 'Delete or Move', data: { confirm: 'Are you sure?' }
|
31
|
+
.d-flex.items
|
32
|
+
- @photos.each do |photo|
|
33
|
+
.itemW
|
34
|
+
= check_box_tag 'ids[]', photo.id
|
35
|
+
.item{ data: { id: photo.id.to_s } }
|
36
|
+
= image_tag photo.photo.url( :thumb )
|
36
37
|
|
37
38
|
.row-thumbs
|
38
|
-
%i.fa.fa-expand.collapse-expand#rowOrderableThumbs Orderable
|
39
|
-
|
40
|
-
=
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
.
|
46
|
-
|
47
|
-
|
48
|
-
.item{ data: { id: photo.id.to_s } }
|
49
|
-
= check_box_tag 'ids[]', photo.id
|
50
|
-
= render 'wco/photos/meta_manager', photo: photo
|
51
|
-
= image_tag photo.photo.url( :thumb )
|
39
|
+
%i.fa.fa-expand.collapse-expand#rowOrderableThumbs Orderable Thumbs
|
40
|
+
= form_tag wco.update_ordering_photos_path do
|
41
|
+
= hidden_field_tag :id, @gallery.id
|
42
|
+
= submit_tag 'Save ordering', class: 'save-ordering', data: { confirm: 'Are you sure?' }
|
43
|
+
.d-flex.items.orderable-items{ data: { id: @gallery.id.to_s, slug: @gallery.slug, token: form_authenticity_token } }
|
44
|
+
- @photos.each do |photo|
|
45
|
+
.item{ data: { id: photo.id.to_s } }
|
46
|
+
= hidden_field_tag 'ids[]', photo.id
|
47
|
+
= render 'wco/photos/meta_manager', photo: photo
|
48
|
+
= image_tag photo.photo.url( :thumb )
|
52
49
|
|
53
50
|
|
54
51
|
|
@@ -58,5 +55,6 @@
|
|
58
55
|
- @photos.each do |photo|
|
59
56
|
.item
|
60
57
|
%a{id: "large_#{photo.id}" }
|
58
|
+
= button_to '[x]', photo_path( :id => photo.id ), class: 'x', :method => :delete, :data => { :confirm => 'Are you sure?' }
|
61
59
|
= render 'wco/photos/meta_manager', photo: photo
|
62
60
|
.wrapper{ style: "background-image: url('#{photo.photo.url( :large )}')" }
|
@@ -1,6 +1,6 @@
|
|
1
1
|
|
2
2
|
.photos--meta-manager
|
3
|
-
= button_to '[x]', photo_path( :id => photo.id ), class: 'x', :method => :delete, :data => { :confirm => 'Are you sure?' }
|
3
|
+
-# = button_to '[x]', photo_path( :id => photo.id ), class: 'x', :method => :delete, :data => { :confirm => 'Are you sure?' }
|
4
4
|
.right-hand
|
5
5
|
= link_to "Goto", "#large_#{photo.id}", class: 'goto'
|
6
6
|
= link_to "Lg", photo.photo.url(:large)
|
data/config/routes.rb
CHANGED
@@ -46,6 +46,7 @@ Wco::Engine.routes.draw do
|
|
46
46
|
post 'publishers/:id/do-run', to: 'publishers#do_run', as: :run_publisher
|
47
47
|
resources :publishers
|
48
48
|
|
49
|
+
post 'photos/update-ordering', to: 'galleries#update_ordering', as: :update_ordering_photos
|
49
50
|
post 'photos/move', to: 'photos#move', as: :move_photos
|
50
51
|
delete 'photos/delete', to: 'photos#destroy', as: :delete_photos
|
51
52
|
resources :photos
|
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.1.0.
|
4
|
+
version: 3.1.0.146
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Pudeyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|
@@ -371,6 +371,7 @@ files:
|
|
371
371
|
- app/assets/javascripts/vendor/jquery-3.3.1.slim.min.js
|
372
372
|
- app/assets/javascripts/vendor/jquery-3.4.1.min.js
|
373
373
|
- app/assets/javascripts/vendor/jquery-ui.min.js
|
374
|
+
- app/assets/javascripts/vendor/jquery-ui@1.13.2.js
|
374
375
|
- app/assets/javascripts/vendor/jquery.dataTables-1.10.16.js
|
375
376
|
- app/assets/javascripts/vendor/jquery.dataTables-1.10.16.min.js
|
376
377
|
- app/assets/javascripts/vendor/jquery.fileupload.js
|
@@ -434,6 +435,7 @@ files:
|
|
434
435
|
- app/helpers/wco/application_helper.rb
|
435
436
|
- app/jobs/wco_hosting/certbot_job.rb
|
436
437
|
- app/mailers/wco_email/application_mailer.rb
|
438
|
+
- app/mailers/wco_email/application_mailer.rb-trash
|
437
439
|
- app/models/ability.rb
|
438
440
|
- app/models/wco/asset.rb
|
439
441
|
- app/models/wco/gallery.rb
|