ish_manager 0.1.8.408 → 0.1.8.409

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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/ish_manager/application.js +4 -1
  3. data/app/assets/stylesheets/ish_manager/application.scss +8 -2
  4. data/app/assets/stylesheets/ish_manager/iro.scss +229 -1
  5. data/app/controllers/ish_manager/application_controller.rb +11 -3
  6. data/app/controllers/ish_manager/email_campaigns_controller.rb +23 -23
  7. data/app/controllers/ish_manager/iro_positions_controller.rb +4 -5
  8. data/app/controllers/ish_manager/iro_purses_controller.rb +42 -4
  9. data/app/controllers/ish_manager/leads_controller.rb +1 -1
  10. data/app/mailers/ish_manager/office_mailer.rb +4 -1
  11. data/app/views/ish_manager/application/_main_header_admin.haml +26 -18
  12. data/app/views/ish_manager/email_campaigns/_form.haml +33 -0
  13. data/app/views/ish_manager/email_campaigns/edit.haml +5 -0
  14. data/app/views/ish_manager/email_campaigns/index.haml +10 -0
  15. data/app/views/ish_manager/email_campaigns/new.haml +5 -0
  16. data/app/views/ish_manager/email_campaigns/show.haml +23 -0
  17. data/app/views/ish_manager/email_contexts/_index.haml +8 -0
  18. data/app/views/ish_manager/galleries/edit.haml +5 -4
  19. data/app/views/ish_manager/galleries/new.haml +5 -5
  20. data/app/views/ish_manager/iro_positions/_form.haml +3 -1
  21. data/app/views/ish_manager/iro_purses/_form.haml +11 -0
  22. data/app/views/ish_manager/iro_purses/edit.haml +3 -0
  23. data/app/views/ish_manager/iro_purses/new.haml +3 -0
  24. data/app/views/ish_manager/iro_purses/show.haml +12 -3
  25. data/app/views/ish_manager/iro_purses/show_gameui.haml +139 -0
  26. data/app/views/ish_manager/leads/index.haml +1 -1
  27. data/config/routes.rb +11 -9
  28. metadata +12 -27
  29. data/app/assets/javascripts/ish_manager/trash/application_materialize.js +0 -8
  30. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/AUTHORS.txt +0 -333
  31. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/LICENSE.txt +0 -43
  32. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/external/jquery/jquery.js +0 -11008
  33. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/images/ui-icons_444444_256x240.png +0 -0
  34. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/images/ui-icons_555555_256x240.png +0 -0
  35. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/images/ui-icons_777620_256x240.png +0 -0
  36. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/images/ui-icons_777777_256x240.png +0 -0
  37. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/images/ui-icons_cc0000_256x240.png +0 -0
  38. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/images/ui-icons_ffffff_256x240.png +0 -0
  39. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/index.html +0 -559
  40. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/jquery-ui.css +0 -1312
  41. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/jquery-ui.js +0 -18706
  42. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/jquery-ui.min.css +0 -7
  43. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/jquery-ui.min.js +0 -13
  44. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/jquery-ui.structure.css +0 -886
  45. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/jquery-ui.structure.min.css +0 -5
  46. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/jquery-ui.theme.css +0 -443
  47. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/jquery-ui.theme.min.css +0 -5
  48. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/package.json +0 -74
  49. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1.zip +0 -0
  50. data/app/assets/javascripts/ish_manager/trash/materialize.js +0 -10000
  51. data/app/assets/stylesheets/ish_manager/trash/bootstrap.css +0 -6757
  52. data/app/assets/stylesheets/ish_manager/trash/materialize.css +0 -9390
  53. data/app/assets/stylesheets/ish_manager/trash/reset.css +0 -96
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf3d7c68be921a90644c3f158f0873a5db4d5dc44932da10a73d13bde9f0d018
4
- data.tar.gz: 99db7fb659636ca52a848953cbb5d978e36d4d2c5239b4ef578ba3bd84f35360
3
+ metadata.gz: 35e214ef8b9358e97dbe5a9f8c6be29e9756c91869863866fd78bac6768d78ca
4
+ data.tar.gz: 1fde4720f0b027748ff3532c734bcd41a85d0d4b292e791c3c937cc4ac0a4039
5
5
  SHA512:
