wco_models 3.1.0.145 → 3.1.0.147
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/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/application_controller.rb +4 -0
- data/app/controllers/wco/galleries_controller.rb +5 -6
- data/app/controllers/wco/photos_controller.rb +6 -4
- 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 +3 -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 = {
|
|
@@ -17,6 +17,7 @@ class Wco::ApplicationController < ActionController::Base
|
|
|
17
17
|
check_authorization
|
|
18
18
|
|
|
19
19
|
before_action :current_profile
|
|
20
|
+
before_action :set_lists
|
|
20
21
|
|
|
21
22
|
def home
|
|
22
23
|
authorize! :home, Wco
|
|
@@ -80,4 +81,7 @@ class Wco::ApplicationController < ActionController::Base
|
|
|
80
81
|
["1", "t", "T", "true"].include?( which )
|
|
81
82
|
end
|
|
82
83
|
|
|
84
|
+
def set_lists
|
|
85
|
+
end
|
|
86
|
+
|
|
83
87
|
end
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
class Wco::GalleriesController < Wco::ApplicationController
|
|
3
3
|
|
|
4
|
-
before_action :set_lists, only: %i| show |
|
|
5
4
|
before_action :set_gallery, only: %w| destroy edit j_show show update update_ordering |
|
|
6
5
|
|
|
7
6
|
# Alphabetized! : )
|
|
@@ -93,12 +92,12 @@ class Wco::GalleriesController < Wco::ApplicationController
|
|
|
93
92
|
|
|
94
93
|
def update_ordering
|
|
95
94
|
authorize! :update, @gallery
|
|
96
|
-
|
|
97
|
-
params[:
|
|
98
|
-
|
|
95
|
+
flags = []
|
|
96
|
+
params[:ids].each_with_index do |id, idx|
|
|
97
|
+
flags.push Wco::Photo.find( id ).update( weight: idx )
|
|
99
98
|
end
|
|
100
|
-
|
|
101
|
-
redirect_to
|
|
99
|
+
flash_notice "Ordering photos: #{flags}"
|
|
100
|
+
redirect_to request.referrer
|
|
102
101
|
end
|
|
103
102
|
|
|
104
103
|
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
|
|
|
@@ -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.147
|
|
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
|