ish_manager 0.1.8.355 → 0.1.8.357
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/javascripts/ish_manager/application.js +68 -15
- data/app/assets/javascripts/ish_manager/email_contexts.js +1 -1
- data/app/assets/javascripts/ish_manager/email_templates.js +20 -0
- data/app/assets/javascripts/ish_manager/galleries.js +78 -0
- data/app/assets/stylesheets/ish_manager/application.scss +48 -9
- data/app/assets/stylesheets/ish_manager/email.scss +44 -0
- data/app/assets/stylesheets/ish_manager/{email_contexts_templates.scss → email_contexts.scss} +29 -49
- data/app/assets/stylesheets/ish_manager/email_conversations.scss +99 -21
- data/app/assets/stylesheets/ish_manager/email_templates.scss +59 -0
- data/app/assets/stylesheets/ish_manager/galleries.scss +10 -0
- data/app/assets/stylesheets/ish_manager/leads_leadsets.scss +96 -3
- data/app/assets/stylesheets/ish_manager/scheduled_actions_emails.scss +25 -0
- data/app/assets/stylesheets/ish_manager/tags.scss +5 -0
- data/app/controllers/ish_manager/application_controller.rb +15 -0
- data/app/controllers/ish_manager/email_actions_controller.rb +80 -0
- data/app/controllers/ish_manager/email_campaigns_controller.rb +13 -0
- data/app/controllers/ish_manager/email_contexts_controller.rb +41 -48
- data/app/controllers/ish_manager/email_conversations_controller.rb +6 -2
- data/app/controllers/ish_manager/email_filters_controller.rb +47 -0
- data/app/controllers/ish_manager/email_messages_controller.rb +1 -1
- data/app/controllers/ish_manager/email_templates_controller.rb +23 -10
- data/app/controllers/ish_manager/galleries_controller.rb +23 -8
- data/app/controllers/ish_manager/leads_controller.rb +3 -9
- data/app/controllers/ish_manager/leadset_tags_controller.rb +18 -0
- data/app/controllers/ish_manager/leadsets_controller.rb +13 -0
- data/app/controllers/ish_manager/scheduled_email_actions_controller.rb +38 -0
- data/app/helpers/ish_manager/application_helper.rb +4 -0
- data/app/mailers/ish_manager/application_mailer.rb +1 -1
- data/app/mailers/ish_manager/meeting_mailer.rb +2 -1
- data/app/mailers/ish_manager/office_mailer.rb +12 -10
- data/app/views/ish_manager/application/_debug.haml +2 -1
- data/app/views/ish_manager/application/_main_header_admin.haml +47 -60
- data/app/views/ish_manager/email_actions/_form.haml +52 -0
- data/app/views/ish_manager/email_actions/edit.haml +7 -0
- data/app/views/ish_manager/email_actions/index.haml +26 -0
- data/app/views/ish_manager/email_actions/new.haml +7 -0
- data/app/views/ish_manager/email_contexts/_form.haml +32 -30
- data/app/views/ish_manager/email_contexts/edit.haml +1 -1
- data/app/views/ish_manager/email_contexts/index.haml +27 -22
- data/app/views/ish_manager/email_contexts/show.haml +26 -15
- data/app/views/ish_manager/email_conversations/index.haml +46 -9
- data/app/views/ish_manager/email_conversations/show.haml +56 -21
- data/app/views/ish_manager/email_filters/_form.haml +12 -0
- data/app/views/ish_manager/email_filters/edit.haml +5 -0
- data/app/views/ish_manager/email_filters/index.haml +24 -0
- data/app/views/ish_manager/email_filters/new.haml +5 -0
- data/app/views/ish_manager/email_templates/_form.haml +32 -13
- data/app/views/ish_manager/email_templates/_form_reply_2_mini.haml +15 -0
- data/app/views/ish_manager/email_templates/_form_reply_mini.haml +1 -1
- data/app/views/ish_manager/email_templates/_index.haml +24 -11
- data/app/views/ish_manager/email_templates/_piousbox_roundborders.html.erb +4 -1
- data/app/views/ish_manager/email_templates/_wasyaco_roundborders.html.erb +5 -6
- data/app/views/ish_manager/email_templates/done/_form.haml +22 -0
- data/app/views/ish_manager/email_templates/done/_form2.haml +26 -0
- data/app/views/ish_manager/email_templates/edit.haml +2 -1
- data/app/views/ish_manager/email_templates/iframe_src.haml +4 -3
- data/app/views/ish_manager/email_templates/new.haml +5 -0
- data/app/views/ish_manager/email_templates/show.haml +9 -3
- data/app/views/ish_manager/galleries/show.haml +10 -1
- data/app/views/ish_manager/leads/_form.haml +11 -6
- data/app/views/ish_manager/leads/_form_import.haml +3 -3
- data/app/views/ish_manager/leads/edit.haml +19 -16
- data/app/views/ish_manager/leads/index.haml +25 -16
- data/app/views/ish_manager/leads/new.haml +8 -7
- data/app/views/ish_manager/leadsets/index.haml +60 -12
- data/app/views/ish_manager/leadsets/index_dataTables.haml +33 -0
- data/app/views/ish_manager/photos/_index_thumbs.haml +1 -1
- data/app/views/ish_manager/scheduled_actions/_form_mini.haml +16 -0
- data/app/views/ish_manager/scheduled_email_actions/_form.haml +26 -0
- data/app/views/ish_manager/scheduled_email_actions/index.haml +15 -0
- data/app/views/ish_manager/scheduled_email_actions/new.haml +4 -0
- data/app/views/ish_manager/scheduled_email_actions/show.haml +0 -0
- data/app/views/layouts/ish_manager/application.haml +2 -2
- data/app/views/layouts/ish_manager/application_fullwidth.haml +2 -2
- data/config/routes.rb +11 -2
- metadata +31 -6
- data/app/controllers/ish_manager/office_actions_controller.rb +0 -59
- data/app/views/ish_manager/office_actions/_form.haml +0 -83
- data/app/views/ish_manager/office_actions/index.haml +0 -9
@@ -0,0 +1,59 @@
|
|
1
|
+
|
2
|
+
.email-templates--form {
|
3
|
+
form {
|
4
|
+
> .actions {
|
5
|
+
text-align: right;
|
6
|
+
}
|
7
|
+
|
8
|
+
.tab-labels {
|
9
|
+
// border: 1px solid red;
|
10
|
+
margin-top: 1em;
|
11
|
+
|
12
|
+
|
13
|
+
display: flex;
|
14
|
+
|
15
|
+
> * {
|
16
|
+
// border: 1px solid red;
|
17
|
+
}
|
18
|
+
> .active {
|
19
|
+
border: 2px solid red;
|
20
|
+
border-radius: 0.5em 0.5em 0 0;
|
21
|
+
border-bottom: 0;
|
22
|
+
margin-bottom: -2px;
|
23
|
+
background: white;
|
24
|
+
padding: 0 .5em;
|
25
|
+
margin: 0 .5em;
|
26
|
+
}
|
27
|
+
|
28
|
+
}
|
29
|
+
.tabs {
|
30
|
+
.tab-raw {
|
31
|
+
display: none;
|
32
|
+
}
|
33
|
+
.tab-preview {
|
34
|
+
height: 500px;
|
35
|
+
// display: none;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
.email-templates--form-mini {
|
43
|
+
border: 1px solid red;
|
44
|
+
padding: 1em;
|
45
|
+
|
46
|
+
form {
|
47
|
+
display: flex;
|
48
|
+
|
49
|
+
> * {
|
50
|
+
padding-right: 20px;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
}
|
55
|
+
|
56
|
+
.email-templates--form-reply-mini,
|
57
|
+
.email-templates--form-schedule-mini {
|
58
|
+
|
59
|
+
}
|
@@ -12,10 +12,103 @@
|
|
12
12
|
.manager-leadsets-index {
|
13
13
|
padding: 1em;
|
14
14
|
|
15
|
-
.actions label {
|
16
|
-
border: 1px solid
|
15
|
+
> .actions label {
|
16
|
+
border: 1px solid #fff;
|
17
17
|
padding: 0.5em;
|
18
18
|
border-radius: 0.5em;
|
19
|
-
background: #
|
19
|
+
background: #eee;
|
20
|
+
|
21
|
+
> * {
|
22
|
+
display: inline;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
tr {
|
27
|
+
border-bottom: 1px solid yellow;
|
28
|
+
|
29
|
+
// :hover {
|
30
|
+
// background: #eee;
|
31
|
+
// }
|
32
|
+
}
|
33
|
+
|
34
|
+
th.leads {
|
35
|
+
margin-left: 1em;
|
36
|
+
}
|
37
|
+
td.leads {
|
38
|
+
margin-left: 1em;
|
39
|
+
vertical-align: top;
|
40
|
+
|
41
|
+
.item {
|
42
|
+
display: flex;
|
43
|
+
align-items: flex-start;
|
44
|
+
|
45
|
+
.actions {
|
46
|
+
display: flex;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
form.form-mini {
|
52
|
+
border: 1px solid red;
|
53
|
+
border-radius: .5em;
|
54
|
+
padding: 1em;
|
55
|
+
background: white;
|
56
|
+
|
57
|
+
display: flex;
|
58
|
+
flex-direction: column;
|
59
|
+
align-items: center;
|
60
|
+
|
61
|
+
position: absolute;
|
62
|
+
top: 0;
|
63
|
+
width: 300px;
|
64
|
+
right: -300px;
|
65
|
+
|
66
|
+
z-index: 2;
|
67
|
+
|
68
|
+
.field {
|
69
|
+
display: flex;
|
70
|
+
}
|
71
|
+
|
72
|
+
.actions {
|
73
|
+
margin-top: .5em;
|
74
|
+
width: 100%;
|
75
|
+
text-align: right;
|
76
|
+
}
|
20
77
|
}
|
78
|
+
|
79
|
+
.scheduled {
|
80
|
+
position: relative;
|
81
|
+
display: flex;
|
82
|
+
|
83
|
+
.chip {
|
84
|
+
border: 2px solid cyan;
|
85
|
+
display: flex;
|
86
|
+
flex-direction: column;
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
.tags {
|
91
|
+
// background: #eee;
|
92
|
+
|
93
|
+
display: flex;
|
94
|
+
flex-wrap: wrap;
|
95
|
+
|
96
|
+
max-width: 400px;
|
97
|
+
}
|
98
|
+
|
99
|
+
.tags-add {
|
100
|
+
position: relative;
|
101
|
+
vertical-align: top;
|
102
|
+
}
|
103
|
+
|
104
|
+
.chip {
|
105
|
+
display: inline;
|
106
|
+
|
107
|
+
border: 1px solid #eee;
|
108
|
+
border-radius: 0.5em;
|
109
|
+
padding: 0.1em .3em;
|
110
|
+
background: #fff;
|
111
|
+
}
|
112
|
+
|
21
113
|
}
|
114
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
|
2
|
+
.scheduled-emails-new {
|
3
|
+
|
4
|
+
|
5
|
+
border: 1px solid red;
|
6
|
+
border-radius: .5em;
|
7
|
+
padding: .5em;
|
8
|
+
background: white;
|
9
|
+
|
10
|
+
form {
|
11
|
+
display: flex;
|
12
|
+
align-items: flex-end;
|
13
|
+
}
|
14
|
+
|
15
|
+
}
|
16
|
+
|
17
|
+
.scheduled-actions--form-mini {
|
18
|
+
display: inline-block;
|
19
|
+
|
20
|
+
form {
|
21
|
+
border: 1px solid blue;
|
22
|
+
|
23
|
+
display: flex;
|
24
|
+
}
|
25
|
+
}
|
@@ -5,6 +5,7 @@ module IshManager
|
|
5
5
|
before_action :set_current_ability
|
6
6
|
before_action :set_changelog
|
7
7
|
before_action :set_title
|
8
|
+
before_action :set_jwt
|
8
9
|
check_authorization
|
9
10
|
rescue_from ::CanCan::AccessDenied, :with => :access_denied
|
10
11
|
|
@@ -44,6 +45,15 @@ module IshManager
|
|
44
45
|
@current_ability ||= ::IshManager::Ability.new( @current_profile )
|
45
46
|
end
|
46
47
|
|
48
|
+
def set_jwt
|
49
|
+
@jwt_token = encode(user_profile_id: @current_user.profile.id.to_s)
|
50
|
+
end
|
51
|
+
|
52
|
+
def encode(payload, exp = 48.hours.from_now) # @TODO: definitely change, right now I expire once in 2 days.
|
53
|
+
payload[:exp] = exp.to_i
|
54
|
+
JWT.encode(payload, Rails.application.secrets.secret_key_base.to_s)
|
55
|
+
end
|
56
|
+
|
47
57
|
def set_lists
|
48
58
|
@galleries_list = Gallery.all.list
|
49
59
|
@locations_list = ::Gameui::Map.list
|
@@ -51,6 +61,11 @@ module IshManager
|
|
51
61
|
@reports_list = Report.all.list
|
52
62
|
@user_profiles_list = Ish::UserProfile.list
|
53
63
|
@videos_list = Video.all.list
|
64
|
+
|
65
|
+
@leads_list = Lead.list
|
66
|
+
@leadsets_list = Leadset.list
|
67
|
+
@email_actions_list = ::Office::EmailAction.all.map { |a| [ a.slug, a.id ] }
|
68
|
+
@email_templates_list = Ish::EmailTemplate.all.map { |t| [ t.slug, t.id ] }
|
54
69
|
end
|
55
70
|
|
56
71
|
def set_title
|
@@ -0,0 +1,80 @@
|
|
1
|
+
|
2
|
+
class ::IshManager::EmailActionsController < IshManager::ApplicationController
|
3
|
+
|
4
|
+
before_action :set_lists
|
5
|
+
|
6
|
+
## Alphabetized : )
|
7
|
+
|
8
|
+
def create
|
9
|
+
@act = @email_action = Office::EmailAction.new
|
10
|
+
authorize! :create, @act
|
11
|
+
|
12
|
+
next_ids = params[:email_action].delete(:next_email_actions)
|
13
|
+
next_ids.delete("")
|
14
|
+
Office::EmailAction.where(prev_email_action_id: params[:id] ).update_all(prev_email_action_id: nil)
|
15
|
+
next_ids.each do |next_id|
|
16
|
+
next_action = ::Office::EmailAction.find next_id
|
17
|
+
next_action.update_attribute( :prev_email_action_id, params[:id] )
|
18
|
+
end
|
19
|
+
|
20
|
+
flag = @act.update_attributes( params[:email_action].permit! )
|
21
|
+
if flag
|
22
|
+
flash[:notice] = 'Success'
|
23
|
+
else
|
24
|
+
flash[:alert] = "No luck: #{@act.errors.full_messages.join(', ')}"
|
25
|
+
end
|
26
|
+
|
27
|
+
redirect_to action: 'index'
|
28
|
+
end
|
29
|
+
|
30
|
+
def edit
|
31
|
+
@act = @email_action = Office::EmailAction.find( params[:id] )
|
32
|
+
authorize! :edit, @act
|
33
|
+
end
|
34
|
+
|
35
|
+
def index
|
36
|
+
@email_actions = Office::EmailAction.all
|
37
|
+
|
38
|
+
authorize! :index, @new_email_action
|
39
|
+
end
|
40
|
+
|
41
|
+
def new
|
42
|
+
authorize! :new, @new_email_action
|
43
|
+
end
|
44
|
+
|
45
|
+
def show
|
46
|
+
end
|
47
|
+
|
48
|
+
def update
|
49
|
+
@act = @email_action = Office::EmailAction.find( params[:id] )
|
50
|
+
authorize! :update, @act
|
51
|
+
|
52
|
+
next_ids = params[:email_action].delete(:next_email_actions)
|
53
|
+
next_ids.delete("")
|
54
|
+
Office::EmailAction.where(prev_email_action_id: params[:id] ).update_all(prev_email_action_id: nil)
|
55
|
+
next_ids.each do |next_id|
|
56
|
+
next_action = ::Office::EmailAction.find next_id
|
57
|
+
next_action.update_attribute( :prev_email_action_id, params[:id] )
|
58
|
+
end
|
59
|
+
|
60
|
+
flag = @act.update_attributes( params[:email_action].permit! )
|
61
|
+
if flag
|
62
|
+
flash[:notice] = 'Success'
|
63
|
+
else
|
64
|
+
flash[:alert] = "No luck: #{@act.errors.full_messages.join(', ')}"
|
65
|
+
end
|
66
|
+
|
67
|
+
redirect_to action: 'index'
|
68
|
+
end
|
69
|
+
|
70
|
+
##
|
71
|
+
## private
|
72
|
+
##
|
73
|
+
private
|
74
|
+
|
75
|
+
def set_lists
|
76
|
+
@new_email_action = Office::EmailAction.new
|
77
|
+
super
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
@@ -1,6 +1,19 @@
|
|
1
1
|
|
2
2
|
class ::IshManager::EmailCampaignsController < IshManager::ApplicationController
|
3
3
|
|
4
|
+
def do_send
|
5
|
+
|
6
|
+
# case @ctx.type
|
7
|
+
# when ::Ish::EmailContext::TYPE_SINGLE
|
8
|
+
# flash[:notice] = 'Scheduled a single send - v2'
|
9
|
+
# @ctx.send_at = Time.now
|
10
|
+
# @ctx.save
|
11
|
+
# when ::Ish::EmailContext::TYPE_CAMPAIGN
|
12
|
+
# flash[:notice] = 'Scheduled campaign send'
|
13
|
+
# IshManager::EmailCampaignJob.new.perform(params[:id])
|
14
|
+
# end
|
15
|
+
end
|
16
|
+
|
4
17
|
def index
|
5
18
|
authorize! :index, Ish::EmailCampaign
|
6
19
|
@campaigns = Ish::EmailCampaign.where( :profile => @current_profile, :is_trash => false )
|
@@ -9,23 +9,23 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
|
|
9
9
|
authorize! :create, ::Ish::EmailContext
|
10
10
|
pparams = params[:ish_email_context].permit!
|
11
11
|
pparams[:tmpl] = JSON.parse(pparams[:tmpl])
|
12
|
-
@
|
13
|
-
if @
|
12
|
+
@ctx = ::Ish::EmailContext.new pparams
|
13
|
+
if @ctx.save
|
14
14
|
flash[:notice] = 'Saved.'
|
15
|
-
redirect_to action: 'show', id: @
|
15
|
+
redirect_to action: 'show', id: @ctx.id
|
16
16
|
return
|
17
17
|
else
|
18
|
-
# flash[:alert] = "Could not save: #{@
|
19
|
-
flash[:alert] = ['Could not save:'] + @
|
18
|
+
# flash[:alert] = "Could not save: #{@ctx.errors.full_messages.join(', ')}"
|
19
|
+
flash[:alert] = ['Could not save:'] + @ctx.errors.full_messages
|
20
20
|
render action: :new
|
21
21
|
return
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
def destroy
|
26
|
-
@
|
27
|
-
authorize! :destroy, @
|
28
|
-
flag = @
|
26
|
+
@ctx = Ish::EmailContext.find params[:id]
|
27
|
+
authorize! :destroy, @ctx
|
28
|
+
flag = @ctx.destroy
|
29
29
|
if flag
|
30
30
|
flash[:notice] = 'Destroyed the email context'
|
31
31
|
else
|
@@ -37,52 +37,44 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
|
|
37
37
|
def do_send
|
38
38
|
@ctx = ::Ish::EmailContext.find params[:id]
|
39
39
|
authorize! :do_send, @ctx
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
@ctx.save
|
45
|
-
when ::Ish::EmailContext::TYPE_CAMPAIGN
|
46
|
-
flash[:notice] = 'Scheduled campaign send'
|
47
|
-
IshManager::EmailCampaignJob.new.perform(params[:id])
|
48
|
-
end
|
40
|
+
|
41
|
+
flash[:notice] = 'Scheduled a single send - v2'
|
42
|
+
@ctx.send_at = Time.now
|
43
|
+
@ctx.save
|
49
44
|
|
50
45
|
redirect_to action: 'index'
|
51
46
|
end
|
52
47
|
|
53
48
|
def edit
|
54
|
-
@
|
55
|
-
authorize! :edit, @
|
49
|
+
@ctx = ::Ish::EmailContext.find params[:id]
|
50
|
+
authorize! :edit, @ctx
|
56
51
|
end
|
57
52
|
|
58
53
|
def iframe_src
|
59
|
-
@
|
60
|
-
authorize! :iframe_src, @
|
61
|
-
@email_template = @
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
return
|
66
|
-
when 'plain'
|
67
|
-
@body = @email_ctx.body_templated
|
68
|
-
render 'ish_manager/email_templates/plain', layout: false
|
69
|
-
return
|
70
|
-
end
|
54
|
+
@ctx = @email_context = Ish::EmailContext.find params[:id]
|
55
|
+
authorize! :iframe_src, @ctx
|
56
|
+
@tmpl = @email_template = @ctx.email_template
|
57
|
+
@lead = @ctx.lead
|
58
|
+
# @body = @ctx.body_templated
|
59
|
+
render "ish_manager/email_templates/_#{@tmpl.layout}", layout: false
|
71
60
|
end
|
72
61
|
|
73
62
|
def index
|
74
63
|
authorize! :index, ::Ish::EmailContext
|
75
|
-
@
|
64
|
+
@ctxs = ::Ish::EmailContext.all
|
76
65
|
|
77
66
|
if params[:notsent]
|
78
|
-
@
|
67
|
+
@ctxs = @ctxs.where( sent_at: nil )
|
79
68
|
end
|
80
69
|
|
81
|
-
if params[:
|
82
|
-
@
|
70
|
+
if params[:lead_id]
|
71
|
+
@lead = Lead.find params[:lead_id]
|
72
|
+
@ctxs = @ctxs.where( to_email: @lead.email )
|
83
73
|
end
|
84
74
|
|
85
|
-
@
|
75
|
+
@ctxs = @ctxs.page( params[Ish::EmailContext::PAGE_PARAM_NAME] )
|
76
|
+
|
77
|
+
render layout: 'ish_manager/application_fullwidth'
|
86
78
|
end
|
87
79
|
|
88
80
|
def new
|
@@ -93,37 +85,38 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
|
|
93
85
|
if @template
|
94
86
|
attrs = @template.attributes.slice( :subject, :body, :from_email )
|
95
87
|
end
|
96
|
-
@
|
88
|
+
@ctx = ::Ish::EmailContext.new( { email_template: @template }.merge(attrs) )
|
97
89
|
end
|
98
90
|
|
99
91
|
def show
|
100
|
-
@
|
101
|
-
authorize! :show, @
|
92
|
+
@ctx = @email_context = ::Ish::EmailContext.find( params[:id] )
|
93
|
+
authorize! :show, @ctx
|
102
94
|
end
|
103
95
|
|
104
96
|
def update
|
105
|
-
@
|
106
|
-
authorize! :update, @
|
97
|
+
@ctx = ::Ish::EmailContext.find params[:id]
|
98
|
+
authorize! :update, @ctx
|
107
99
|
pparams = params[:ish_email_context].permit!
|
108
|
-
|
109
|
-
if @
|
100
|
+
|
101
|
+
if @ctx.update_attributes pparams
|
110
102
|
flash[:notice] = 'Saved.'
|
111
|
-
redirect_to action: 'show', id: @
|
103
|
+
redirect_to action: 'show', id: @ctx.id
|
112
104
|
return
|
113
105
|
else
|
114
|
-
flash[:alert] = "Could not save: #{@
|
106
|
+
flash[:alert] = "Could not save: #{@ctx.errors.full_messages.join(', ')}"
|
115
107
|
render action: :edit
|
116
108
|
return
|
117
109
|
end
|
118
110
|
end
|
119
111
|
|
120
|
-
|
121
|
-
|
122
|
-
|
112
|
+
##
|
113
|
+
## Private
|
114
|
+
##
|
123
115
|
private
|
124
116
|
|
125
117
|
def set_lists
|
126
118
|
@email_templates_list = [ [nil, nil] ] + ::Ish::EmailTemplate.all.map { |tmpl| [ tmpl.slug, tmpl.id ] }
|
119
|
+
@leads_list = Lead.list
|
127
120
|
end
|
128
121
|
|
129
122
|
end
|
@@ -1,16 +1,20 @@
|
|
1
1
|
|
2
2
|
class ::IshManager::EmailConversationsController < IshManager::ApplicationController
|
3
3
|
|
4
|
+
layout 'ish_manager/application_fullwidth'
|
5
|
+
|
6
|
+
before_action :set_lists
|
7
|
+
|
4
8
|
def index
|
5
9
|
authorize! :email_conversations_index, IshManager::Ability
|
6
10
|
@email_conversations = ::Office::EmailConversation.all.order_by( latest_date: :desc )
|
7
|
-
|
8
11
|
end
|
9
12
|
|
10
13
|
def show
|
11
14
|
authorize! :email_conversations_show, IshManager::Ability
|
12
15
|
@email_conversation = ::Office::EmailConversation.find( params[:id] )
|
13
|
-
@email_messages = @email_conversation.email_messages.order_by( date: :
|
16
|
+
@email_messages = @email_conversation.email_messages.order_by( date: :asc )
|
17
|
+
@email_conversation.update_attributes({ state: Conv::STATE_READ })
|
14
18
|
end
|
15
19
|
|
16
20
|
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
|
2
|
+
class ::IshManager::EmailFiltersController < ::IshManager::ApplicationController
|
3
|
+
|
4
|
+
# before_action :set_lists
|
5
|
+
|
6
|
+
# alphabetized : )
|
7
|
+
|
8
|
+
def create
|
9
|
+
authorize! :create, Office::EmailFilter
|
10
|
+
@email_filter = Office::EmailFilter.create params[:email_filter].permit!
|
11
|
+
if @email_filter.persisted?
|
12
|
+
flash[:notice] = 'Success'
|
13
|
+
else
|
14
|
+
flash[:alert] = "No luck: #{@email_filter.errors.full_messages.join(', ')}."
|
15
|
+
end
|
16
|
+
redirect_to action: 'index'
|
17
|
+
end
|
18
|
+
|
19
|
+
def edit
|
20
|
+
@email_filter = Office::EmailFilter.find params[:id]
|
21
|
+
authorize! :edit, @email_filter
|
22
|
+
end
|
23
|
+
|
24
|
+
def index
|
25
|
+
authorize! :index, Office::EmailFilter.new
|
26
|
+
@email_filters = Office::EmailFilter.active
|
27
|
+
end
|
28
|
+
|
29
|
+
def new
|
30
|
+
@email_filter = Office::EmailFilter.new
|
31
|
+
authorize! :new, @email_filter
|
32
|
+
end
|
33
|
+
|
34
|
+
def update
|
35
|
+
@email_filter = Office::EmailFilter.find params[:id]
|
36
|
+
authorize! :update, @email_filter
|
37
|
+
@email_filter.update_attributes( params[:email_filter].permit! )
|
38
|
+
if @email_filter.persisted?
|
39
|
+
flash[:notice] = 'Success'
|
40
|
+
else
|
41
|
+
flash[:alert] = "No luck: #{@email_filter.errors.full_messages.join(', ')}."
|
42
|
+
end
|
43
|
+
redirect_to action: 'index'
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
@@ -3,7 +3,7 @@ class ::IshManager::EmailMessagesController < IshManager::ApplicationController
|
|
3
3
|
|
4
4
|
def index
|
5
5
|
authorize! :email_messages_index, IshManager::Ability
|
6
|
-
@email_messages = Office::EmailMessage.all
|
6
|
+
@email_messages = Office::EmailMessage.all.order_by( date: :desc )
|
7
7
|
end
|
8
8
|
|
9
9
|
def show
|
@@ -1,6 +1,8 @@
|
|
1
1
|
|
2
2
|
class ::IshManager::EmailTemplatesController < ::IshManager::ApplicationController
|
3
3
|
|
4
|
+
# before_action :set_lists, only: %i| new |
|
5
|
+
|
4
6
|
def create
|
5
7
|
authorize! :create, ::Ish::EmailTemplate
|
6
8
|
template = ::Ish::EmailTemplate.create params[:ish_email_template].permit!
|
@@ -24,30 +26,37 @@ class ::IshManager::EmailTemplatesController < ::IshManager::ApplicationControll
|
|
24
26
|
end
|
25
27
|
|
26
28
|
def edit
|
27
|
-
@
|
28
|
-
authorize! :edit, @
|
29
|
+
@tmpl = @email_template = Ish::EmailTemplate.where({ id: params[:id] }).first
|
30
|
+
authorize! :edit, @tmpl
|
31
|
+
|
32
|
+
# @ctx = @email_context = Ish::EmailContext.new
|
33
|
+
render layout: 'ish_manager/application_fullwidth'
|
29
34
|
end
|
30
35
|
|
31
36
|
def iframe_src
|
32
|
-
|
33
|
-
@email_template = Ish::EmailTemplate.where({ id: params[:id] }).first ||
|
37
|
+
@tmpl = @email_template = Ish::EmailTemplate.where({ id: params[:id] }).first ||
|
34
38
|
Ish::EmailTemplate.find_by({ slug: params[:id] })
|
35
|
-
|
39
|
+
authorize! :iframe_src, @email_template
|
36
40
|
render layout: false
|
37
41
|
end
|
38
42
|
|
39
43
|
def index
|
40
44
|
authorize! :index, Ish::EmailTemplate
|
41
|
-
@templates = Ish::EmailTemplate.all.page( params[:templates_page] )
|
45
|
+
@templates = Ish::EmailTemplate.all.order_by( slug: :asc ).page( params[:templates_page] )
|
46
|
+
end
|
47
|
+
|
48
|
+
def new
|
49
|
+
@new_email_template = Ish::EmailTemplate.new
|
50
|
+
authorize! :new, Ish::EmailTemplate
|
42
51
|
end
|
43
52
|
|
44
53
|
def show
|
45
54
|
authorize! :show, Ish::EmailTemplate
|
46
55
|
@templates = Ish::EmailTemplate.all.page( params[:templates_page] )
|
47
56
|
|
48
|
-
@email_template = Ish::EmailTemplate.where({ id: params[:id] }).first ||
|
57
|
+
@tmpl = @email_template = Ish::EmailTemplate.where({ id: params[:id] }).first ||
|
49
58
|
Ish::EmailTemplate.find_by({ slug: params[:id] })
|
50
|
-
@
|
59
|
+
@ctx = @email_context = ::Ish::EmailContext.new({ body: Ish::LoremIpsum.html })
|
51
60
|
end
|
52
61
|
|
53
62
|
def update
|
@@ -56,11 +65,15 @@ class ::IshManager::EmailTemplatesController < ::IshManager::ApplicationControll
|
|
56
65
|
flag = @template.update_attributes( params[:ish_email_template].permit! )
|
57
66
|
if flag
|
58
67
|
flash[:notice] = 'Success.'
|
59
|
-
redirect_to action: 'index'
|
60
68
|
else
|
61
69
|
flash[:alert] = "No luck. #{@template.errors.full_messages.join(', ')}"
|
62
|
-
render :edit
|
63
70
|
end
|
71
|
+
redirect_to action: :edit
|
64
72
|
end
|
65
73
|
|
74
|
+
##
|
75
|
+
## private
|
76
|
+
##
|
77
|
+
private
|
78
|
+
|
66
79
|
end
|