ish_manager 0.1.8.419 → 0.1.8.421

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: 86d230d2dfd6f1b6973de7a7149f842fd60cbf22fecacf9b33f0189cdd2aa548
4
- data.tar.gz: 778d653ae2bddc09480bcdb76233e4faf917f0269b9c0c3ba496725a56676f1e
3
+ metadata.gz: 3ed09f47dd1da9f389ed8d851a0606dae2f4596f617066c8a8aea021c661dd59
4
+ data.tar.gz: 124439f5be8caf79bd98e022c65c190a4ac58f54fc597279120b18bb24cc5b31
5
5
  SHA512:
6
- metadata.gz: d4f17c27e7dd75e6718d1b84bcd5a54415ad94b8181db7d1916deeb3ff25f69429d800b580f97c6d9629f06f7749c8f83dabe1a3bba7a3fcc820b534b4a16f4a
7
- data.tar.gz: 0de72042c870fe8218fcc492d8b634a371dbe61396c1a2383c6dfcf63f86a69b2cdd516a1bf65e55774503bd2dac861f23f17c35b3a3da2521f0415d64455ce2
6
+ metadata.gz: c8f6cd77abbfce756e35bb9f918c071285828b43d17c0b176bab36438fa357f294e41b1e875e83accac69de0d767031b2034c2209534eac7c95e0d7bbf2e792d
7
+ data.tar.gz: 2c84c3cd1d4f4a1857e256b08d82d443725f0828de3b12a6f2d6c6f99724dcca2e3ea2949609343877ef9c3e80d6f7b3b23037417236cd6fc2acb605426e9e4f
@@ -1,17 +1,18 @@
1
1
 