6
- metadata.gz: 854daef4bf1d14994b09369fec6ace543eaca5b5d490b8e1ce9aedf56d508ee8b177951dcdc8040842fcbd066301847f5d99ef103848079ea8728eb3a96ea308
7
- data.tar.gz: d552b63ad9e052697fd6e39316c69a5e87d7eb6622b855ccee94d2c894628cd3e6e759e0106b6e286baad7daf14cececed44aba047e3e807fa3a5809aeda7e60
6
+ metadata.gz: a3543f013ba24ae077c4c7dd378e7851e5b3fc2a9a639e06a60c8b7a5e92a0bf8d9ce151c7c7f17f8e973887bb1a28b07318c1d5594a6378275f3c66a5ee9b13
7
+ data.tar.gz: 47299647863950ee9352ce357f9b393314791fbf832f75a564da4a4e5c88db1ba64aba27b1ad49d1369cb02cef8ff5534f661b255f00ca3e92bdee2691b58ae7
@@ -102,7 +102,8 @@ $(function () {
102
102
  const thisId = $(this).attr('id')
103
103
  const state = localStorage.getItem("collapse-expand#"+thisId)
104
104
  if (state === 'collapsed') {
105
- $(this).next().slideToggle();
105
+ $(this).next().slideToggle()
106
+ $(this).addClass('collapsed')
106
107
  }
107
108
  })
