wco_models 3.1.0.140 → 3.1.0.142
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 +1 -0
- data/app/controllers/wco/galleries_controller.rb +1 -0
- data/app/controllers/wco/tags_controller.rb +22 -0
- data/app/helpers/wco/application_helper.rb +2 -2
- data/app/views/wco/_main_footer.haml +2 -1
- data/app/views/wco/_main_header.haml +1 -1
- data/app/views/wco/_select_all.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 +2 -5
- data/app/views/wco/galleries/show.haml +1 -1
- data/app/views/wco/tags/_list_mini.haml +18 -0
- data/app/views/wco_email/conversations/_table.haml +1 -1
- data/config/routes.rb +2 -0
- metadata +2 -4
- data/app/views/wco/galleries/_title.haml +0 -19
- data/app/views/wco/tags/_chips.haml +0 -6
- data/app/views/wco/tags/_index_inline.haml +0 -7
- data/app/views/wco/tags/_list_mini.haml +0 -1
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
|
@@ -37,8 +37,8 @@ module Wco::ApplicationHelper
|
|
37
37
|
end
|
38
38
|
def pp_money a; pp_amount a; end
|
39
39
|
def pp_currency a; pp_amount a; end
|
40
|
-
def pp_percent a
|
41
|
-
"#{(a*100).round(
|
40
|
+
def pp_percent a, config = { precision: 2}
|
41
|
+
"#{(a*100).round( config[:precision] )}%" rescue '@TODO'
|
42
42
|
end
|
43
43
|
|
44
44
|
end
|
@@ -29,6 +29,7 @@
|
|
29
29
|
.col-sm-4
|
30
30
|
= render '/wco/profiles/form_extra', profile: @current_profile
|
31
31
|
= link_to 'RTEditor', wco.application_tinymce_path, target: :_blank
|
32
|
+
= render 'wco/application/debug' if !Rails.env.production?
|
32
33
|
|
33
34
|
.c
|
34
|
-
|
35
|
+
|
@@ -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,16 +8,13 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
.galleries--index.maxwidth
|
11
|
-
= render '/wco/galleries/
|
11
|
+
= render '/wco/galleries/header_mini', galleries: galleries
|
12
12
|
|
13
13
|
.padded
|
14
14
|
- if galleries.length > 0
|
15
15
|
= form_tag update_galleries_path do
|
16
|
-
- @tags.each do |tag|
|
17
16
|
|
18
|
-
|
19
|
-
= check_box_tag 'tag_ids[]', tag.id
|
20
|
-
= tag
|
17
|
+
= render '/wco/tags/list_mini', tags: @tags
|
21
18
|
|
22
19
|
= submit_tag 'Add Tags', data: { confirm: 'Are you sure?' }
|
23
20
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
-# <b>Tags (#{tags.length}):</b>
|
4
|
+
-# - cache cache_key do
|
5
|
+
.Tags.chips.mb-2
|
6
|
+
- tags.each do |tag|
|
7
|
+
.Chip{ data: { tag: { id: tag.id.to_s } } }
|
8
|
+
- if !config&.without_checkbox
|
9
|
+
= check_box_tag 'tag_ids[]', tag.id
|
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?' }
|
18
|
+
|
@@ -40,7 +40,7 @@
|
|
40
40
|
-# = render '/wco_email/contexts/form_reply_mini', lead_id: msg.lead_id, message: msg, ctx: WcoEmail::Context.new({ from_email: msg.to&.downcase, subject: msg.subject, email_template_id: ET.find_by( slug: 'blank').id })
|
41
41
|
|
42
42
|
%td.tags.mini
|
43
|
-
= render '/wco/tags/
|
43
|
+
= render '/wco/tags/list_mini', tags: conv.tags, cache_key: conv.cache_key, config: OpenStruct.new( without_checkbox: true )
|
44
44
|
%td.latest-at
|
45
45
|
= pp_date conv.latest_at
|
46
46
|
= pp_time conv.latest_at
|
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
|
@@ -591,11 +591,9 @@ files:
|
|
591
591
|
- app/views/wco/sites/edit.haml
|
592
592
|
- app/views/wco/sites/index.haml
|
593
593
|
- app/views/wco/sites/new.haml
|
594
|
-
- app/views/wco/tags/_chips.haml
|
595
594
|
- app/views/wco/tags/_form.haml
|
596
595
|
- app/views/wco/tags/_header.haml
|
597
596
|
- app/views/wco/tags/_index.haml
|
598
|
-
- app/views/wco/tags/_index_inline.haml
|
599
597
|
- app/views/wco/tags/_list_mini.haml
|
600
598
|
- app/views/wco/tags/edit.haml
|
601
599
|
- app/views/wco/tags/index.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
|
@@ -1 +0,0 @@
|
|
1
|
-
app/views/wco/tags/_index_inline.haml
|