wco_models 3.1.0.134 → 3.1.0.136
Sign up to get free protection for your applications and to get access to all the features.
- 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 +24 -20
- data/app/views/wco/galleries/show.haml +29 -10
- data/app/views/wco/profiles/_form_extra.haml +12 -0
- data/config/routes.rb +4 -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: a4aca388a9b787126a677bc0a0dada925305f24381f879dc7df154179e968381
|
4
|
+
data.tar.gz: b2d6f9d703ab36d7bbdb1ce87940f516b96ff9e9c288a9f201bf8d712e3f4bb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 102c9769aa8cff0861ca10a8a63774da3d17686dc36ffc1f2a3bcb290504c4263fcc3d2a4149ca5796fd6c5406b24ce314f5bcdb1e479ec824fc743ca7432970
|
7
|
+
data.tar.gz: c79fa5615fe7d33f5ca72b56934c71934177f9f70d3cfad6d1af54a43dc801c6eab1895a4dbe4243b960ee98fc49cdaea6b8c436dd2c344375961d3a9dda75e8
|
@@ -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,36 +4,40 @@
|
|
4
4
|
-# _vp_ 2022-09-25 :: Small styling revision
|
5
5
|
-#
|
6
6
|
|
7
|
-
- n_thumbs ||= 8
|
8
7
|
- galleries ||= @galleries
|
9
8
|
|
9
|
+
|
10
10
|
.galleries--index.maxwidth
|
11
11
|
= render 'header', galleries: galleries
|
12
12
|
|
13
13
|
.padded
|
14
14
|
- if galleries.length > 0
|
15
|
-
|
16
15
|
- if galleries.respond_to? :total_pages
|
17
16
|
= paginate galleries, :param_name => :galleries_page, :views_prefix => 'wco'
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
18
|
+
= form_tag update_galleries_path do
|
19
|
+
= select_tag 'tag_ids[]', options_for_select([ nil, 1 ]), { multiple: true }
|
20
|
+
= submit_tag 'Add Tags'
|
21
|
+
|
22
|
+
.row
|
23
|
+
- galleries.each do |g|
|
24
|
+
.col-sm-12.col-md-6
|
25
|
+
.Card
|
26
|
+
%h5
|
27
|
+
= check_box_tag 'ids[]', g.id
|
28
|
+
= link_to '[~]', edit_gallery_path( g )
|
29
|
+
= link_to g.name, gallery_path(g.slug)
|
30
|
+
(#{g.photos.length})
|
31
|
+
= render 'meta', item: g
|
32
|
+
- if g.photos.length == 0
|
33
|
+
No Photos
|
34
|
+
- else
|
35
|
+
.d-flex.flex-wrap.photos-thumbs
|
36
|
+
- g.photos.limit( @current_profile.show_n_thumbs ).each do |photo|
|
37
|
+
= link_to image_tag(photo.photo.url(:thumb), :alt => ''), gallery_path(g.slug)
|
38
|
+
|
39
|
+
- if galleries.respond_to? :total_pages
|
40
|
+
= paginate galleries, :param_name => :galleries_page, :views_prefix => 'wco'
|
37
41
|
|
38
42
|
- else
|
39
43
|
%h5 No Galleries
|
@@ -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([ 2, 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
@@ -11,6 +11,7 @@ Wco::Engine.routes.draw do
|
|
11
11
|
resources :assets
|
12
12
|
# get 'assets/:id', to: 'assets#show', as: :asset
|
13
13
|
|
14
|
+
post 'galleries/update', to: 'galleries#update', as: :update_galleries
|
14
15
|
resources :galleries do
|
15
16
|
post 'multiadd', :to => 'photos#j_create', :as => :multiadd
|
16
17
|
end
|
@@ -44,6 +45,9 @@ Wco::Engine.routes.draw do
|
|
44
45
|
resources :profiles
|
45
46
|
post 'publishers/:id/do-run', to: 'publishers#do_run', as: :run_publisher
|
46
47
|
resources :publishers
|
48
|
+
|
49
|
+
post 'photos/move', to: 'photos#move', as: :move_photos
|
50
|
+
delete 'photos/delete', to: 'photos#destroy', as: :delete_photos
|
47
51
|
resources :photos
|
48
52
|
|
49
53
|
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.136
|
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-17 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
|