108
109
  $(".collapse-expand").click(function (_e) {
@@ -110,8 +111,10 @@ $(function () {
110
111
  const state = localStorage.getItem("collapse-expand#"+thisId)
111
112
  if (state === 'collapsed') {
112
113
  localStorage.removeItem("collapse-expand#"+thisId)
114
+ $(this).removeClass('collapsed')
113
115
  } else {
114
116
  localStorage.setItem("collapse-expand#"+thisId, "collapsed")
117
+ $(this).addClass('collapsed')
115
118
  }
116
119
  $(this).next().slideToggle();
117
120
  }).children().click(function (e) {
@@ -84,7 +84,10 @@ ul:not(.browser-default).bullets, {
84
84
  /* A */
85
85
 
86
86
  .collapse-expand::after {
87
- content: " [<>]";
87
+ content: " [<]";
88
+ }
89
+ .collapsed::after {
90
+ content: " [>]";
88
91
  }
89
92
  .expand-next + form {
90
93
  // border: 1px solid red !important;
@@ -294,7 +297,8 @@ textarea.large {
294
297
  border-bottom: 2px solid red;
295
298
  margin-bottom: 1em;
296
299
 
297
- a {
300
+ a,
301
+ span.label {
298
302
  background: white;
299
303
  padding: .2em;
300
304
  }
@@ -319,6 +323,8 @@ textarea.large {
319
323
  }
320
324
  }
321
325
  }
326
+
327
+
322
328
  }
323
329
  @media only screen and (max-width: 400px) {
324
330
  .main-header ul li {
@@ -1,4 +1,11 @@
1
1
 
2
+ .iro-purses--form {
3
+ textarea {
4
+ min-width: 500px;
5
+ min-height: 500px;
6
+ }
7
+ }
8
+
2
9
  .iro-purses-show {
3
10
  font-size: 14px;
4
11
 
@@ -104,4 +111,225 @@
104
111
  display: flex;
105
112
  justify-content: space-between;
106
113
  }
107
- }
114
+ }
115
+
116
+ .gameuiW {
117
+ border: 1px solid cyan;
118
+ border-radius: 0.5em;
119
+
120
+ position: relative;
121
+
122
+ margin-bottom: 100px;
123
+
124
+ width: 1000px;
125
+ height: 200px;
126
+
127
+ z-index: 0;
128
+
129
+ .elephant {
130
+ // border: 2px solid yellow;
131
+
132
+ background-image: url('https://d15g8hc4183yn4.cloudfront.net/wp-content/uploads/2023/04/04103931/200x125-elephant-1rmTiny.png');
133
+ width: 200px;
134
+ height: 125px;
135
+
136
+ position: absolute;
137
+
138
+ left: 700px;
139
+ bottom: 0;
140
+
141
+ &::after { /* arrow-up */
142
+ content: "";
143
+ position: absolute;
144
+ bottom: 0;
145
+ right: calc( 50% - 25px );
146
+
147
+ width: 0;
148
+ height: 0;
149
+ border-left: 25px solid transparent;
150
+ border-right: 25px solid transparent;
151
+
152
+ border-bottom: 25px solid red;
153
+ }
154
+ }
155
+
156
+ .elephantNext {
157
+ // border: 5px solid white;
158
+ border-radius: 50%;
159
+
160
+ display: none;
161
+
162
+ position: absolute;
163
+ bottom: -50px;
164
+ margin-left: 50px;
165
+ transform: scale(1.2);
166
+ opacity: 0.33;
167
+ background-color: green;
168
+
169
+ }
170
+
171
+ .grid {
172
+ background: url('https://d15g8hc4183yn4.cloudfront.net/wp-content/uploads/2023/04/04110701/500x250-gridTiny.png');
173
+ background-size: 100%;
174
+ background-position: bottom center;
175
+
176
+ width: 1000px;
177
+ height: 200px;
178
+
179
+ position: absolute;
180
+ bottom: 0;
181
+ left: 0;
182
+
183
+ z-index: -1;
184
+ }
185
+
186
+ .ground {
187
+ border-bottom: 5px solid gray;
188
+
189
+ position: absolute;
190
+ left: 0;
191
+ right: 0;
192
+ top: 100%;
193
+ bottom: -50px;
194
+
195
+ background: gray;
196
+ }
197
+
198
+ .groundedW {
199
+ position: absolute;
200
+
201
+ right: -250px;
202
+ bottom: 0;
203
+
204
+ .grounded {
205
+ border: 2px solid pink;
206
+ background: rgba(255,255,255, 0.75);
207
+ border-radius: 50%;
208
+
209
+ width: 100px;
210
+ height: 100px;
211
+
212
+ background-image: url('https://d15g8hc4183yn4.cloudfront.net/wp-content/uploads/2023/04/04105933/200x200-spearman-rmTiny.png');
213
+ background-size: cover;
214
+
215
+ .groundedStart {
216
+ // border: 2px solid white;
217
+ position: absolute;
218
+ background: #999;
219
+ bottom: 50px;
220
+ top: 11px;
221
+ left: 50%;
222
+ right: -40px;
223
+
224
+ z-index: -1;
225
+ }
226
+
227
+ .groundedCurrent {
228
+ position: absolute;
229
+ background: red;
230
+ bottom: 45px;
231
+ top: 52px;
232
+ left: 50%;
233
+ right: -30px;
234
+ }
235
+ }
236
+ }
237
+
238
+ .spearmanW {
239
+ border: 2px solid yellow;
240
+
241
+ position: absolute;
242
+ display: inline-block;
243
+
244
+ left: 800px;
245
+
246
+ .spearman {
247
+ // border: 2px solid orange;
248
+ background: rgba(255,255,255, 0.75);
249
+ border-radius: 50%;
250
+
251
+ background-image: url('https://d15g8hc4183yn4.cloudfront.net/wp-content/uploads/2023/04/04105933/200x200-spearman-rmTiny.png');
252
+ background-size: cover;
253
+
254
+ width: 100px;
255
+ height: 100px;
256
+
257
+ position: absolute;
258
+ left: -50px;
259
+
260
+ // &::after { /* arrow-up */
261
+ // content: "";
262
+ // position: absolute;
263
+ // bottom: 0;
264
+ // right: calc( 50% - 25px );
265
+
266
+ // width: 0;
267
+ // height: 0;
268
+ // border-left: 25px solid transparent;
269
+ // border-right: 25px solid transparent;
270
+
271
+ // border-bottom: 25px solid red;
272
+ // }
273
+
274
+ .spearmanStart {
275
+ position: absolute;
276
+ background: #999;
277
+ bottom: 50px;
278
+ top: 11px;
279
+ right: 50%;
280
+ left: -134px;
281
+
282
+ z-index: -1;
283
+ }
284
+
285
+ .spearmanCurrent {
286
+ position: absolute;
287
+ background: red;
288
+ bottom: 45px;
289
+ top: 52px;
290
+ right: 50%;
291
+ left: -97px;
292
+ }
293
+ }
294
+ }
295
+
296
+ .windW {
297
+ // border: 2px solid blue;
298
+
299
+ position: absolute;
300
+ left: 910px; /* ( <price> - 20 ) * 200 */
301
+ bottom: 0;
302
+
303
+ &::after { /* arrow-up */
304
+ border-bottom: 25px solid yellow;
305
+
306
+ content: "";
307
+ position: absolute;
308
+ bottom: 0;
309
+ // right: 50%;
310
+ left: -25px;
311
+
312
+ // width: 0;
313
+ // height: 0;
314
+ border-left: 25px solid transparent;
315
+ border-right: 25px solid transparent;
316
+ }
317
+
318
+ .wind {
319
+
320
+ background-image: url('https://d15g8hc4183yn4.cloudfront.net/wp-content/uploads/2023/04/04104623/200x200-windTiny.png');
321
+ background-position: bottom center;
322
+
323
+ opacity: 0.5;
324
+
325
+ width: 200px;
326
+ height: 200px;
327
+
328
+ margin-left: -25px;
329
+
330
+ .windC {
331
+ }
332
+ }
333
+ }
334
+
335
+ }
@@ -23,9 +23,9 @@ class IshManager::ApplicationController < ActionController::Base
23
23
  render 'home'
24
24
  end
25
25
 
26
- #
27
- # private
28
- #
26
+ ##
27
+ ## private
28
+ ##
29
29
  private
30
30
 
31
31
  def access_denied exception
@@ -33,6 +33,13 @@ class IshManager::ApplicationController < ActionController::Base
33
33
  redirect_to user_signed_in? ? root_path : Rails.application.routes.url_helpers.new_user_session_path, :alert => exception.message
34
34
  end
35
35
 
36
+ def current_profile
37
+ return @current_profile if @current_profile
38
+ if current_user&.email
39
+ return @current_profile = Ish::UserProfile.find_by({ email: current_user.email })
40
+ end
41
+ end
42
+
36
43
  def encode(payload, exp = 48.hours.from_now) # @TODO: definitely change, right now I expire once in 2 days.
37
44
  payload[:exp] = exp.to_i
38
45
  JWT.encode(payload, Rails.application.secrets.secret_key_base.to_s)
@@ -66,6 +73,7 @@ class IshManager::ApplicationController < ActionController::Base
66
73
  def set_lists
67
74
  @blank_template = Tmpl.new
68
75
 
76
+ @email_campaigns_list = [[nil,nil]] + Ish::EmailCampaign.all.map { |c| [ c.slug, c.id ] }
69
77
  @email_actions_list = [[nil,nil]] + Office::EmailAction.all.map { |a| [ a.slug, a.id ] }
70
78
  @email_templates_list = [[nil,nil]] + Ish::EmailTemplate.all.map { |t| [ t.slug, t.id ] }
71
79
  @galleries_list = Gallery.all.list
@@ -1,37 +1,20 @@
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
4
+ before_action :set_lists
16
5
 
17
6
  def index
18
7
  authorize! :index, Ish::EmailCampaign
19
- @campaigns = Ish::EmailCampaign.where( :profile => @current_profile, :is_trash => false )
20
- if params[:is_done]
21
- @campaigns = @campaigns.where( :is_done => true )
22
- else
23
- @campaigns = @campaigns.where( :is_done => false )
24
- end
8
+ @campaigns = Ish::EmailCampaign.all
25
9
  end
26
10
 
27
11
  def new
28
- @new_campaign = Ish::EmailCampaign.new
29
- authorize! :new, @new_campaign
12
+ @campaign = Ish::EmailCampaign.new
13
+ authorize! :new, @campaign
30
14
  end
31
15
 
32
16
  def create
33
17
  @campaign = Ish::EmailCampaign.new params[:campaign].permit!
34
- @campaign.profile = @current_profile
35
18
  authorize! :create, @campaign
36
19
  if @campaign.save
37
20
  flash[:notice] = "created campaign"
@@ -41,9 +24,26 @@ class ::IshManager::EmailCampaignsController < IshManager::ApplicationController
41
24
  redirect_to :action => 'index'
42
25
  end
43
26
 
27
+ def do_send
28
+ @campaign = Ish::EmailCampaign.find params[:id]
29
+ authorize! :send, @campaign
30
+ @campaign.leads.each do |lead|
31
+ tmpl = @campaign.email_template
32
+
33
+ ctx = Ctx.create!({
34
+ email_template: tmpl,
35
+ send_at: Time.now,
36
+ lead_id: lead.id,
37
+ from_email: tmpl.from_email,
38
+ subject: tmpl.subject,
39
+ })
40
+ end
41
+
42
+ end
43
+
44
44
  def show
45
- authorize! :redirect, IshManager::Ability
46
- redirect_to :action => :edit, :id => params[:id]
45
+ @campaign = Ish::EmailCampaign.find params[:id]
46
+ authorize! :show, @campaign
47
47
  end
48
48
 
49
49
  def edit
@@ -5,14 +5,13 @@ class ::IshManager::IroPositionsController < IshManager::ApplicationController
5
5
 
6
6
  def create
7
7
  @position = Iro::Position.new({
8
- iro_purse: @purse = Iro::Purse.find_or_create_by({ user_id: current_user.id }),
9
8
  type: 'Iro::CoveredCall',
10
9
  })
11
10
  authorize! :update, @position
12
11
 
13
- if @position.update params[:position].permit!
12
+ if @position.update params[:iro_position].permit!
14
13
  flash[:notice] = 'Successfully updated position.'
15
- redirect_to controller: 'iro_purses', action: :show
14
+ redirect_to controller: 'iro_purses', action: :show, id: params[:iro_position][:iro_purse_id]
16
15
  else
17
16
  flash[:alert] = "Cannot update position: #{@position.errors.full_messages.join(', ')}."
18
17
  render action: 'edit'
@@ -33,9 +32,9 @@ class ::IshManager::IroPositionsController < IshManager::ApplicationController
33
32
  @position = Iro::Position.find params[:id]
34
33
  authorize! :update, @position
35
34
 
36
- if @position.update params[:position].permit!
35
+ if @position.update params[:iro_position].permit!
37
36
  flash[:notice] = 'Successfully updated position.'
38
- redirect_to controller: 'iro_purses', action: :show
37
+ redirect_to controller: 'iro_purses', action: :show, id: @position[:iro_purse_id]
39
38
  else
40
39
  flash[:alert] = "Cannot update position: #{@position.errors.full_messages.join(', ')}."
41
40
  render action: 'edit'
@@ -3,13 +3,36 @@ class ::IshManager::IroPursesController < IshManager::ApplicationController
3
3
 
4
4
  before_action :set_lists
5
5
 
6
+ def create
7
+ @iro_purse = Iro::Purse.new({
8
+ profile_id: current_profile.id,
9
+ })
10
+ authorize! :create, @iro_purse
11
+
12
+ if @iro_purse.update params[:iro_purse].permit!
13
+ flash[:notice] = 'Successfully created iro_purse.'
14
+ redirect_to action: :show, id: @iro_purse.id
15
+ else
16
+ flash[:alert] = "Cannot create iro_purse: #{@iro_purse.errors.full_messages.join(', ')}."
17
+ render action: 'edit'
18
+ end
19
+ end
20
+
21
+ def edit
22
+ @iro_purse = Iro::Purse.find params[:id]
23
+ authorize! :edit, @iro_purse
24
+ end
25
+
26
+ def new
27
+ @iro_purse = Iro::Purse.new
28
+ authorize! :new, @iro_purse
29
+ end
30
+
6
31
  def show
7
- @purse = Iro::Purse.find_or_create_by({ user_id: current_user.id })
32
+ @purse = Iro::Purse.find params[:id]
8
33
  authorize! :my, @purse
9
34
 
10
- @strategies = Iro::CoveredCallStrategy.where({
11
- iro_purse_id: Iro::Purse.find_by( user_id: current_user.id ).id,
12
- })
35
+ @strategies = @purse.strategies
13
36
 
14
37
  underlyings = Tda::Stock.get_quotes( @strategies.map(&:ticker).compact.uniq.join(",") )
15
38
  # json_puts! underlyings, 'out'
@@ -19,6 +42,21 @@ class ::IshManager::IroPursesController < IshManager::ApplicationController
19
42
 
20
43
  @positions = @purse.positions.order({ expires_on: :asc, strike: :asc })
21
44
  @positions.map &:refresh
45
+
46
+ render @purse.parsed_config[:kind] || 'show'
47
+ end
48
+
49
+ def update
50
+ @iro_purse = Iro::Purse.find params[:id]
51
+ authorize! :update, @iro_purse
52
+
53
+ if @iro_purse.update params[:iro_purse].permit!
54
+ flash[:notice] = 'Successfully updated iro_purse.'
55
+ redirect_to action: :show, id: @iro_purse.id
56
+ else
57
+ flash[:alert] = "Cannot update iro_purse: #{@iro_purse.errors.full_messages.join(', ')}."
58
+ render action: 'edit'
59
+ end
22
60
  end
23
61
 
24
62
  end
@@ -9,7 +9,7 @@ class ::IshManager::LeadsController < IshManager::ApplicationController
9
9
  authorize! :bulkop, ::Lead
10
10
  case params[:op]
11
11
  when Lead::OP_ADD_TO_CAMPAIGN
12
- c = EmailCampaign.find params[:email_campaign_id]
12
+ c = Ish::EmailCampaign.find params[:email_campaign_id]
13
13
  params[:lead_ids].each do |lead_id|
14
14
  c_lead = EmailCampaignLead.new( lead_id: lead_id, email_campaign_id: c.id )
15
15
  flag = c_lead.save
@@ -61,7 +61,10 @@ class IshManager::OfficeMailer < IshManager::ApplicationMailer
61
61
  ac.instance_variable_set( :@ctx, @ctx )
62
62
 
63
63
  rendered_str = ac.render_to_string("ish_manager/email_templates/_#{@ctx.tmpl.layout}")
64
- @ctx.update( rendered_str: rendered_str, sent_at: Time.now.to_s )
64
+ @ctx.update({
65
+ rendered_str: rendered_str,
66
+ sent_at: Time.now.to_s,
67
+ })
65
68
 
66
69
  mail( from: @ctx.from_email,
67
70
  to: @ctx.to_email,
@@ -27,18 +27,18 @@
27
27
  %ul
28
28
  %li= link_to '+Newsitem', new_newsitem_path
29
29
  %li
30
- = link_to 'Ish::UserProfiles', user_profiles_path
30
+ = link_to 'Profiles', user_profiles_path
31
31
  .inline-search
32
32
  = form_tag user_profiles_path, method: :get do
33
33
  = text_field_tag :q
34
- %li= link_to "Ish::ImageAsset's", image_assets_path
34
+
35
35
  %li
36
36
  = link_to 'Locations', maps_path
37
37
  .inline-search
38
38
  = form_tag maps_path, method: :get do
39
39
  = text_field_tag :q
40
40
  = link_to '[+]', new_map_path
41
- %ul
41
+
42
42
  %li
43
43
  = link_to 'Events', events_path
44
44
  .inline-search
@@ -58,30 +58,35 @@
58
58
  = link_to "Templates (#{Ish::EmailTemplate.all.count})", email_templates_path
59
59
  = link_to '[+]', new_email_template_path
60
60
  %li
61
- = link_to "Contexts (#{Ctx.notsent.length})", notsent_email_contexts_path
62
- = link_to '[+]', new_email_context_path
63
- -# %li
64
- -# = link_to 'Campaigns', email_campaigns_path
65
- -# = link_to '[+]', new_email_campaign_path
61
+ = link_to "Companies (#{Leadset.kept.length})", leadsets_path
62
+ = link_to '[+]', new_leadset_path
63
+
66
64
 
67
65
  %li
68
- = link_to "Sch (#{Sch.active.length})", scheduled_email_actions_path
69
- = link_to '[+]', new_scheduled_email_action_path
70
66
  = link_to "Email Actions (#{Office::EmailAction.all.length})", email_actions_path
71
67
  = link_to '[+]', new_email_action_path
72
68
  %ul
73
- %li &nbsp;
74
-
75
69
  %li
76
- = link_to "Co's (#{Leadset.kept.length})", leadsets_path
77
- = link_to '[+]', new_leadset_path
70
+ = link_to "Filters (#{Office::EmailFilter.active.length})", email_filters_path
71
+ = link_to '[+]', new_email_filter_path
72
+ %li
73
+ = link_to "Contexts (#{Ctx.notsent.length})", notsent_email_contexts_path
74
+ = link_to '[+]', new_email_context_path
75
+
78
76
  %li
79
77
  = link_to "Leads (#{Lead.kept.length})", leads_path
80
78
  = link_to '[+]', new_lead_path
81
-
82
79
  %li
83
- = link_to "Filters (#{Office::EmailFilter.active.length})", email_filters_path
84
- = link_to '[+]', new_email_filter_path
80
+ = link_to "Schs (#{Sch.active.length})", scheduled_email_actions_path
81
+ = link_to '[+]', new_scheduled_email_action_path
82
+ %ul
83
+ %li &nbsp;
84
+ %li &nbsp;
85
+ %li
86
+ = link_to 'Campaigns', email_campaigns_path
87
+ = link_to '[+]', new_email_campaign_path
88
+ %li &nbsp;
89
+
85
90
  .c
86
91
 
87
92
  %i.fa.fa-compress.collapse-expand#collapseHeaderIro
@@ -89,7 +94,10 @@
89
94
  .a
90
95
  %ul
91
96
  %li
92
- = link_to 'Purse', my_purse_path
97
+ %span.label Purses:
98
+ - Iro::Purse.all.map do |p|
99
+ = link_to "[#{p.id}]", iro_purse_path(p)
100
+ = link_to '[+]', new_iro_purse_path
93
101
  %li
94
102
  = link_to 'Watches', iro_watches_path
95
103
  %li
@@ -0,0 +1,33 @@
1
+
2
+ - url = campaign.new_record? ? email_campaigns_path : email_campaign_path(campaign)
3
+
4
+ .email-campaigns--form
5
+ = form_for campaign, as: :campaign, url: url do |f|
6
+ .field
7
+ = f.label :slug
8
+ = f.text_field :slug
9
+
10
+ .field
11
+ = f.label :send_at
12
+ = f.text_field :send_at
13
+
14
+ .field.field-template
15
+ = f.label "Template"
16
+ = f.select :email_template_id, options_for_select(@email_templates_list, selected: params[:email_template_id] || campaign.email_template_id ), {}, { class: 'select2' }
17
+ - if campaign.email_template_id
18
+ = link_to 'view', email_template_path( campaign.email_template_id ), target: :_blank, class: [ 'action-view' ]
19
+ = link_to '~', edit_email_template_path( campaign.email_template_id ), target: :_blank, class: [ 'action-view' ]
20
+ layout: #{campaign.tmpl.layout}
21
+
22
+ .field
23
+ = f.label "From"
24
+ = f.select :from_email, options_for_select(Ish::EmailContext.from_email_list, selected: campaign.from_email)
25
+
26
+ .actions
27
+ = f.submit 'Submit'
28
+
29
+ -# = f.select :email_template_id, options_for_select(@email_templates_list, selected: params[:email_template_id] || campaign.email_template_id ), {}, { class: 'select2' }
30
+ -# - if campaign.email_template_id
31
+ -# = link_to 'view', email_template_path( campaign.email_template_id ), target: :_blank, class: [ 'action-view' ]
32
+ -# = link_to '~', edit_email_template_path( campaign.email_template_id ), target: :_blank, class: [ 'action-view' ]
33
+ -# layout: #{campaign.tmpl.layout}
@@ -0,0 +1,5 @@
1
+
2
+ .email-campaigns-new.max-width
3
+ .header
4
+ %h3.title Edit Email Campaign
5
+ = render 'form', campaign: @campaign
@@ -0,0 +1,10 @@
1
+
2
+ .email-campaigns-index.max-width
3
+ .header
4
+ .title
5
+ Email Campaigns (#{@campaigns.length})
6
+ = link_to '[+]', new_email_campaign_path
7
+
8
+ - @campaigns.each do |c|
9
+ = link_to c.slug, email_campaign_path(c)
10
+
@@ -0,0 +1,5 @@
1
+
2
+ .email-campaigns-new.max-width
3
+ .header
4
+ %h3.title New Email Campaign
5
+ = render 'form', campaign: @campaign
@@ -0,0 +1,23 @@
1
+
2
+ .email-campaigns-show.max-width
3
+ .header
4
+ %h5.title
5
+ Email Campaign `#{@campaign.slug}`
6
+ = link_to '[~]', edit_email_campaign_path(@campaign)
7
+ .inline-block
8
+ = form_for @campaign, as: :campaign, method: :post, url: send_email_campaign_path(@campaign) do |f|
9
+ = hidden_field_tag 'campaign[send_at]', Time.now
10
+ = f.submit 'Send', data: { confirm: 'Are you sure?' }
11
+
12
+ %ul.browser-default
13
+ %li Template: #{link_to @campaign.email_template.slug, edit_email_template_path(@campaign.email_template)}
14
+ -# %li Send At: #{@campaign.send_at}
15
+
16
+ .collapse-expand#campaignLeads Email Campaign leads (#{@campaign.campaign_leads.length})
17
+ %ul.email-campaign-leads.items.browser-default
18
+ - @campaign.leads.each do |lead|
19
+ %li.item
20
+ = lead.email
21
+ Ctxs:
22
+ = render 'ish_manager/email_contexts/index', ctxs: lead.email_contexts
23
+