wco_models 3.1.0.141 → 3.1.0.142
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/controllers/wco/galleries_controller.rb +1 -0
- data/app/controllers/wco/tags_controller.rb +22 -0
- 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/show.haml +1 -1
- data/app/views/wco/tags/_list_mini.haml +7 -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: 416492ad97851c4301c4bf4554ad88bf6f98b0c98a87fa47666b6958c3bab337
|
4
|
+
data.tar.gz: 2288a79fef2d8c98e9bc9587e459515e802d2cf4e393976f9c810254cc0d0296
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08e838000f036f91ff65b33e261a5559000c5683c1ec246ab16011cbe85af8aa90491cc1654635ac2e288a47d3697ced7e52b2db95e0b581c53277f6ddd63745'
|
7
|
+
data.tar.gz: fb84b9bdbdae14145fee0f1773512019db8f73b1b9c0ebb02af6662c93502bf3b5607b8371f59ece21fff747a8b2d43230b82b8b61d59755ba6df784b618dae6
|
@@ -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
|
@@ -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
|
@@ -8,4 +8,11 @@
|
|
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
|
+
= form_tag add_tag_to_path( resource: resource.class, resource_id: resource.id ) do
|
16
|
+
= select_tag :id, options_for_select( @tags_list )
|
17
|
+
= submit_tag '+Tag', data: { confirm: 'Are you sure?' }
|
11
18
|
|
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.142
|
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
|