wco_models 3.1.0.141 → 3.1.0.143
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/wco/galleries_controller.rb +2 -1
- data/app/controllers/wco/tags_controller.rb +23 -1
- data/app/models/wco/tag.rb +1 -1
- data/app/views/wco/_main_header.haml +1 -1
- data/app/views/wco/galleries/_header.haml +20 -6
- data/app/views/wco/galleries/_header_mini.haml +8 -0
- data/app/views/wco/galleries/_index.haml +1 -1
- data/app/views/wco/galleries/edit.haml +1 -1
- data/app/views/wco/galleries/show.haml +1 -1
- data/app/views/wco/tags/_list_mini.haml +8 -0
- data/config/routes.rb +2 -0
- metadata +2 -2
- data/app/views/wco/galleries/_title.haml +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dcd0e6443ef46946446ff666738bc396e56de3ec322efbdb6883bae10a5300a
|
4
|
+
data.tar.gz: c952c2ce1d2e7d4b01e4253e207b779196753cc343f8edeecbfd3ba5c42fabb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 218c4d18150413167875616b4e9b4af5158e7b13d4e41813e02f9521bdde33a1d42e81f0b801555cddf6c8ec7812a8ac80495d34f134cbc164a39bdac3734a0f
|
7
|
+
data.tar.gz: acc8fe29b0fd09af799db9adeb5ec376c866f5d4a41b760c5191441240872f7a23343de78dd02d2ed050bd86a3b8c7194752e692089bcf971ba3924e9768ad0b
|
@@ -44,7 +44,7 @@ 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
|
47
|
+
@tags = Wco::Tag.all.order_by( slug: :asc )
|
48
48
|
|
49
49
|
if params[:q]
|
50
50
|
q = URI.decode(params[:q])
|
@@ -170,6 +170,7 @@ class Wco::GalleriesController < Wco::ApplicationController
|
|
170
170
|
|
171
171
|
def set_lists
|
172
172
|
@galleries_list = Wco::Gallery.list
|
173
|
+
@tags_list = Wco::Tag.list
|
173
174
|
end
|
174
175
|
|
175
176
|
end
|
@@ -40,6 +40,28 @@ class Wco::TagsController < Wco::ApplicationController
|
|
40
40
|
@new_tag = Wco::Tag.new
|
41
41
|
end
|
42
42
|
|
43
|
+
def add_to
|
44
|
+
@tag = Wco::Tag.find params[:id]
|
45
|
+
resource = params[:resource].constantize.find params[:resource_id]
|
46
|
+
authorize! :update, @tag
|
47
|
+
|
48
|
+
resource.tags.push @tag
|
49
|
+
flag = resource.save
|
50
|
+
flash_notice 'maybe?'
|
51
|
+
redirect_to request.referrer
|
52
|
+
end
|
53
|
+
|
54
|
+
def remove_from
|
55
|
+
@tag = Wco::Tag.find params[:id]
|
56
|
+
resource = params[:resource].constantize.find params[:resource_id]
|
57
|
+
authorize! :update, @tag
|
58
|
+
|
59
|
+
resource.tags.delete @tag
|
60
|
+
flag = resource.save
|
61
|
+
flash_notice 'maybe?'
|
62
|
+
redirect_to request.referrer
|
63
|
+
end
|
64
|
+
|
43
65
|
def show
|
44
66
|
@tag = Wco::Tag.find params[:id]
|
45
67
|
authorize! :show, @tag
|
@@ -69,7 +91,7 @@ class Wco::TagsController < Wco::ApplicationController
|
|
69
91
|
private
|
70
92
|
|
71
93
|
def set_lists
|
72
|
-
@tags = Wco::Tag.all
|
94
|
+
@tags = Wco::Tag.all.order_by( slug: :asc )
|
73
95
|
end
|
74
96
|
|
75
97
|
|
data/app/models/wco/tag.rb
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
%li= render '/wco/sites/header'
|
34
34
|
%li= render '/wco/headlines/header'
|
35
35
|
%li= render '/wco/publishers/header'
|
36
|
-
%li= render '/wco/galleries/
|
36
|
+
%li= render '/wco/galleries/header_mini'
|
37
37
|
%li= render '/wco/reports/header'
|
38
38
|
%li= render '/wco/videos/header'
|
39
39
|
|
@@ -1,8 +1,22 @@
|
|
1
1
|
|
2
|
-
|
2
|
+
.galleries--header
|
3
|
+
%h2.title
|
4
|
+
Gallery
|
5
|
+
= link_to gallery.name, gallery_path(gallery)
|
6
|
+
(#{gallery.photos.length})
|
7
|
+
= link_to '[~]', edit_gallery_path( gallery )
|
8
|
+
.d-inline-block= button_to 'x', gallery_path(gallery), method: :delete, data: { confirm: 'Are you sure?' }
|
9
|
+
- if gallery.is_public
|
10
|
+
%i.material-icons visibility
|
11
|
+
- else
|
12
|
+
%i.material-icons visibility_off
|
13
|
+
= render 'meta', :item => gallery
|
14
|
+
|
15
|
+
= render '/wco/tags/list_mini', tags: gallery.tags, resource: gallery
|
16
|
+
|
17
|
+
%ul
|
18
|
+
%li slug :: #{gallery.slug}
|
19
|
+
%li subhead :: #{gallery.subhead}
|
20
|
+
%li deleted_at ::#{gallery.deleted_at}
|
21
|
+
|
3
22
|
|
4
|
-
= link_to "Galleries (#{galleries.length})", wco.galleries_path
|
5
|
-
.d-inline-block
|
6
|
-
= form_tag wco.galleries_path, method: :get do
|
7
|
-
= text_field_tag :q
|
8
|
-
= link_to '[+]', wco.new_gallery_path
|
@@ -1,6 +1,6 @@
|
|
1
1
|
|
2
2
|
.galleries-edit.maxwidth
|
3
|
-
= render '
|
3
|
+
= render 'header_mini', gallery: @gallery
|
4
4
|
= render 'form', gallery: @gallery, :url => gallery_path( @gallery )
|
5
5
|
= render 'thumbs', gallery: @gallery
|
6
6
|
= render 'wco/photos/multinew', gallery: @gallery
|
@@ -8,4 +8,12 @@
|
|
8
8
|
- if !config&.without_checkbox
|
9
9
|
= check_box_tag 'tag_ids[]', tag.id
|
10
10
|
= link_to tag.slug, wco.tag_path( tag )
|
11
|
+
- if defined? resource
|
12
|
+
.mini.d-inline-block= button_to 'x', remove_tag_from_path(id: tag.id, resource: resource.class, resource_id: resource.id, ), method: 'delete', data: { confirm: 'Are you sure?' }
|
13
|
+
|
14
|
+
- if defined? resource
|
15
|
+
.d-inline-block
|
16
|
+
= form_tag add_tag_to_path( resource: resource.class, resource_id: resource.id ) do
|
17
|
+
.d-inline-block= select_tag :id, options_for_select( @tags_list ), class: 'select2'
|
18
|
+
= submit_tag '+Tag', data: { confirm: 'Are you sure?' }
|
11
19
|
|
data/config/routes.rb
CHANGED
@@ -56,6 +56,8 @@ Wco::Engine.routes.draw do
|
|
56
56
|
resources :sites
|
57
57
|
resources :subscriptions
|
58
58
|
|
59
|
+
delete 'tags/remove/:id/from/:resource/:resource_id', to: 'tags#remove_from', as: :remove_tag_from
|
60
|
+
post 'tags/add-to/:resource/:resource_id', to: 'tags#add_to', as: :add_tag_to
|
59
61
|
resources :tags
|
60
62
|
|
61
63
|
## In order to have unsubscribes_url , unsubscribes must be in wco .
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.143
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Pudeyev
|
@@ -492,10 +492,10 @@ files:
|
|
492
492
|
- app/views/wco/application/tinymce.html.erb
|
493
493
|
- app/views/wco/galleries/_form.haml
|
494
494
|
- app/views/wco/galleries/_header.haml
|
495
|
+
- app/views/wco/galleries/_header_mini.haml
|
495
496
|
- app/views/wco/galleries/_index.haml
|
496
497
|
- app/views/wco/galleries/_menu_secondary.haml
|
497
498
|
- app/views/wco/galleries/_thumbs.haml
|
498
|
-
- app/views/wco/galleries/_title.haml
|
499
499
|
- app/views/wco/galleries/edit.haml
|
500
500
|
- app/views/wco/galleries/new.haml
|
501
501
|
- app/views/wco/galleries/show.haml
|
@@ -1,19 +0,0 @@
|
|
1
|
-
|
2
|
-
.galleries--title
|
3
|
-
%h2
|
4
|
-
Gallery
|
5
|
-
= link_to gallery.name, gallery_path(gallery)
|
6
|
-
(#{gallery.photos.length})
|
7
|
-
= link_to '[~]', edit_gallery_path( gallery )
|
8
|
-
.d-inline-block= button_to 'x', gallery_path(gallery), method: :delete, data: { confirm: 'Are you sure?' }
|
9
|
-
- if gallery.is_public
|
10
|
-
%i.material-icons visibility
|
11
|
-
- else
|
12
|
-
%i.material-icons visibility_off
|
13
|
-
|
14
|
-
= render '/wco/tags/list_mini', tags: gallery.tags
|
15
|
-
|
16
|
-
%ul
|
17
|
-
%li slug :: #{gallery.slug}
|
18
|
-
%li subhead :: #{gallery.subhead}
|
19
|
-
%li= render 'meta', :item => gallery
|