ish_manager 0.1.8.376 → 0.1.8.378
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/assets/stylesheets/ish_manager/application.scss +8 -0
- data/app/assets/stylesheets/ish_manager/email.scss +2 -0
- data/app/controllers/ish_manager/application_controller.rb +2 -0
- data/app/controllers/ish_manager/iro_purses_controller.rb +12 -0
- data/app/controllers/ish_manager/scheduled_email_actions_controller.rb +18 -1
- data/app/views/ish_manager/application/_main_header_admin.haml +17 -13
- data/app/views/ish_manager/email_actions/_form.haml +11 -7
- data/app/views/ish_manager/email_actions/edit.haml +1 -1
- data/app/views/ish_manager/email_contexts/index.haml +8 -4
- data/app/views/ish_manager/email_templates/_form.haml +0 -4
- data/app/views/ish_manager/email_templates/_index.haml +4 -11
- data/app/views/ish_manager/email_templates/new.haml +4 -3
- data/app/views/ish_manager/iro_purses/my.haml +11 -0
- data/app/views/ish_manager/scheduled_email_actions/_form.haml +1 -1
- data/app/views/ish_manager/scheduled_email_actions/index.haml +8 -3
- data/config/routes.rb +5 -9
- data/lib/tasks/office_tasks.rake +37 -1
- metadata +5 -3
- /data/lib/{tasks/done → tasks-done}/migrate.rake +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72d1d8103d7dde529e81e9074568b647db2b98bd9d1c6019664c417837243b15
|
4
|
+
data.tar.gz: 82c682267071f417b7f908ade31ae60a6139a7dfdd3794aedc9580fe7fe2abc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80b6707997cda1e32efa5e2bee8776f77b5823f6e761fee72e8ffdbd2d0ddc7ac6b0a732a5f3a6fe7314a8664f059378f4bb7384fbe3dcf2dcfa631503203669
|
7
|
+
data.tar.gz: f923c98b7eaf195c22da13c9761b45af889844b049b5eda104db927275f5f3fe5c97ff2c76686d93b42bc479cd3a570d7d577f19851ffa335e3407097579a123
|
@@ -4,10 +4,12 @@
|
|
4
4
|
.email-actions-index,
|
5
5
|
.email-filters-index,
|
6
6
|
.email-templates-edit,
|
7
|
+
.email-templates-new,
|
7
8
|
.email-templates-show,
|
8
9
|
.email-contexts-edit,
|
9
10
|
.email-contexts-show,
|
10
11
|
.emails-ns, // emails namespace
|
12
|
+
.iro-purses-my,
|
11
13
|
.leads-edit,
|
12
14
|
.leads-index,
|
13
15
|
.leads-show,
|
@@ -9,6 +9,8 @@ module IshManager
|
|
9
9
|
check_authorization
|
10
10
|
rescue_from ::CanCan::AccessDenied, :with => :access_denied
|
11
11
|
|
12
|
+
http_basic_authenticate_with :name => BASIC_AUTH_NAME, :password => BASIC_AUTH_PASSWORD
|
13
|
+
|
12
14
|
def home
|
13
15
|
authorize! :home, IshManager::Ability
|
14
16
|
render 'home'
|
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
class ::IshManager::IroPursesController < IshManager::ApplicationController
|
3
|
+
|
4
|
+
before_action :set_lists
|
5
|
+
|
6
|
+
def my
|
7
|
+
@purse = Iro::Purse.find_or_create_by({ user_id: current_user.id })
|
8
|
+
authorize! :my, @purse
|
9
|
+
@positions = @purse.positions
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -25,7 +25,6 @@ class IshManager::ScheduledEmailActionsController < IshManager::ApplicationContr
|
|
25
25
|
def edit
|
26
26
|
@sch = Sch.find params[:id]
|
27
27
|
authorize! :edit, @sch
|
28
|
-
|
29
28
|
end
|
30
29
|
|
31
30
|
def index
|
@@ -38,5 +37,23 @@ class IshManager::ScheduledEmailActionsController < IshManager::ApplicationContr
|
|
38
37
|
authorize! :scheduled_emails_new, @scheduled_email_action
|
39
38
|
end
|
40
39
|
|
40
|
+
def show
|
41
|
+
@sch = Sch.find params[:id]
|
42
|
+
authorize! :show, @sch
|
43
|
+
redirect_to action: 'edit'
|
44
|
+
end
|
45
|
+
|
46
|
+
def update
|
47
|
+
@sch = Sch.find params[:id]
|
48
|
+
authorize! :update, @sch
|
49
|
+
flag = @sch.update_attributes( params[:sch].permit! )
|
50
|
+
if flag
|
51
|
+
flash[:notice] = "Success."
|
52
|
+
else
|
53
|
+
flash[:alert] = "No luck: #{@sch.errors.full_messages.join(',')}."
|
54
|
+
end
|
55
|
+
render action: 'edit'
|
56
|
+
end
|
57
|
+
|
41
58
|
end
|
42
59
|
|
@@ -44,29 +44,31 @@
|
|
44
44
|
= link_to "Inbox (#{Office::EmailConversation.in_inbox.length})", email_conversations_path
|
45
45
|
= link_to '[+]', new_email_context_path
|
46
46
|
%li
|
47
|
-
= link_to
|
48
|
-
= link_to '[+]',
|
49
|
-
= link_to 'unsent', notsent_email_contexts_path
|
47
|
+
= link_to "Templates (#{Ish::EmailTemplate.all.count})", email_templates_path
|
48
|
+
= link_to '[+]', new_email_template_path
|
50
49
|
%li
|
51
|
-
= link_to '
|
52
|
-
= link_to '
|
50
|
+
-# = link_to 'Contexts', email_contexts_path
|
51
|
+
= link_to 'Contexts', notsent_email_contexts_path
|
52
|
+
= link_to '[+]', new_email_context_path
|
53
|
+
-# %li
|
54
|
+
-# = link_to 'Campaigns', email_campaigns_path
|
55
|
+
-# = link_to '[+]', new_email_campaign_path
|
53
56
|
|
54
57
|
%li
|
55
|
-
= link_to
|
58
|
+
= link_to "Sch (#{Sch.active.length})", scheduled_email_actions_path
|
56
59
|
= link_to '[+]', new_scheduled_email_action_path
|
60
|
+
= link_to "Email Actions (#{Office::EmailAction.all.length})", email_actions_path
|
61
|
+
= link_to '[+]', new_email_action_path
|
57
62
|
%ul
|
63
|
+
%li
|
64
|
+
|
58
65
|
%li
|
59
|
-
= link_to "
|
60
|
-
= link_to '[+]', new_email_template_path
|
61
|
-
%li
|
62
|
-
= link_to "Leadsets (#{Leadset.kept.length})", leadsets_path
|
66
|
+
= link_to "Co's (#{Leadset.kept.length})", leadsets_path
|
63
67
|
= link_to '[+]', new_leadset_path
|
64
68
|
%li
|
65
69
|
= link_to "Leads (#{Lead.kept.length})", leads_path
|
66
70
|
= link_to '[+]', new_lead_path
|
67
|
-
|
68
|
-
= link_to "Email Actions (#{Office::EmailAction.all.length})", email_actions_path
|
69
|
-
= link_to '[+]', new_email_action_path
|
71
|
+
|
70
72
|
%li
|
71
73
|
= link_to "Filters (#{Office::EmailFilter.active.length})", email_filters_path
|
72
74
|
= link_to '[+]', new_email_filter_path
|
@@ -76,6 +78,8 @@
|
|
76
78
|
Iro Wor
|
77
79
|
.a
|
78
80
|
%ul
|
81
|
+
%li
|
82
|
+
= link_to 'Purse', my_purse_path
|
79
83
|
%li
|
80
84
|
= link_to 'Watches', iro_watches_path
|
81
85
|
%li
|
@@ -23,13 +23,17 @@
|
|
23
23
|
|
24
24
|
.col-md-6
|
25
25
|
.field
|
26
|
-
%label Next
|
27
|
-
.eg
|
28
|
-
= f.text_field :
|
29
|
-
.field
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
%label Next At Exe
|
27
|
+
.eg rand(1..5).business_days.from_now.to_date + rand(8..16).hours + rand(1..59).minutes
|
28
|
+
= f.text_field :next_at_exe
|
29
|
+
-# .field
|
30
|
+
-# %label Next in Days
|
31
|
+
-# .eg eg: rand(1..5)
|
32
|
+
-# = f.text_field :next_in_days
|
33
|
+
-# .field
|
34
|
+
-# %label Next at Time
|
35
|
+
-# .eg eg: rand(8..16).hours + rand(1..59).minutes
|
36
|
+
-# = f.text_field :next_at_time
|
33
37
|
.field
|
34
38
|
%label Next Email Actions
|
35
39
|
= f.select :next_email_actions, options_for_select( @email_actions_list, selected: act.next_email_actions.map(&:id) ), { }, { class: 'select2', multiple: true }
|
@@ -15,7 +15,8 @@
|
|
15
15
|
%table.bordered.data-table
|
16
16
|
%thead
|
17
17
|
%tr
|
18
|
-
%th.actions
|
18
|
+
%th.actions
|
19
|
+
%th.from From
|
19
20
|
%th.to To
|
20
21
|
%th.subject Subject
|
21
22
|
%th.template Template
|
@@ -30,12 +31,15 @@
|
|
30
31
|
- else
|
31
32
|
= link_to '[~]', edit_email_context_path(ctx)
|
32
33
|
= button_to '[x]', email_context_path(ctx), method: :delete, form_class: :inline, data: { confirm: 'Are you sure?' }
|
34
|
+
%td
|
35
|
+
= ctx.from_email ? ctx.from_email : "t| #{ctx.tmpl.from_email}"
|
33
36
|
%td= ctx.to_email
|
34
37
|
%td
|
35
|
-
= link_to
|
38
|
+
= link_to email_context_path(ctx) do
|
39
|
+
= ctx.subject ? ctx.subject : "t| #{ctx.tmpl.subject}"
|
36
40
|
%td= ctx.email_template.slug
|
37
|
-
%td= ctx.created_at.strftime('%Y-%m-%d')
|
38
|
-
%td= ctx.updated_at.strftime('%Y-%m-%d')
|
41
|
+
%td= ctx.created_at.strftime('%Y-%m-%d %l:%M%P %:z')
|
42
|
+
%td= ctx.updated_at.strftime('%Y-%m-%d %l:%M%P %:z')
|
39
43
|
|
40
44
|
|
41
45
|
= render 'paginate', resource: @ctxs, param_name: :email_contexts_page, views_prefix: :ish_manager
|
@@ -1,18 +1,15 @@
|
|
1
1
|
|
2
2
|
%h3.center.collapse-expand#emailTemplatesIndex
|
3
3
|
Email Templates (#{Ish::EmailTemplate.all.count})
|
4
|
-
.email-templates-index
|
5
|
-
|
6
|
-
-# = render 'ish_manager/email_templates/form_mini'
|
7
4
|
|
5
|
+
.email-templates-index.max-width
|
8
6
|
%table.bordered
|
9
7
|
%tr
|
10
|
-
%th
|
8
|
+
%th
|
11
9
|
%th Slug
|
12
10
|
%th Created
|
13
11
|
%th Updated
|
14
12
|
|
15
|
-
|
16
13
|
- @templates.each do |tmpl|
|
17
14
|
%tr
|
18
15
|
%td
|
@@ -20,10 +17,6 @@
|
|
20
17
|
= link_to '[~]', edit_email_template_path({ id: tmpl })
|
21
18
|
= button_to '[x]', email_template_path({ id: tmpl }), method: :delete, :data => { :confirm => 'Are you sure?' }, form_class: 'inline'
|
22
19
|
%td= link_to tmpl.slug, email_template_path({ id: tmpl })
|
23
|
-
%td= tmpl.created_at
|
24
|
-
%td= tmpl.updated_at
|
25
|
-
|
26
|
-
-# = link_to 'iFrame', email_template_iframe_path({ id: tmpl }), target: :_blank
|
27
|
-
|
28
|
-
%hr
|
20
|
+
%td= pp_date tmpl.created_at
|
21
|
+
%td= pp_date tmpl.updated_at
|
29
22
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
- url = sch_a.new_record? ? scheduled_email_actions_path : scheduled_email_action_path(sch_a.id)
|
8
8
|
|
9
9
|
.scheduled-email-actions--form
|
10
|
-
= form_for scheduled_email_action, url: url, html: { class: "form-mini" } do |f|
|
10
|
+
= form_for scheduled_email_action, url: url, as: :sch, html: { class: "form-mini" } do |f|
|
11
11
|
.header
|
12
12
|
%h5.title Schedule an email action
|
13
13
|
|
@@ -10,8 +10,13 @@
|
|
10
10
|
.items
|
11
11
|
- @scheduled_email_actions.each do |sch|
|
12
12
|
.item
|
13
|
-
|
13
|
+
.flex-row
|
14
|
+
.gray= sch.id
|
15
|
+
= link_to '[~]', edit_scheduled_email_action_path(sch)
|
16
|
+
|
14
17
|
%ul
|
15
|
-
|
18
|
+
%li <b>Act:</b> #{link_to sch.email_action.slug, edit_email_action_path(sch.email_action)}
|
16
19
|
%li <b>Tmpl:</b> #{sch.email_action.email_template.slug}
|
17
|
-
%li <b>Lead:</b> #{sch.lead.email}
|
20
|
+
%li <b>Lead:</b> #{link_to sch.lead.email, lead_path(sch.lead) }
|
21
|
+
%li <b>State:</b> #{sch.state}
|
22
|
+
%li <b>Perform at:</b> #{sch.perform_at}
|
data/config/routes.rb
CHANGED
@@ -23,16 +23,12 @@ IshManager::Engine.routes.draw do
|
|
23
23
|
# end
|
24
24
|
# resources :orders
|
25
25
|
|
26
|
-
# namespace :iron_warbler do
|
27
|
-
# resources :iron_condors
|
28
|
-
# resources :stock_watches
|
29
|
-
# resources :option_watches
|
30
|
-
# resources :covered_calls
|
31
|
-
# end
|
32
26
|
|
33
|
-
|
34
|
-
|
35
|
-
|
27
|
+
get 'iro_watches', to: 'iro_watches#index'
|
28
|
+
get 'iro_purse', to: 'iro_purses#my', as: :my_purse
|
29
|
+
|
30
|
+
|
31
|
+
|
36
32
|
|
37
33
|
scope 'gameui' do
|
38
34
|
get 'maps/:id/map-editor', to: 'maps#map_editor', as: :location_map_editor
|
data/lib/tasks/office_tasks.rake
CHANGED
@@ -6,6 +6,43 @@ end
|
|
6
6
|
|
7
7
|
namespace :office do
|
8
8
|
|
9
|
+
desc 'schheduled email actions, rolling perform'
|
10
|
+
task :schs => :environment do
|
11
|
+
while true do
|
12
|
+
|
13
|
+
Sch.active.where({ :perform_at.lte => Time.now }).each do |sch|
|
14
|
+
sch.update_attributes({ state: Sch::STATE_INACTIVE })
|
15
|
+
|
16
|
+
# send now
|
17
|
+
ctx = Ctx.new({
|
18
|
+
email_template_id: sch.act.tmpl.id,
|
19
|
+
lead_id: sch.lead.id,
|
20
|
+
send_at: Time.now,
|
21
|
+
})
|
22
|
+
ctx.save!
|
23
|
+
|
24
|
+
# schedule the next action & update the action
|
25
|
+
next_at = eval(sch.act.next_at_exe)
|
26
|
+
sch.act.next_email_actions.each do |nxt|
|
27
|
+
sch_nxt = Sch.find_or_initialize_by({
|
28
|
+
lead_id: sch.lead_id,
|
29
|
+
email_action_id: nxt.id,
|
30
|
+
})
|
31
|
+
sch_nxt.perform_at = next_at
|
32
|
+
sch_nxt.state = Sch::STATE_ACTIVE
|
33
|
+
sch_nxt.save!
|
34
|
+
end
|
35
|
+
|
36
|
+
print '.'
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
# sleep 1.minute
|
41
|
+
sleep 10.seconds
|
42
|
+
print '|'
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
9
46
|
desc "send emails"
|
10
47
|
task :email_worker => :environment do
|
11
48
|
while true do
|
@@ -20,7 +57,6 @@ namespace :office do
|
|
20
57
|
# sleep 1.minute
|
21
58
|
sleep 10.seconds
|
22
59
|
print '^'
|
23
|
-
|
24
60
|
end
|
25
61
|
end
|
26
62
|
|
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.
|
4
|
+
version: 0.1.8.378
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -318,6 +318,7 @@ files:
|
|
318
318
|
- app/controllers/ish_manager/galleries_controller.rb
|
319
319
|
- app/controllers/ish_manager/image_assets_controller.rb
|
320
320
|
- app/controllers/ish_manager/invoices_controller.rb
|
321
|
+
- app/controllers/ish_manager/iro_purses_controller.rb
|
321
322
|
- app/controllers/ish_manager/iro_watches_controller.rb
|
322
323
|
- app/controllers/ish_manager/leads_controller.rb
|
323
324
|
- app/controllers/ish_manager/leadset_tags_controller.rb
|
@@ -461,6 +462,7 @@ files:
|
|
461
462
|
- app/views/ish_manager/invoices/_form.haml
|
462
463
|
- app/views/ish_manager/invoices/index.haml
|
463
464
|
- app/views/ish_manager/invoices/new.haml
|
465
|
+
- app/views/ish_manager/iro_purses/my.haml
|
464
466
|
- app/views/ish_manager/iron_warbler_mailer/condor_followup_alerb.html.erb
|
465
467
|
- app/views/ish_manager/iron_warbler_mailer/option_alert.html.erb
|
466
468
|
- app/views/ish_manager/iron_warbler_mailer/stock_alert.html.erb
|
@@ -571,7 +573,7 @@ files:
|
|
571
573
|
- lib/systemd/system/README.txt
|
572
574
|
- lib/systemd/system/stockwatcher.service
|
573
575
|
- lib/systemd/system/watch_stocks.service
|
574
|
-
- lib/tasks
|
576
|
+
- lib/tasks-done/migrate.rake
|
575
577
|
- lib/tasks/ish_manager_tasks.rake
|
576
578
|
- lib/tasks/office_tasks.rake
|
577
579
|
homepage: http://wasya.co
|
File without changes
|