wco_models 3.1.0.139 → 3.1.0.141

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a64374478e9a1c58e378547c1fa1a7035406511d6d45ce93e06d34654dbf4673
4
- data.tar.gz: 466e2ce411c6f38b086bbe1ac4aeeee98767372514879020797ca02516bf42dc
3
+ metadata.gz: 0ba532da884be707b7fac5365a23c346df65965efa7a6b53a16d50d73f7fe476
4
+ data.tar.gz: 50f746e36a2a6c4cb6cf1526905027d60169c394e8bb9c95f496d836e3059667
5
5
  SHA512:
6
- metadata.gz: d0986f1fc0667d3ff571cc294cc9f7f79a92a9ffe1457ffb66892235f37810022b04a8204ddd12613f983a7a4a574c331dddf28f68258eefb1f761c3cde4fb45
7
- data.tar.gz: 5048ad4c1e94533a0e05034c19391bf0c73bfbc7dfbf4ad5421921cac54749c010ec204a877678de15fda74bfeab3dd2959ba53283f83ca9befb602c4a666f44
6
+ metadata.gz: dbc25645c7e5ee4e3749a4ea996461d0fd4a8d7a66710660b487e84819b506abece3a0545d8b7e27303b69656115a30e1ca46b6c542bf114fc969ff325ee9016
7
+ data.tar.gz: 214a60d7d891227dbcfd6442e34fb19651e09c272ebfda3d5867e388c7fda7f01d4e557dba6599571623411f7c00a603fdb4c64bb0a272cadcc7c341c8584ccf
@@ -63,6 +63,25 @@ if ($(".tinymce").length > 0) {
63
63
  $(".tinymce").summernote()
64
64
  }
65
65
 
66
+ /*
67
+ * select_all
68
+ * _vp_ 2023-02-28
69
+ **/
70
+ $("input[type='checkbox'].i-sel").change((ev) => {
71
+ $( $(".n-selected")[0] ).html( $("input[type='checkbox'].i-sel:checked").length )
72
+ })
73
+ $("input#select_all[type='checkbox']").change((e) => {
74
+ const count = $("input[type='checkbox'].i-sel:checked").length
75
+ const new_state = count ? false : true // all will be checked?
76
+
77
+ $(".select-all input[type='checkbox']").prop('checked', new_state)
78
+
79
+ $( $("input[type='checkbox'].i-sel") ).each( i => {
80
+ $( $("input[type='checkbox'].i-sel")[i] ).prop('checked', new_state)
81
+ })
82
+
83
+ $( $(".n-selected")[0] ).html( $("input[type='checkbox'].i-sel:checked").length )
84
+ })
66
85
 
67
86
 
68
87
 
@@ -15,6 +15,7 @@
15
15
  display: inline-block;
16
16
 
17
17
  height: 32px;
18
+ line-height: 32px;
18
19
 
19
20
  margin-right: 32px;
20
21
  margin-bottom: 0.3em;
@@ -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(2)}%"
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
- = render 'wco/application/debug' if !Rails.env.production?
35
+
@@ -0,0 +1,5 @@
1
+
2
+ .d-flex
3
+ .label.mini All
4
+ = check_box_tag :select_all
5
+ .n-selected -
@@ -13,11 +13,8 @@
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
- .Chip
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
    
@@ -28,25 +25,27 @@
28
25
  - if galleries.respond_to? :total_pages
29
26
  = paginate galleries, :param_name => :galleries_page, :views_prefix => 'wco'
30
27
 
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'
28
+ = render '/wco/select_all'
29
+
30
+ .row
31
+ - galleries.each do |g|
32
+ .col-sm-12.col-md-6
33
+ .Card
34
+ %h5
35
+ = check_box_tag 'gallery_ids[]', g.id, nil, { class: 'i-sel' }
36
+ = link_to '[~]', edit_gallery_path( g )
37
+ = link_to g.name, gallery_path(g.slug)
38
+ (#{g.photos.length})
39
+ = render 'meta', item: g
40
+ - if g.photos.length == 0
41
+ No Photos
42
+ - else
43
+ .d-flex.flex-wrap.photos-thumbs
44
+ - g.photos.limit( @current_profile.show_n_thumbs ).each do |photo|
45
+ = link_to image_tag(photo.photo.url(:thumb), :alt => ''), gallery_path(g.slug)
46
+
47
+ - if galleries.respond_to? :total_pages
48
+ = paginate galleries, :param_name => :galleries_page, :views_prefix => 'wco'
50
49
 
51
50
  - else
52
51
  .p No Galleries
@@ -0,0 +1,11 @@
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
+
@@ -3,9 +3,7 @@
3
3
  %table.bordered.data-table
4
4
  %thead
5
5
  %th.select-all.nosort
6
- .a
7
- = check_box_tag :select_all
8
- .n-selected -
6
+ = render '/wco/select_all'
9
7
  %th.leads leads
10
8
  %th.subject subject, preview
11
9
  %th.tags Tags
@@ -42,7 +40,7 @@
42
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 })
43
41
 
44
42
  %td.tags.mini
45
- = render '/wco/tags/chips', tags: conv.tags, cache_key: conv.cache_key
43
+ = render '/wco/tags/list_mini', tags: conv.tags, cache_key: conv.cache_key, config: OpenStruct.new( without_checkbox: true )
46
44
  %td.latest-at
47
45
  = pp_date conv.latest_at
48
46
  = pp_time conv.latest_at
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.139
4
+ version: 3.1.0.141
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev
@@ -482,6 +482,7 @@ files:
482
482
  - app/views/wco/_main_header.haml
483
483
  - app/views/wco/_paginate.haml
484
484
  - app/views/wco/_search.haml
485
+ - app/views/wco/_select_all.haml
485
486
  - app/views/wco/api/leads/index_hash.jbuilder
486
487
  - app/views/wco/application/_auth_widget.haml
487
488
  - app/views/wco/application/_debug.haml
@@ -590,11 +591,9 @@ files:
590
591
  - app/views/wco/sites/edit.haml
591
592
  - app/views/wco/sites/index.haml
592
593
  - app/views/wco/sites/new.haml
593
- - app/views/wco/tags/_chips.haml
594
594
  - app/views/wco/tags/_form.haml
595
595
  - app/views/wco/tags/_header.haml
596
596
  - app/views/wco/tags/_index.haml
597
- - app/views/wco/tags/_index_inline.haml
598
597
  - app/views/wco/tags/_list_mini.haml
599
598
  - app/views/wco/tags/edit.haml
600
599
  - app/views/wco/tags/index.haml
@@ -1,6 +0,0 @@
1
-
2
- - cache cache_key do
3
- .tags--chips
4
- - tags.each do |tag|
5
- .mb-1
6
- .Chip{ data: { tag: { id: tag.id.to_s } } }= tag.slug
@@ -1,7 +0,0 @@
1
-
2
-
3
- .Tags.chips.mb-2
4
- <b>Tags (#{tags.length}):</b>
5
- - tags.each_with_index do |tag, idx|
6
- .Chip
7
- = link_to tag.slug, wco.tag_path(tag)
@@ -1 +0,0 @@
1
- app/views/wco/tags/_index_inline.haml