ish_manager 0.1.8.408 → 0.1.8.410

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/ish_manager/application.js +7 -1
  3. data/app/assets/stylesheets/ish_manager/application.scss +32 -17
  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/_alerts_notices.haml +7 -12
  12. data/app/views/ish_manager/application/_main_header_admin.haml +26 -18
  13. data/app/views/ish_manager/email_campaigns/_form.haml +33 -0
  14. data/app/views/ish_manager/email_campaigns/edit.haml +5 -0
  15. data/app/views/ish_manager/email_campaigns/index.haml +10 -0
  16. data/app/views/ish_manager/email_campaigns/new.haml +5 -0
  17. data/app/views/ish_manager/email_campaigns/show.haml +23 -0
  18. data/app/views/ish_manager/email_contexts/_index.haml +8 -0
  19. data/app/views/ish_manager/email_filters/_form.haml +6 -0
  20. data/app/views/ish_manager/email_filters/edit.haml +1 -1
  21. data/app/views/ish_manager/email_filters/index.haml +3 -1
  22. data/app/views/ish_manager/email_filters/new.haml +1 -1
  23. data/app/views/ish_manager/galleries/edit.haml +5 -4
  24. data/app/views/ish_manager/galleries/new.haml +5 -5
  25. data/app/views/ish_manager/iro_positions/_form.haml +3 -1
  26. data/app/views/ish_manager/iro_purses/_form.haml +11 -0
  27. data/app/views/ish_manager/iro_purses/edit.haml +3 -0
  28. data/app/views/ish_manager/iro_purses/new.haml +3 -0
  29. data/app/views/ish_manager/iro_purses/show.haml +12 -3
  30. data/app/views/ish_manager/iro_purses/show_gameui.haml +139 -0
  31. data/app/views/ish_manager/leads/index.haml +1 -1
  32. data/config/routes.rb +11 -9
  33. metadata +12 -27
  34. data/app/assets/javascripts/ish_manager/trash/application_materialize.js +0 -8
  35. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/AUTHORS.txt +0 -333
  36. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/LICENSE.txt +0 -43
  37. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/external/jquery/jquery.js +0 -11008
  38. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/images/ui-icons_444444_256x240.png +0 -0
  39. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/images/ui-icons_555555_256x240.png +0 -0
  40. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/images/ui-icons_777620_256x240.png +0 -0
  41. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/images/ui-icons_777777_256x240.png +0 -0
  42. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/images/ui-icons_cc0000_256x240.png +0 -0
  43. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/images/ui-icons_ffffff_256x240.png +0 -0
  44. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/index.html +0 -559
  45. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/jquery-ui.css +0 -1312
  46. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/jquery-ui.js +0 -18706
  47. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/jquery-ui.min.css +0 -7
  48. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/jquery-ui.min.js +0 -13
  49. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/jquery-ui.structure.css +0 -886
  50. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/jquery-ui.structure.min.css +0 -5
  51. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/jquery-ui.theme.css +0 -443
  52. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/jquery-ui.theme.min.css +0 -5
  53. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1/package.json +0 -74
  54. data/app/assets/javascripts/ish_manager/trash/jquery-ui-1.12.1.zip +0 -0
  55. data/app/assets/javascripts/ish_manager/trash/materialize.js +0 -10000
  56. data/app/assets/stylesheets/ish_manager/trash/bootstrap.css +0 -6757
  57. data/app/assets/stylesheets/ish_manager/trash/materialize.css +0 -9390
  58. 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: 8324ef683622d8aca6298965f060b9f7bb28c8d2ec6bbd99011b34914ccd6b70
4
+ data.tar.gz: af207371888cee567d554cb1f0313fd717399dd42c93fc9b06f3b16fca0212fa
5
5
  SHA512:
6
- metadata.gz: 854daef4bf1d14994b09369fec6ace543eaca5b5d490b8e1ce9aedf56d508ee8b177951dcdc8040842fcbd066301847f5d99ef103848079ea8728eb3a96ea308
7
- data.tar.gz: d552b63ad9e052697fd6e39316c69a5e87d7eb6622b855ccee94d2c894628cd3e6e759e0106b6e286baad7daf14cececed44aba047e3e807fa3a5809aeda7e60
6
+ metadata.gz: 01d1fa18a16bcf11c0f991972eae21b57ed17024b33da5249d5396f85c812e8644448547f2fed3164ba565ee2daa89205b8b047e56d6727ee3f759b51f641d29
7
+ data.tar.gz: bae46a73d36c3bcdfd0f098fd9d75f2e86cab52f6e50a0b8c8eb07810b64ba0f2195f80e51fe87f5af0c4d02974d923612fd74ec7b63d1b2c7f3b83dffde2548
@@ -97,12 +97,16 @@ $(function () {
97
97
  }
98
98
  }
