wco_models 3.1.0.134 → 3.1.0.135
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/stylesheets/wco/galleries.scss +6 -6
- data/app/assets/stylesheets/wco/photos.scss +1 -0
- data/app/assets/stylesheets/wco/utils.scss +5 -1
- data/app/controllers/wco/galleries_controller.rb +5 -1
- data/app/controllers/wco/photos_controller.rb +24 -9
- data/app/helpers/wco/application_helper.rb +1 -0
- data/app/models/wco/gallery.rb +3 -1
- data/app/models/wco/profile.rb +1 -0
- data/app/views/wco/_main_footer.haml +1 -5
- data/app/views/wco/application/_debug.haml +3 -0
- data/app/views/wco/galleries/_index.haml +1 -2
- data/app/views/wco/galleries/show.haml +29 -10
- data/app/views/wco/profiles/_form_extra.haml +12 -0
- data/config/routes.rb +3 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f667b2e3aff979297adf77e14f569164761f083784e88e6dc76735d002488f3f
|
|
4
|
+
data.tar.gz: 5cff89fae12fb7c9f8da0bd042b17d425eda08ed5c68f7b6dea78b147b082541
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aa88ab71277a00ded9d9e864f8e44591d6ca1617fc70d04855f7d56709949652a116ff481fa279d0375ff7382a687e86b58bf99b92c2b3d1a9fca1e7f222a13c
|
|
7
|
+
data.tar.gz: ce29ae70f121832939b6109cb86a8a5a35a5a694f56506c75580e5d64cc787b12f34ee53c9e1c551eda3d083ab36808a5397ac672489503a343a98ad8fe7fcc2
|
|
@@ -24,12 +24,12 @@ div.galleries-show {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
.row-thumbs {
|
|
28
|
+
.items {
|
|
29
|
+
flex-wrap: wrap;
|
|
30
|
+
align-items: flex-start;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
33
|
|
|
34
34
|
.row-large .item {
|
|
35
35
|
// border: 1px solid red;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
class Wco::GalleriesController < Wco::ApplicationController
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
before_action :set_lists, only: %i| show |
|
|
5
5
|
before_action :set_gallery, only: %w| destroy edit j_show show update update_ordering |
|
|
6
6
|
|
|
7
7
|
# Alphabetized! : )
|
|
@@ -142,5 +142,9 @@ class Wco::GalleriesController < Wco::ApplicationController
|
|
|
142
142
|
@page_description = @gallery.subhead
|
|
143
143
|
end
|
|
144
144
|
|
|
145
|
+
def set_lists
|
|
146
|
+
@galleries_list = Wco::Gallery.list
|
|
147
|
+
end
|
|
148
|
+
|
|
145
149
|
end
|
|
146
150
|
|
|
@@ -8,16 +8,18 @@ class Wco::PhotosController < Wco::ApplicationController
|
|
|
8
8
|
## Alphabetized : )
|
|
9
9
|
|
|
10
10
|
def destroy
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if flag
|
|
17
|
-
flash[:notice] = "Success"
|
|
18
|
-
else
|
|
19
|
-
flash[:alert] = "No luck: #{@photo.errors.messages}"
|
|
11
|
+
authorize! :destroy, Wco::Photo
|
|
12
|
+
if params[:id]
|
|
13
|
+
@photos = [ Wco::Photo.unscoped.find( params[:id] ) ]
|
|
14
|
+
elsif params[:ids]
|
|
15
|
+
@photos = Wco::Photo.where( :id.in => params[:ids] )
|
|
20
16
|
end
|
|
17
|
+
outs = []
|
|
18
|
+
@photos.map do |photo|
|
|
19
|
+
photo.gallery.touch if photo.gallery
|
|
20
|
+
outs.push photo.delete
|
|
21
|
+
end
|
|
22
|
+
flash_notice "Outcomes: #{outs}"
|
|
21
23
|
redirect_to request.referrer || root_path
|
|
22
24
|
end
|
|
23
25
|
|
|
@@ -60,6 +62,19 @@ class Wco::PhotosController < Wco::ApplicationController
|
|
|
60
62
|
end
|
|
61
63
|
end
|
|
62
64
|
|
|
65
|
+
def move
|
|
66
|
+
authorize! :move, Wco::Photo
|
|
67
|
+
photos = Wco::Photo.where({ :id.in => params[:ids] })
|
|
68
|
+
|
|
69
|
+
flag = photos.update_all({ gallery_id: params[:gallery_id] })
|
|
70
|
+
if flag
|
|
71
|
+
flash_notice 'ok'
|
|
72
|
+
else
|
|
73
|
+
flash_alert 'not ok'
|
|
74
|
+
end
|
|
75
|
+
redirect_to request.referrer
|
|
76
|
+
end
|
|
77
|
+
|
|
63
78
|
def new
|
|
64
79
|
authorize! :new, Wco::Photo
|
|
65
80
|
@photo = Wco::Photo.new
|
data/app/models/wco/gallery.rb
CHANGED
|
@@ -40,7 +40,9 @@ class Wco::Gallery
|
|
|
40
40
|
|
|
41
41
|
def self.list conditions = {}
|
|
42
42
|
out = self.unscoped.where( conditions ).order_by( :created_at => :desc )
|
|
43
|
-
[['', nil]] + out.map
|
|
43
|
+
[['', nil]] + out.map do |item|
|
|
44
|
+
[ "#{item.created_at.strftime('%Y%m%d')} #{item.name}", item.id ]
|
|
45
|
+
end
|
|
44
46
|
end
|
|
45
47
|
|
|
46
48
|
has_many :photos, class_name: '::Wco::Photo', order: { weight: :asc }
|
data/app/models/wco/profile.rb
CHANGED
|
@@ -10,6 +10,7 @@ class Wco::Profile
|
|
|
10
10
|
validates :email, presence: true, uniqueness: true
|
|
11
11
|
|
|
12
12
|
field :per_page, type: :integer, default: 25
|
|
13
|
+
field :show_n_thumbs, type: :integer, default: 8
|
|
13
14
|
|
|
14
15
|
belongs_to :leadset, class_name: 'Wco::Leadset', inverse_of: :profile, optional: true
|
|
15
16
|
has_many :newsitems, class_name: 'Wco::Newsitem'
|
|
@@ -27,11 +27,7 @@
|
|
|
27
27
|
= pp_time Time.now
|
|
28
28
|
|
|
29
29
|
.col-sm-4
|
|
30
|
-
=
|
|
31
|
-
.flex-row
|
|
32
|
-
= f.label :per_page
|
|
33
|
-
= f.select :per_page, options_for_select([ 10, 25, 50, 100, 250, 500, 1000], selected: @current_profile.per_page)
|
|
34
|
-
= f.submit 'Go'
|
|
30
|
+
= render '/wco/profiles/form_extra', profile: @current_profile
|
|
35
31
|
= link_to 'RTEditor', wco.application_tinymce_path, target: :_blank
|
|
36
32
|
|
|
37
33
|
.c
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
-# _vp_ 2022-09-25 :: Small styling revision
|
|
5
5
|
-#
|
|
6
6
|
|
|
7
|
-
- n_thumbs ||= 8
|
|
8
7
|
- galleries ||= @galleries
|
|
9
8
|
|
|
10
9
|
.galleries--index.maxwidth
|
|
@@ -29,7 +28,7 @@
|
|
|
29
28
|
No Photos
|
|
30
29
|
- else
|
|
31
30
|
.d-flex.flex-wrap.photos-thumbs
|
|
32
|
-
- g.photos.limit(
|
|
31
|
+
- g.photos.limit( @current_profile.show_n_thumbs ).each do |photo|
|
|
33
32
|
= link_to image_tag(photo.photo.url(:thumb), :alt => ''), gallery_path(g.slug)
|
|
34
33
|
|
|
35
34
|
- if galleries.respond_to? :total_pages
|
|
@@ -21,17 +21,36 @@
|
|
|
21
21
|
= link_to image_tag(photo.photo.url( :mini ), :alt => ''), "#large_#{photo.id}"
|
|
22
22
|
|
|
23
23
|
.row-thumbs
|
|
24
|
-
%
|
|
24
|
+
%i.fa.fa-expand.collapse-expand#rowMovableThumbs Movable Thumbs
|
|
25
25
|
.orderable-items{ data: { id: @gallery.id.to_s, slug: @gallery.slug, token: form_authenticity_token } }
|
|
26
|
-
.
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
=
|
|
34
|
-
|
|
26
|
+
= form_tag wco.move_photos_path, { method: :post } do
|
|
27
|
+
.d-flex
|
|
28
|
+
= select_tag :gallery_id, options_for_select(@galleries_list), class: 'select2'
|
|
29
|
+
= submit_tag 'Move', data: { confirm: 'Are you sure?' }
|
|
30
|
+
.d-flex.items
|
|
31
|
+
- @photos.each do |photo|
|
|
32
|
+
.itemW
|
|
33
|
+
= check_box_tag 'ids[]', photo.id
|
|
34
|
+
.item{ data: { id: photo.id.to_s } }
|
|
35
|
+
= image_tag photo.photo.url( :thumb )
|
|
36
|
+
|
|
37
|
+
.row-thumbs
|
|
38
|
+
%i.fa.fa-expand.collapse-expand#rowOrderableThumbs Orderable, Deletable Thumbs
|
|
39
|
+
.orderable-items{ data: { id: @gallery.id.to_s, slug: @gallery.slug, token: form_authenticity_token } }
|
|
40
|
+
= form_tag wco.delete_photos_path, { method: :delete } do
|
|
41
|
+
= submit_tag 'Delete', data: { confirm: 'Are you sure?' }
|
|
42
|
+
= button_tag 'Save ordering', class: 'save-ordering'
|
|
43
|
+
.d-flex.items
|
|
44
|
+
- @photos.each do |photo|
|
|
45
|
+
.itemW
|
|
46
|
+
%a.mvLeft <
|
|
47
|
+
%a.mvRight >
|
|
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 )
|
|
52
|
+
|
|
53
|
+
|
|
35
54
|
|
|
36
55
|
.row-large
|
|
37
56
|
%p.collapse-expand#rowLarge Large
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
= form_for @current_profile, url: wco.profile_path(@current_profile), as: :profile do |f|
|
|
4
|
+
.mini-inputs
|
|
5
|
+
.flex-row
|
|
6
|
+
= f.label :per_page
|
|
7
|
+
= f.select :per_page, options_for_select([ 10, 25, 50, 100, 250, 500, 1000], selected: @current_profile.per_page)
|
|
8
|
+
.d-flex
|
|
9
|
+
%label show_n_thumbs
|
|
10
|
+
= f.number_field :show_n_thumbs
|
|
11
|
+
.actions
|
|
12
|
+
= f.submit 'Go'
|
data/config/routes.rb
CHANGED
|
@@ -44,6 +44,9 @@ Wco::Engine.routes.draw do
|
|
|
44
44
|
resources :profiles
|
|
45
45
|
post 'publishers/:id/do-run', to: 'publishers#do_run', as: :run_publisher
|
|
46
46
|
resources :publishers
|
|
47
|
+
|
|
48
|
+
post 'photos/move', to: 'photos#move', as: :move_photos
|
|
49
|
+
delete 'photos/delete', to: 'photos#destroy', as: :delete_photos
|
|
47
50
|
resources :photos
|
|
48
51
|
|
|
49
52
|
get 'reports/deleted', to: 'reports#index', as: :deleted_reports, defaults: { deleted: true }
|
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.135
|
|
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-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: aws-sdk-s3
|
|
@@ -571,6 +571,7 @@ files:
|
|
|
571
571
|
- app/views/wco/products/new.haml
|
|
572
572
|
- app/views/wco/products/show.haml
|
|
573
573
|
- app/views/wco/products/show.jbuilder
|
|
574
|
+
- app/views/wco/profiles/_form_extra.haml
|
|
574
575
|
- app/views/wco/publishers/_form.haml
|
|
575
576
|
- app/views/wco/publishers/_header.haml
|
|
576
577
|
- app/views/wco/publishers/edit.haml
|