wco_models 3.1.0.135 → 3.1.0.137
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/chip.scss +2 -2
- data/app/controllers/wco/galleries_controller.rb +28 -2
- data/app/controllers/wco/tags_controller.rb +18 -1
- data/app/models/wco/gallery.rb +3 -0
- data/app/models/wco/tag.rb +2 -0
- data/app/models/wco/video.rb +3 -0
- data/app/views/wco/galleries/_index.haml +40 -24
- data/app/views/wco/galleries/_title.haml +3 -0
- data/app/views/wco/profiles/_form_extra.haml +1 -1
- data/app/views/wco/tags/_index_inline.haml +3 -6
- data/app/views/wco/tags/show.haml +3 -0
- data/config/routes.rb +1 -0
- 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: 632761ee3733fa6dfa80381c4e542ced567f4ef571d3bd2cc14bd649f46c91b7
|
4
|
+
data.tar.gz: c597ae263f07ce7b48a86d0f95890a159a63d0275f2f56fe1ea46108bb3380c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08fdf497885da8ba2afe8ea69995a21152f565811e2d1ab584abdad2087f4ac836169d67ad489ba517c8357286d47eb17a6a0b8023afb45fb75ef05be13dccd0'
|
7
|
+
data.tar.gz: '0778143ba46e945b64d8f2da6eb52afb9486ce60e427c843e613b8535d705c98801e3b1d852bd4bbc963bc992f8aa61d17d3f3cc29adafe0954429acf8de2caf'
|
@@ -12,12 +12,12 @@
|
|
12
12
|
color: var(--wco-color-2contrast);
|
13
13
|
}
|
14
14
|
|
15
|
-
display: inline;
|
15
|
+
display: inline-block;
|
16
16
|
|
17
17
|
height: 32px;
|
18
18
|
|
19
19
|
margin-right: 32px;
|
20
|
-
margin-bottom: 0.
|
20
|
+
margin-bottom: 0.3em;
|
21
21
|
|
22
22
|
padding: 0.1em .3em;
|
23
23
|
padding: 0.2em 0.2em 0.2em 0.6em;
|
@@ -44,14 +44,15 @@ class Wco::GalleriesController < Wco::ApplicationController
|
|
44
44
|
@page_title = 'Galleries'
|
45
45
|
@galleries = Wco::Gallery.all.order_by( :created_at => :desc )
|
46
46
|
|
47
|
+
@tags = Wco::Tag.all
|
48
|
+
|
47
49
|
if params[:q]
|
48
50
|
q = URI.decode(params[:q])
|
49
51
|
@galleries = @galleries.where({ :name => /#{q}/i })
|
50
52
|
end
|
51
53
|
|
52
54
|
@galleries = @galleries.page( params[:galleries_page] ).per( current_profile.per_page )
|
53
|
-
|
54
|
-
render "_index"
|
55
|
+
render '_index'
|
55
56
|
end
|
56
57
|
|
57
58
|
def j_show
|
@@ -127,6 +128,31 @@ class Wco::GalleriesController < Wco::ApplicationController
|
|
127
128
|
end
|
128
129
|
end
|
129
130
|
|
131
|
+
def update_many
|
132
|
+
authorize! :update, Wco::Gallery
|
133
|
+
galleries = Wco::Gallery.where( :id.in => params[:gallery_ids] )
|
134
|
+
|
135
|
+
tags = Wco::Tag.where( :id.in => params[:tag_ids] )
|
136
|
+
|
137
|
+
if params[:remove]
|
138
|
+
galleries.each do |gallery|
|
139
|
+
tags.each do |tag|
|
140
|
+
gallery.tags.delete tag
|
141
|
+
end
|
142
|
+
gallery.save
|
143
|
+
end
|
144
|
+
else
|
145
|
+
galleries.each do |gallery|
|
146
|
+
gallery.tags.push tags
|
147
|
+
gallery.save
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
flash_notice 'Unknown outcome, no exception raised.'
|
152
|
+
redirect_to request.referrer
|
153
|
+
end
|
154
|
+
|
155
|
+
|
130
156
|
##
|
131
157
|
## private
|
132
158
|
##
|
@@ -1,6 +1,8 @@
|
|
1
1
|
|
2
2
|
class Wco::TagsController < Wco::ApplicationController
|
3
3
|
|
4
|
+
before_action :set_lists, only: %i| show |
|
5
|
+
|
4
6
|
def create
|
5
7
|
@tag = Wco::Tag.new params[:tag].permit!
|
6
8
|
authorize! :create, @tag
|
@@ -42,7 +44,12 @@ class Wco::TagsController < Wco::ApplicationController
|
|
42
44
|
@tag = Wco::Tag.find params[:id]
|
43
45
|
authorize! :show, @tag
|
44
46
|
|
45
|
-
@
|
47
|
+
@galleries = @tag.galleries(
|
48
|
+
).page( params[:galleries_page] ).per( current_profile.per_page )
|
49
|
+
|
50
|
+
@reports = @tag.reports(
|
51
|
+
).page( params[:reports_page] ).per( current_profile.per_page )
|
52
|
+
|
46
53
|
end
|
47
54
|
|
48
55
|
def update
|
@@ -56,4 +63,14 @@ class Wco::TagsController < Wco::ApplicationController
|
|
56
63
|
redirect_to action: 'index'
|
57
64
|
end
|
58
65
|
|
66
|
+
##
|
67
|
+
## private
|
68
|
+
##
|
69
|
+
private
|
70
|
+
|
71
|
+
def set_lists
|
72
|
+
@tags = Wco::Tag.all
|
73
|
+
end
|
74
|
+
|
75
|
+
|
59
76
|
end
|
data/app/models/wco/gallery.rb
CHANGED
data/app/models/wco/tag.rb
CHANGED
@@ -18,7 +18,9 @@ class Wco::Tag
|
|
18
18
|
has_and_belongs_to_many :headlines # , class_name: 'Headline'
|
19
19
|
has_and_belongs_to_many :leads, index: true # , class_name: 'Lead'
|
20
20
|
has_and_belongs_to_many :leadsets # , class_name: 'Leadset'
|
21
|
+
has_and_belongs_to_many :galleries
|
21
22
|
has_and_belongs_to_many :reports
|
23
|
+
has_and_belongs_to_many :videos
|
22
24
|
has_and_belongs_to_many :logs
|
23
25
|
|
24
26
|
INBOX = 'inbox'
|
data/app/models/wco/video.rb
CHANGED
@@ -32,6 +32,9 @@ class Wco::Video
|
|
32
32
|
# belongs_to :user_profile, :class_name => 'Ish::UserProfile', :inverse_of => :videos
|
33
33
|
# has_and_belongs_to_many :shared_profiles, :class_name => 'Ish::UserProfile', :inverse_of => :shared_videos
|
34
34
|
|
35
|
+
has_and_belongs_to_many :tags
|
36
|
+
|
37
|
+
|
35
38
|
has_mongoid_attached_file :video,
|
36
39
|
# styles: { :thumb => { geometry: '192x108', format: 'jpeg' }, },
|
37
40
|
# processors: [ :transcoder ],
|
@@ -6,34 +6,50 @@
|
|
6
6
|
|
7
7
|
- galleries ||= @galleries
|
8
8
|
|
9
|
+
|
9
10
|
.galleries--index.maxwidth
|
10
|
-
= render 'header', galleries: galleries
|
11
|
+
= render '/wco/galleries/header', galleries: galleries
|
11
12
|
|
12
13
|
.padded
|
13
14
|
- if galleries.length > 0
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
15
|
+
= form_tag update_galleries_path do
|
16
|
+
- @tags.each do |tag|
|
17
|
+
|
18
|
+
.Chip
|
19
|
+
= check_box_tag 'tag_ids[]', tag.id
|
20
|
+
= tag
|
21
|
+
|
22
|
+
= submit_tag 'Add Tags', data: { confirm: 'Are you sure?' }
|
23
|
+
|
24
|
+
%label remove?
|
25
|
+
= check_box_tag :remove
|
26
|
+
= submit_tag 'Tags', data: { confirm: 'Are you sure?' }
|
27
|
+
|
28
|
+
- if galleries.respond_to? :total_pages
|
29
|
+
= paginate galleries, :param_name => :galleries_page, :views_prefix => 'wco'
|
30
|
+
|
31
|
+
.row
|
32
|
+
- galleries.each do |g|
|
33
|
+
.col-sm-12.col-md-6
|
34
|
+
.Card
|
35
|
+
%h5
|
36
|
+
= check_box_tag 'gallery_ids[]', g.id
|
37
|
+
= link_to '[~]', edit_gallery_path( g )
|
38
|
+
= link_to g.name, gallery_path(g.slug)
|
39
|
+
(#{g.photos.length})
|
40
|
+
= render 'meta', item: g
|
41
|
+
- if g.photos.length == 0
|
42
|
+
No Photos
|
43
|
+
- else
|
44
|
+
.d-flex.flex-wrap.photos-thumbs
|
45
|
+
- g.photos.limit( @current_profile.show_n_thumbs ).each do |photo|
|
46
|
+
= link_to image_tag(photo.photo.url(:thumb), :alt => ''), gallery_path(g.slug)
|
47
|
+
|
48
|
+
- if galleries.respond_to? :total_pages
|
49
|
+
= paginate galleries, :param_name => :galleries_page, :views_prefix => 'wco'
|
36
50
|
|
37
51
|
- else
|
38
|
-
|
52
|
+
.p No Galleries
|
53
|
+
|
54
|
+
|
39
55
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
.mini-inputs
|
5
5
|
.flex-row
|
6
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)
|
7
|
+
= f.select :per_page, options_for_select([ 2, 10, 25, 50, 100, 250, 500, 1000], selected: @current_profile.per_page)
|
8
8
|
.d-flex
|
9
9
|
%label show_n_thumbs
|
10
10
|
= f.number_field :show_n_thumbs
|
@@ -12,6 +12,9 @@
|
|
12
12
|
%li.d-flex
|
13
13
|
<b>Headlines (#{@tag.headlines.length}): </b>
|
14
14
|
= render '/wco/headlines/index', headlines: @tag.headlines
|
15
|
+
%li.d-flex
|
16
|
+
<b>Galleries (#{@galleries.length}): </b>
|
17
|
+
= render 'wco/galleries/index', galleries: @galleries, config: { skip_tags: true }
|
15
18
|
%li.d-flex
|
16
19
|
<b>Reports (#{@reports.length}): </b>
|
17
20
|
= render 'wco/reports/list', reports: @reports, config: { skip_tags: true }
|
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_many', as: :update_galleries
|
14
15
|
resources :galleries do
|
15
16
|
post 'multiadd', :to => 'photos#j_create', :as => :multiadd
|
16
17
|
end
|
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.137
|
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
|