2
2
  $(document).ready(() => {
3
3
 
4
- $("body.email_conversations-show a.preview").click(function(e) {
5
- // logg(e, 'clicked')
4
+ $("body.email_conversations-show .preview-btn").click(function(e) {
5
+ // logg($(this).data(), 'clicked')
6
6
 
7
- if ($(this).data('expanded')) {
8
- $(this).data('expanded', false)
9
- $(this).parent().find(".my-actions").addClass('hide')
10
- $(this).parent().find("iframe").css('display', 'none')
7
+ var msgId = $(this).data().msg.id
8
+ var msgC = $(`.msg-container[data-msg-id='${msgId}']`) // msgContainer
9
+
10
+ if ($(msgC).data('expanded')) {
11
+ $(msgC).data('expanded', false)
12
+ msgC.find(".to-expand").css('display', 'none')
11
13
  } else {
12
- $(this).data('expanded', true)
13
- $(this).parent().find(".my-actions").removeClass('hide')
14
- $(this).parent().find("iframe").css('display', 'block')
14
+ $(msgC).data('expanded', true)
15
+ msgC.find(".to-expand").css('display', 'block')
15
16
  }
16
17
 
17
18
  })
@@ -2,6 +2,7 @@
2
2
  * Alphabetized : )
3
3
  *
4
4
  *= require ish_manager/jquery-ui
5
+ *= require ish_manager/kaminari_pagination
5
6
  *= require_self
6
7
  *
7
8
  *= require ish_manager/email_contexts
@@ -86,10 +86,19 @@
86
86
  border-bottom: 1px solid yellow;
87
87
  margin-bottom: 0.2em;
88
88
 
89
- .expand {
90
- border: 1px solid red;
91
- max-height: 500px;
92
- overflow: auto;
89
+ // .expand {
90
+ // border: 1px solid red;
91
+ // max-height: 500px;
92
+ // overflow: auto;
93
+ // }
94
+
95
+ iframe {
96
+ border: 2px solid yellow;
97
+
98
+ width: 100%;
99
+ min-height: 500px;
100
+ height: 80vh;
101
+ // display: none;
93
102
  }
94
103
 
95
104
  .my-actions {
@@ -112,17 +121,9 @@
112
121
  justify-content: space-between;
113
122
  }
114
123
 
115
- .row-2 {
116
- iframe {
117
- border: 2px solid yellow;
118
-
119
- width: 100%;
120
- min-height: 500px;
121
- height: 80vh;
122
- display: none;
123
- }
124
+ .to-expand {
125
+ display: none;
124
126
  }
125
-
126
127
  }
127
128
  }
128
129
 
@@ -0,0 +1,40 @@
1
+
2
+ .pagination a, .pagination span.current, .pagination span.gap {
3
+ float: left;
4
+ padding: 0 14px;
5
+ line-height: 38px;
6
+ text-decoration: none;
7
+ background-color: white;
8
+ border: 1px solid #DDD;
9
+ border-left-width: 0;
10
+ }
11
+
12
+ .pagination {
13
+ border-left: 1px solid #ddd;
14
+ .first{
15
+ padding : 0;
16
+ float: none;
17
+ border: none;
18
+ }
19
+ .prev {
20
+ padding : 0;
21
+ float: none;
22
+ border: none;
23
+ }
24
+ .page{
25
+ padding : 0;
26
+ float: none;
27
+ border: none;
28
+ }
29
+ .next{
30
+ padding : 0;
31
+ float: none;
32
+ border: none;
33
+ }
34
+ .last{
35
+ padding : 0;
36
+ float: none;
37
+ border: none;
38
+ }
39
+ }
40
+
@@ -1,4 +1,8 @@
1
1
 
2
+ .doc {
3
+ max-width: 555px;
4
+ }
5
+
2
6
  .manager-leads-index {
3
7
  th.company-url {
4
8
  width: 10px;
@@ -10,5 +10,11 @@ class ::IshManager::CategoriesController < IshManager::ApplicationController
10
10
  @tags = Category.all_tags
11
11
  end
12
12
 
13
+ def show
14
+ @category = WpTag.find params[:id]
15
+ authorize! :show, @category
16
+
17
+ end
18
+
13
19
  end
14
20
 
@@ -20,7 +20,7 @@ class IshManager::EventsController < ::IshManager::ApplicationController
20
20
 
21
21
  def index
22
22
  authorize! :manage, Ish::Event
23
- @events = Ish::Event.all
23
+ @events = Ish::Event.all.order_by({ start_at: :desc })
24
24
  if params[:q]
25
25
  @events = @events.where({ :name => /#{params[:q]}/i })
26
26
  end
@@ -51,65 +51,37 @@ class ::IshManager::LeadsController < IshManager::ApplicationController
51
51
  authorize! :edit, @lead
52
52
  end
53
53
 
54
- ## 0 1 2 3 4 5 6 7
55
- ## Fields: id, date, name, email, tag, phone, linkedin, comment
56
54
  def import
57
55
  authorize! :import, ::Lead
58
56
  file = params[:csv_file]
59
- flags = []
60
- errors = []
61
- CSV.read(file.path, headers: true).each do |row|
62
-
63
- leadset = ::Leadset.find_or_create_by({ company_url: row[3].split('@')[1] })
64
- lead = ::Lead.new({
65
- name: row[2].presence || row[3].split('@')[0],
66
- full_name: row[2].presence || row[3].split('@')[0],
67
- email: row[3],
68
- m3_leadset_id: leadset.id,
69
- phone: row[5],
70
- })
71
- flag = lead.save
72
- flags << flag
73
- if !flag
74
- errors << lead.errors.full_messages.join(", ")
75
- end
76
57
 
77
- if row[4].present?
78
- tags = row[4].split(",").map do |tag_name|
79
- WpTag.my_find_or_create({ name: tag_name })
80
- end
81
- puts! tags, 'tags'
82
- tags.each do |tag|
83
- LeadTag.create({ wp_tag: tag, lead: lead })
84
- end
85
- end
58
+ ## 2023-04-08
59
+ flags = Lead.import_v1( file )
86
60
 
87
- end
88
61
  flash[:notice] = "Result: #{flags.inspect}."
89
- flash[:alert] = errors
90
62
  redirect_to action: 'new'
91
63
  end
92
64
 
93
65
  def index
94
66
  authorize! :index, ::Lead
95
- @leads = ::Lead.kept.includes( :company )
96
- lead_emails = @leads.map( &:email ).compact.reject(&:empty?)
97
-
98
- map = %Q{
99
- function() {
100
- emit(this.to_email, {count: 1})
101
- }
102
- }
103
- reduce = %Q{
104
- function(key, values) {
105
- var result = {count: 0};
106
- values.forEach(function(value) {
107
- result.count += value.count;
108
- });
109
- return result;
110
- }
111
- }
67
+ @leads = ::Lead.kept.includes( :company ).page( params[:leads_page ] ).per( current_profile.per_page )
68
+
112
69
  @email_contexts = {}
70
+ # lead_emails = @leads.map( &:email ).compact.reject(&:empty?)
71
+ # map = %Q{
72
+ # function() {
73
+ # emit(this.to_email, {count: 1})
74
+ # }
75
+ # }
76
+ # reduce = %Q{
77
+ # function(key, values) {
78
+ # var result = {count: 0};
79
+ # values.forEach(function(value) {
80
+ # result.count += value.count;
81
+ # });
82
+ # return result;
83
+ # }
84
+ # }
113
85
  # tmp_contexts = Ish::EmailContext.all.where( :to_email.in => lead_emails
114
86
  # ).map_reduce( map, reduce
115
87
  # ).out( inline: 1 ## From: https://www.mongodb.com/docs/mongoid/current/reference/map-reduce/
@@ -13,10 +13,12 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
13
13
  authorize! :create_newsitem, @resource
14
14
 
15
15
  if params[:photo]
16
- photo = Photo.create( :photo => params[:photo],
17
- :user_profile => @current_profile,
18
- descr: params[:descr],
19
- subhead: params[:subhead] )
16
+ photo = Photo.create({
17
+ descr: params[:descr],
18
+ photo: params[:photo],
19
+ subhead: params[:subhead],
20
+ user_profile: @current_profile,
21
+ })
20
22
  @newsitem.photo = photo
21
23
  end
22
24
 
@@ -8,7 +8,7 @@
8
8
  Account & Session
9
9
  .a
10
10
  .row
11
- .col-sm-6
11
+ .col-sm-4
12
12
  %ul
13
13
  %li <b>Email:</b> #{@current_profile.email}
14
14
  %li <b>Role name:</b> #{@current_profile.role_name}
@@ -21,8 +21,13 @@
21
21
  %li= Time.now.to_s
22
22
  -# <pre>#{@changelog}</pre>
23
23
 
24
- .col-sm-2
25
- = button_to 'Logout', main_app.destroy_user_session_path, :method => :delete
24
+ .col-sm-4
25
+ = button_to 'Logout', main_app.destroy_user_session_path, :method => :delete, data: { confirm: 'Are you sure?' }
26
+ = form_for @current_profile, url: profile_path(@current_profile), as: :profile do |f|
27
+ .flex-row
28
+ = f.label :per_page
29
+ = f.select :per_page, options_for_select([ 10, 25, 50, 100, 250, 500, 1000], selected: @current_profile.per_page)
30
+ = f.submit 'Go'
26
31
 
27
32
  .c
28
33
  = render 'debug' if !Rails.env.production?
@@ -18,7 +18,7 @@
18
18
  = text_field_tag :q
19
19
  = link_to '[+]', new_report_path
20
20
  %li
21
- = link_to 'Videos', videos_path
21
+ = link_to "Videos (#{Video.all.length})", videos_path
22
22
  .inline-search
23
23
  = form_tag videos_path, method: :get do
24
24
  = text_field_tag :q
@@ -33,7 +33,7 @@
33
33
  = text_field_tag :q
34
34
 
35
35
  %li
36
- = link_to 'Locations', maps_path
36
+ = link_to "Locations (#{Location.all.length})", maps_path
37
37
  .inline-search
38
38
  = form_tag maps_path, method: :get do
39
39
  = text_field_tag :q
@@ -1,8 +1,8 @@
1
1
 
2
2
  -## provides local vars: subtree, config
3
3
 
4
- - puts! config, 'config'
5
- - puts! subtree, 'subtree'
4
+ -# - puts! config, 'config'
5
+ -# - puts! subtree, 'subtree'
6
6
 
7
7
  %ul
8
8
  - subtree.select { |c| c[5] == config[:parent_id] }.each do |c|
@@ -9,4 +9,7 @@
9
9
  %h1 Tags
10
10
  %ul
11
11
  - @tags.each do |tag|
12
- %li= tag[:name]
12
+ %li
13
+ = tag[:taxonomy]
14
+ \::
15
+ = link_to tag[:name], category_path( tag[:id] )
@@ -0,0 +1,10 @@
1
+
2
+ .categories-show.max-width
3
+ .header
4
+ %h2.title Category/Tag `#{@category.slug}`
5
+
6
+ .leads
7
+ %h3 Leads (#{@category.leads.length})
8
+ %ol
9
+ - @category.leads.each do |lead|
10
+ %li= link_to lead.email, lead_path(lead)
@@ -23,24 +23,21 @@
23
23
  - @email_messages.each do |msg|
24
24
  - lead = msg.lead || Lead.new(email: 'NO LEAD!', id: 'no lead')
25
25
 
26
- .item
26
+ .item.msg-container{ data: { msg: { id: msg.id } } }
27
27
  .row-1
28
28
  .gray
29
29
  %ul
30
30
  %li
31
31
  = msg.id
32
32
  <b>To:</b> #{msg.to}
33
- %li
34
- <b>From:</b>
35
- -# #{msg.from}
36
- = lead.email
37
- %a.chip{ href: email_contexts_for_lead_path( lead ) }
33
+ <b>From:</b> #{lead.email}
34
+ = link_to email_contexts_for_lead_path( lead ) do
38
35
  \(
39
36
  = lead.email_contexts.count
40
37
  %i.fa.fa-envelope
41
38
  \)
42
39
  .relative.inline-block
43
- %i.fa.fa-clock-o.expand-next
40
+ %i.fa.fa-clock-o.expand-next{ style: "color: red;" }
44
41
  .expand-hide= render 'ish_manager/scheduled_email_actions/form', scheduled_email_action: Sch.new({ lead_id: lead.id })
45
42
 
46
43
  .datetime
@@ -48,11 +45,23 @@
48
45
  .time= msg.date&.strftime('%l:%M%P')
49
46
 
50
47
  .row-2
48
+ .flexy
49
+ = link_to "Expand w/img", ishapi.email_message_path(msg, jwt_token: @jwt_token, load_images: true ), target: msg.message_id, class: 'preview-btn', data: { msg: { id: msg.id.to_s } }
50
+ \- or -
51
+ = link_to "Expand", ishapi.email_message_path(msg, jwt_token: @jwt_token ), target: msg.message_id, class: 'preview-btn', data: { msg: { id: msg.id.to_s } }
52
+ = msg.preview_str
53
+
54
+ .to-expand
55
+
56
+ - if msg.attachments.present?
57
+ .attachments
58
+ - msg.attachments.map do |att|
59
+ .item
60
+ %h5= att.photo.original_filename
61
+ = image_tag att.photo.url(:original)
51
62
 
52
- = link_to "Expand: #{msg.preview_str}", ishapi.email_message_path(msg, jwt_token: @jwt_token ), target: msg.message_id, class: 'preview'
53
- %iframe{ name: msg.message_id }
63
+ %iframe{ name: msg.message_id }
54
64
 
55
- .my-actions.hide
56
65
  = render 'ish_manager/email_contexts/form_reply', lead: lead
57
66
  .bordered-card
58
67
  = render 'ish_manager/email_contexts/form', ctx: Ctx.new({ lead_id: lead.id, email_template: Tmpl.blank_template, from_email: msg.to, subject: msg.subject, body: (msg.part_html||msg.part_txt) }), lead: lead
@@ -1,12 +1,10 @@
1
1
 
2
2
  .galleries--menu
3
3
 
4
- = link_to 'Galleries', galleries_path
5
- - if defined?(count)
6
- (#{count})
4
+ = link_to "Galleries (#{Gallery.all.length})", galleries_path
7
5
 
8
6
  .inline-search
9
7
  = form_tag galleries_path, method: :get do
10
8
  = text_field_tag :q
11
9
 
12
- = link_to '[+]', new_gallery_path
10
+ = link_to '[+]', new_gallery_path
@@ -1,11 +1,11 @@
1
1
 
2
- = form_tag leads_import_path, multipart: true do
3
- .doc
4
- %ul
5
- %li Fields: id, date, name, email, tag, phone, linkedin, comment
6
- .field
7
- %label File
8
- = file_field_tag :csv_file
2
+ .Card
3
+ = form_tag leads_import_path, multipart: true do
4
+ .doc
5
+ %pre= Lead.import_v1_fields
6
+ .field
7
+ %label File
8
+ = file_field_tag :csv_file
9
9
 
10
- .actions
11
- = submit_tag 'Submit'
10
+ .actions
11
+ = submit_tag 'Submit'
@@ -1,22 +1,23 @@
1
1
 
2
- .leads-index
2
+ .leads-index.padded
3
3
  .header
4
4
  %h2.title
5
5
  #{link_to 'Kept Leads', leads_path} (#{::Lead.kept.count}, #{::Lead.all.count})
6
6
  = link_to raw("<i class='fa fa-plus-square'></i>"), new_lead_path
7
7
 
8
+ = paginate @leads, param_name: :leads_page
8
9
  = form_tag leads_bulkop_path do
9
10
  = label_tag 'Act on Selected:'
10
11
  = select_tag :op, options_for_select( [[nil,nil]] + Lead::OPS )
11
12
  = select_tag :email_campaign_id, options_for_select( @email_campaigns_list )
12
13
  = submit_tag 'Go'
13
14
 
14
- %table.bordered.data-table
15
+ %table.bordered
15
16
  %thead
16
17
  %tr
17
18
  %th &nbsp;
18
19
  %th Name/Email
19
- %th Company
20
+ %th.company Company
20
21
  %th Phone
21
22
  %th Tag
22
23
  %th created_at
@@ -28,7 +29,10 @@
28
29
  %tr
29
30
  %td= check_box_tag 'lead_ids[]', lead.id
30
31
  %td= link_to "#{lead.name} <#{lead.email}>", lead_path( lead )
31
- %td= lead.company.company_url
32
+ %td.company
33
+ = lead.company.company_url
34
+ - if lead.company.name.present?
35
+ <br /><b>#{lead.company.name}</b>
32
36
  %td= lead.phone
33
37
  %td= lead.wp_tags.map(&:name).join(", ")
34
38
  %td= lead.created_at.to_s[0..10]
@@ -42,7 +46,8 @@
42
46
  -# %li
43
47
  -# = link_to sch_a.email_action.slug, edit_scheduled_email_action_path( sch_a )
44
48
  -# [x]
45
-
49
+ .c
50
+ = paginate @leads, param_name: :leads_page
46
51
 
47
52
 
48
53
 
@@ -2,8 +2,6 @@
2
2
  .photos-meta.row
3
3
  .meta
4
4
  On #{ pretty_date photo.created_at }
5
- -# - unless photo.user.blank?
6
- -# By #{ link_to photo.user.username, user_path(photo.user.username) }
7
5
  - unless photo.gallery.blank?
8
6
  In #{ link_to photo.gallery.name, gallery_path(photo.gallery.slug, 0) }
9
7
  = photo.name unless photo.name.blank?
@@ -1,2 +1,6 @@
1
1
 
2
- = image_tag @photo.photo.url( :small )
2
+ .photos-show.padded
3
+ .header
4
+ %h5.title= @photo.photo.original_filename
5
+
6
+ = image_tag @photo.photo.url( :original )
data/config/routes.rb CHANGED
@@ -3,7 +3,8 @@ IshManager::Engine.routes.draw do
3
3
 
4
4
  root :to => 'application#home'
5
5
 
6
- get 'categories', to: 'categories#index'
6
+ # get 'categories', to: 'categories#index'
7
+ resources :categories
7
8
 
8
9
  resources 'events'
9
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.419
4
+ version: 0.1.8.421
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-07 00:00:00.000000000 Z
11
+ date: 2023-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -271,6 +271,7 @@ files:
271
271
  - app/assets/stylesheets/ish_manager/galleries.scss
272
272
  - app/assets/stylesheets/ish_manager/iro.scss
273
273
  - app/assets/stylesheets/ish_manager/jquery-ui.css
274
+ - app/assets/stylesheets/ish_manager/kaminari_pagination.scss
274
275
  - app/assets/stylesheets/ish_manager/leads_leadsets.scss
275
276
  - app/assets/stylesheets/ish_manager/maps.scss
276
277
  - app/assets/stylesheets/ish_manager/markers.scss
@@ -377,6 +378,7 @@ files:
377
378
  - app/views/ish_manager/application_mailer/welcome.html.erb
378
379
  - app/views/ish_manager/categories/_subtree.haml
379
380
  - app/views/ish_manager/categories/index.haml
381
+ - app/views/ish_manager/categories/show.haml
380
382
  - app/views/ish_manager/email_actions/_form.haml
381
383
  - app/views/ish_manager/email_actions/edit.haml
382
384
  - app/views/ish_manager/email_actions/index.haml