99
99
 
100
+ $(".close").click(function(ev) {
101
+ $(this).parent().slideToggle()
102
+ })
100
103
 
101
104
  $(".collapse-expand").each(function() {
102
105
  const thisId = $(this).attr('id')
103
106
  const state = localStorage.getItem("collapse-expand#"+thisId)
104
107
  if (state === 'collapsed') {
105
- $(this).next().slideToggle();
108
+ $(this).next().slideToggle()
109
+ $(this).addClass('collapsed')
106
110
  }
107
111
  })
108
112
  $(".collapse-expand").click(function (_e) {
@@ -110,8 +114,10 @@ $(function () {
110
114
  const state = localStorage.getItem("collapse-expand#"+thisId)
111
115
  if (state === 'collapsed') {
112
116
  localStorage.removeItem("collapse-expand#"+thisId)
117
+ $(this).removeClass('collapsed')
113
118
  } else {
114
119
  localStorage.setItem("collapse-expand#"+thisId, "collapsed")
120
+ $(this).addClass('collapsed')
115
121
  }
116
122
  $(this).next().slideToggle();
117
123
  }).children().click(function (e) {
@@ -82,23 +82,11 @@ ul:not(.browser-default).bullets, {
82
82
 
83
83
 
84
84
  /* A */
85
-
86
- .collapse-expand::after {
87
- content: " [<>]";
88
- }
89
- .expand-next + form {
90
- // border: 1px solid red !important;
91
- // display: none !important;
92
- }
93
- .expand-hide {
94
- display: none;
95
- position: absolute;
96
- min-width: 250px;
97
- }
98
-
99
85
  .alert {
100
86
  border: 1px solid red;
101
87
  padding: .8em;
88
+ margin: 0.8em;
89
+ position: relative;
102
90
  }
103
91
 
104
92
  .application--debug {
@@ -145,12 +133,11 @@ table.bordered {
145
133
  padding: 0.5em;
146
134
  }
147
135
 
148
- /* B */
149
-
150
136
  .btn {
151
137
  border: 1px solid red;
152
138
  }
153
139
 
140
+
154
141
  /* C */
155
142
 
156
143
  .c {
@@ -168,6 +155,11 @@ table.bordered {
168
155
  text-align: center;
169
156
  }
170
157
 
158
+ .close {
159
+ position: absolute;
160
+ top: 0;
161
+ right: 0;
162
+ }
171
163
 
172
164
  .collapse-expand {
173
165
  cursor: pointer;
@@ -177,6 +169,17 @@ table.bordered {
177
169
  }
178
170
  }
179
171
 
172
+ .collapse-expand::after {
173
+ content: " [<]";
174
+ }
175
+ .collapsed::after {
176
+ content: " [>]";
177
+ }
178
+ .expand-next + form {
179
+ // border: 1px solid red !important;
180
+ // display: none !important;
181
+ }
182
+
180
183
  /* D */
181
184
 
182
185
  table.dataTable {
@@ -196,6 +199,13 @@ table.dataTable {
196
199
  }
197
200
 
198
201
 
202
+
203
+ .expand-hide {
204
+ display: none;
205
+ position: absolute;
206
+ min-width: 250px;
207
+ }
208
+
199
209
  /* E */
200
210
  .eg {
201
211
  font-size: 0.8em;
@@ -294,7 +304,8 @@ textarea.large {
294
304
  border-bottom: 2px solid red;
295
305
  margin-bottom: 1em;
296
306
 
297
- a {
307
+ a,
308
+ span.label {
298
309
  background: white;
299
310
  padding: .2em;
300
311
  }
@@ -319,6 +330,8 @@ textarea.large {
319
330
  }
320
331
  }
321
332
  }
333
+
334
+
322
335
  }
323
336
  @media only screen and (max-width: 400px) {
324
337
  .main-header ul li {
@@ -386,6 +399,8 @@ textarea.large {
386
399
  .notice {
387
400
  border: 1px solid green;
388
401
  padding: .8em;
402
+ margin: 0.8em;
403
+ position: relative;
389
404
  }
390
405
 
391
406
  /* P */
@@ -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,
@@ -2,16 +2,11 @@
2
2
  .row.max-width
3
3
  .col-sm-12
4
4
  - if notice
5
- - if notice.class == Array
6
- %ul.notice
7
- - notice.map do |n|
8
- %li= n
9
- - else
10
- %p.notice= notice
5
+ .notice
6
+ = notice
7
+ .close [x]
11
8
  - if alert
12
- - if alert.class == Array
13
- %ul.alert
14
- - alert.map do |n|
15
- %li= n
16
- - else
17
- %p.alert= alert
9
+ .alert
10
+ = alert
11
+ .close [x]
12
+