wco_models 3.1.0.136 → 3.1.0.138
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 +35 -24
- data/app/views/wco/galleries/_title.haml +3 -0
- data/app/views/wco/tags/_index.haml +2 -0
- data/app/views/wco/tags/_index_inline.haml +3 -6
- data/app/views/wco/tags/show.haml +14 -10
- data/config/routes.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3e838e33a3e54f52b163f095b863a44012af2ec7513051ac26fe82c3e4f3c37
|
4
|
+
data.tar.gz: 1d7c48e6a9436c5ac3bf025e0f7141d22ce8c1a4ba277106f98b71d7dba297b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d03a59c7062ca8a790cbadbafafb24222031ed8be426241a591b17c1efc5e3b36fe23487bccd13b12da7641ae79b694f6cea56ca28ddb597e6d7903b0f3d9710
|
7
|
+
data.tar.gz: 73fd509ce62de787ff5134a9ff541a7c97e3ade7dcc5a77147280ac0e56c1be176ef1dd05f4668dad7f266d28380cb088a2d2da31b1956f8754576b3f9995306
|
@@ -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 ],
|
@@ -8,37 +8,48 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
.galleries--index.maxwidth
|
11
|
-
= render 'header', galleries: galleries
|
11
|
+
= render '/wco/galleries/header', galleries: galleries
|
12
12
|
|
13
13
|
.padded
|
14
14
|
- if galleries.length > 0
|
15
|
-
- if galleries.respond_to? :total_pages
|
16
|
-
= paginate galleries, :param_name => :galleries_page, :views_prefix => 'wco'
|
17
|
-
|
18
15
|
= form_tag update_galleries_path do
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
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)
|
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?' }
|
38
27
|
|
39
28
|
- if galleries.respond_to? :total_pages
|
40
29
|
= paginate galleries, :param_name => :galleries_page, :views_prefix => 'wco'
|
41
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'
|
50
|
+
|
42
51
|
- else
|
43
|
-
|
52
|
+
.p No Galleries
|
53
|
+
|
54
|
+
|
44
55
|
|
@@ -6,6 +6,8 @@
|
|
6
6
|
= link_to '[~]', edit_tag_path(tag)
|
7
7
|
= link_to tag.slug, tag_path(tag)
|
8
8
|
<b>N headlines:</b> #{tag.headlines.length}
|
9
|
+
<b>N galleries:</b> #{tag.galleries.length}
|
9
10
|
<b>N reports:</b> #{tag.reports.length}
|
11
|
+
<b>N videos:</b> #{tag.videos.length}
|
10
12
|
<b>N stubs:</b> #{tag.message_stubs.length}
|
11
13
|
<b>N logs:</b> #{tag.logs.length}
|
@@ -1,21 +1,25 @@
|
|
1
1
|
|
2
|
-
.tags-show.
|
2
|
+
.tags-show.padded
|
3
3
|
|
4
4
|
%h5 Tag `#{@tag.slug}`
|
5
5
|
|
6
6
|
%ul
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
.
|
11
|
-
|
7
|
+
- if wco_email
|
8
|
+
%li.d-flex
|
9
|
+
<b>Conversations (#{@tag.conversations.length}): </b>
|
10
|
+
- if @tag.conversations.present?
|
11
|
+
.Conversations
|
12
|
+
= render '/wco_email/conversations/table', convs: @tag.conversations
|
13
|
+
%li.d-flex
|
14
|
+
<b>Message Stubs (#{@tag.message_stubs.length}): </b>
|
15
|
+
= render '/wco_email/message_stubs/index', stubs: @tag.message_stubs
|
16
|
+
|
12
17
|
%li.d-flex
|
13
18
|
<b>Headlines (#{@tag.headlines.length}): </b>
|
14
19
|
= render '/wco/headlines/index', headlines: @tag.headlines
|
20
|
+
%li.d-flex
|
21
|
+
<b>Galleries (#{@galleries.length}): </b>
|
22
|
+
= render 'wco/galleries/index', galleries: @galleries, config: { skip_tags: true }
|
15
23
|
%li.d-flex
|
16
24
|
<b>Reports (#{@reports.length}): </b>
|
17
25
|
= render 'wco/reports/list', reports: @reports, config: { skip_tags: true }
|
18
|
-
%li.d-flex
|
19
|
-
<b>Message Stubs (#{@tag.message_stubs.length}): </b>
|
20
|
-
= render '/wco_email/message_stubs/index', stubs: @tag.message_stubs
|
21
|
-
|
data/config/routes.rb
CHANGED
@@ -11,7 +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#
|
14
|
+
post 'galleries/update', to: 'galleries#update_many', as: :update_galleries
|
15
15
|
resources :galleries do
|
16
16
|
post 'multiadd', :to => 'photos#j_create', :as => :multiadd
|
17
17
|
end
|