ish_manager 0.1.8.415 → 0.1.8.417
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/ish_manager/iro.js +28 -11
- data/app/assets/stylesheets/ish_manager/application.scss +32 -19
- data/app/assets/stylesheets/ish_manager/email.scss +1 -1
- data/app/assets/stylesheets/ish_manager/iro.scss +47 -28
- data/app/controllers/ish_manager/email_campaign_leads_controller.rb +11 -4
- data/app/controllers/ish_manager/email_contexts_controller.rb +1 -4
- data/app/controllers/ish_manager/iro_positions_controller.rb +9 -0
- data/app/controllers/ish_manager/iro_purses_controller.rb +3 -1
- data/app/controllers/ish_manager/iro_strategies_controller.rb +1 -1
- data/app/views/ish_manager/application/_main_header_admin.haml +4 -2
- data/app/views/ish_manager/email_campaigns/show.haml +4 -4
- data/app/views/ish_manager/email_contexts/summary.haml +16 -0
- data/app/views/ish_manager/iro_positions/roll.haml +105 -0
- data/app/views/ish_manager/iro_purses/show.haml +2 -3
- data/app/views/ish_manager/iro_purses/show_gameui.haml +18 -13
- data/app/views/ish_manager/iro_strategies/_form.haml +2 -1
- data/config/routes.rb +2 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c86c3d20e3685be74c51948ab06a216b3d32cf100884db349c38f143c7a1643
|
4
|
+
data.tar.gz: f8273dd42d8050e284a3b2e7d841378b4d7711d4aa8ef8cd7888f3df375e2cd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5deaa5dd2749d2d8583ad7d4a1387af174ebf7e5d4c5f81268195954fe81724010d3c1882805265e14404c4c99d44f9c648dc5e760351a008e9fc72d0152a29d
|
7
|
+
data.tar.gz: b6c71d890bcaf81782786e2f5a2120f9280299223c7fa9993daa79c4fcb32287d330d9d95cfff43ea0090e056ca406da97c82aa5b1a97a0ce3295ba7ea6d81d6
|
@@ -7,18 +7,22 @@ $(document).ready(function () {
|
|
7
7
|
|
8
8
|
|
9
9
|
$(".gameuiW").each( function (idx, w) {
|
10
|
+
// logg($(w).data(), 'data')
|
11
|
+
|
12
|
+
let ans
|
10
13
|
|
11
14
|
let ccStrike = $(w).data('ccStrike')
|
12
15
|
let ccStartPrice = $(w).data('ccStartprice') // e.g. 0.88
|
13
16
|
let ccCurrentPrice = $(w).data('ccCurrentprice')
|
14
|
-
let cUS = $(w).data('
|
17
|
+
let cUS = $(w).data('ccCus')
|
15
18
|
|
16
19
|
$(".c-u-s").each(function (idx, elem) {
|
17
20
|
$(elem).html(cUS)
|
18
21
|
})
|
19
22
|
|
20
23
|
$(".windW").each(function (idx, elem) {
|
21
|
-
|
24
|
+
ans = ( origin - cUS ) * scale
|
25
|
+
$(elem).css('left', ans)
|
22
26
|
})
|
23
27
|
|
24
28
|
$($(w).find('.elephantW')).css('left', (origin - ccStrike)* scale )
|
@@ -28,24 +32,37 @@ $(document).ready(function () {
|
|
28
32
|
$(w).find('.riderStart').css('left', -1 * scale * ccStartPrice )
|
29
33
|
$(w).find('.riderStart2').css('width', scale * ccStartPrice )
|
30
34
|
|
31
|
-
let currentAmount = ((ccStartPrice - ccCurrentPrice)*100).toPrecision(
|
35
|
+
let currentAmount = ((ccStartPrice - ccCurrentPrice)*100).toPrecision(2)/100
|
32
36
|
let ccCurrentGain = ccStartPrice - ccCurrentPrice
|
33
|
-
// logg(ccCurrentGain, 'ccCurrentGain')
|
34
|
-
// logg(currentAmount, 'currentAmount')
|
35
37
|
$(w).find('.riderCurrent > .amount').html( " $" + currentAmount )
|
36
|
-
|
37
|
-
logg(ans, 'ans')
|
38
|
+
ans = `${-1*ccCurrentGain*scale}px`
|
38
39
|
$(w).find('.riderW').css('left', ans)
|
39
40
|
|
40
41
|
if (ccCurrentGain > 0) {
|
41
42
|
$(w).find('.riderCurrent').css('width', scale * ccCurrentGain )
|
42
43
|
} else {
|
43
|
-
|
44
|
-
$(w).find('.
|
45
|
-
$(w).find('.
|
46
|
-
$(w).find('.riderCurrent').css('right', `-${ccCurrentGain*scale}px`)
|
44
|
+
$(w).find('.riderCurrent').css('display', 'none')
|
45
|
+
$(w).find('.riderCurrent2').css('display', 'block')
|
46
|
+
$(w).find('.riderCurrent2').css('width', -1 * scale * ccCurrentGain )
|
47
47
|
$(w).find('.rider').addClass('riderF')
|
48
48
|
}
|
49
49
|
})
|
50
50
|
|
51
|
+
|
52
|
+
|
53
|
+
$(".gameuiW.next-position").each( function (idx, w) {
|
54
|
+
logg($(w).data(), 'next-position')
|
55
|
+
|
56
|
+
let ans
|
57
|
+
|
58
|
+
let gainp = $(w).data('ccGainp')
|
59
|
+
if (gainp > 0) {
|
60
|
+
$(w).find('.elephant').css('border-width', `${gainp*200 + 1}px` )
|
61
|
+
$(w).find('.elephantLoss').css('display', 'none')
|
62
|
+
} else {
|
63
|
+
gainp = -1 * gainp
|
64
|
+
$(w).find('.elephantLoss').css('border-width', `${gainp*200 + 1}px` )
|
65
|
+
}
|
66
|
+
})
|
67
|
+
|
51
68
|
})
|
@@ -155,41 +155,54 @@ table.bordered {
|
|
155
155
|
text-align: center;
|
156
156
|
}
|
157
157
|
|
158
|
-
.chip
|
159
|
-
// .main-header a.chip,
|
160
|
-
._ {
|
161
|
-
margin-right: 20px;
|
158
|
+
.chip {
|
162
159
|
// border: 1px solid black;
|
163
|
-
|
164
160
|
border-radius: 1em 0 0 1em;
|
165
|
-
|
161
|
+
|
162
|
+
margin-right: 32px;
|
163
|
+
|
164
|
+
padding: 0.2em 0.2em 0.2em 0.6em;
|
165
|
+
|
166
|
+
height: 32px;
|
166
167
|
|
167
168
|
background: white;
|
169
|
+
|
168
170
|
position: relative;
|
169
171
|
|
172
|
+
&::before {
|
173
|
+
// border: 1px solid red;
|
174
|
+
// background: yellow;
|
170
175
|
|
176
|
+
content: "";
|
177
|
+
display: block;
|
171
178
|
|
179
|
+
position: absolute;
|
180
|
+
right: -16px;
|
181
|
+
top: 0;
|
182
|
+
|
183
|
+
width: 16px;
|
184
|
+
height: 32px;
|
185
|
+
|
186
|
+
// border-left: 12px solid white;
|
187
|
+
border-top: 17px solid white;
|
188
|
+
border-right: 12px solid transparent;
|
189
|
+
// border-bottom: 12px solid transparent;
|
190
|
+
}
|
172
191
|
&::after {
|
173
192
|
// border: 1px solid red;
|
174
193
|
|
175
194
|
content: "";
|
195
|
+
display: block;
|
176
196
|
|
177
197
|
position: absolute;
|
178
|
-
right: -
|
179
|
-
width: 10px;
|
180
|
-
display: block;
|
181
|
-
// background: inherit;
|
182
|
-
// background: red;
|
183
|
-
margin: 0 20px;
|
184
|
-
top: -1px;
|
198
|
+
right: -16px;
|
185
199
|
bottom: 0;
|
186
200
|
|
187
|
-
|
188
|
-
|
201
|
+
width: 16px;
|
202
|
+
height: 32px;
|
189
203
|
|
190
|
-
border-
|
191
|
-
|
192
|
-
// border: 1px solid red;
|
204
|
+
border-bottom: 17px solid white;
|
205
|
+
border-right: 12px solid transparent;
|
193
206
|
}
|
194
207
|
}
|
195
208
|
|
@@ -342,7 +355,7 @@ textarea.large {
|
|
342
355
|
border-bottom: 2px solid red;
|
343
356
|
margin-bottom: 1em;
|
344
357
|
|
345
|
-
a,
|
358
|
+
a:not(.chip),
|
346
359
|
span.label {
|
347
360
|
background: white;
|
348
361
|
padding: .2em;
|
@@ -122,6 +122,7 @@
|
|
122
122
|
|
123
123
|
/*
|
124
124
|
* GameUI in Purse
|
125
|
+
* 2023-04-06 _vp_ Continue
|
125
126
|
**/
|
126
127
|
.gameuiW {
|
127
128
|
border: 1px solid #ff9966;
|
@@ -146,8 +147,8 @@
|
|
146
147
|
left: 50%;
|
147
148
|
width: 600px;
|
148
149
|
|
149
|
-
.gameuiC {
|
150
|
-
// border: 2px solid
|
150
|
+
.gameuiC { /* 1/2 of the ground */
|
151
|
+
// border: 2px solid #ff9900;
|
151
152
|
|
152
153
|
background-color: brown;
|
153
154
|
|
@@ -181,6 +182,7 @@
|
|
181
182
|
.elephantW {
|
182
183
|
border: 2px solid black;
|
183
184
|
position: absolute;
|
185
|
+
bottom: 0;
|
184
186
|
// left: ?? ; /* data: cc strike */
|
185
187
|
}
|
186
188
|
|
@@ -214,9 +216,6 @@
|
|
214
216
|
.elephantC {
|
215
217
|
// border: 10px solid black;
|
216
218
|
|
217
|
-
// width: 10px;
|
218
|
-
// height: 10px;
|
219
|
-
|
220
219
|
z-index: 1;
|
221
220
|
position: absolute;
|
222
221
|
color: #333;
|
@@ -235,23 +234,8 @@
|
|
235
234
|
top: -25px;
|
236
235
|
}
|
237
236
|
}
|
238
|
-
|
239
|
-
|
240
237
|
}
|
241
238
|
|
242
|
-
.elephantNext {
|
243
|
-
// border: 5px solid white;
|
244
|
-
border-radius: 50%;
|
245
|
-
|
246
|
-
display: none;
|
247
|
-
|
248
|
-
position: absolute;
|
249
|
-
bottom: -50px;
|
250
|
-
margin-left: 50px;
|
251
|
-
transform: scale(1.2);
|
252
|
-
opacity: 0.33;
|
253
|
-
background-color: green;
|
254
|
-
}
|
255
239
|
|
256
240
|
.groundedW {
|
257
241
|
position: absolute;
|
@@ -294,15 +278,21 @@
|
|
294
278
|
}
|
295
279
|
|
296
280
|
.riderCurrent {
|
297
|
-
display: none;
|
298
|
-
|
299
|
-
position: absolute;
|
300
281
|
background: #339933;
|
301
|
-
|
302
|
-
|
303
|
-
right: 0;
|
304
|
-
// width: 105px;
|
282
|
+
left: 0;
|
283
|
+
}
|
305
284
|
|
285
|
+
.riderCurrent,
|
286
|
+
.riderCurrent2,
|
287
|
+
._ {
|
288
|
+
position: absolute;
|
289
|
+
bottom: 7px;
|
290
|
+
top: -7px;
|
291
|
+
}
|
292
|
+
.riderCurrent2 {
|
293
|
+
display: none;
|
294
|
+
lefts: 0;
|
295
|
+
background: #993333;
|
306
296
|
}
|
307
297
|
.riderStart {
|
308
298
|
// border: 2px solid #cc33ff;
|
@@ -387,7 +377,7 @@
|
|
387
377
|
border: 2px solid blue;
|
388
378
|
|
389
379
|
position: absolute;
|
390
|
-
left: 232px; /* Data: current underlying strike */
|
380
|
+
// left: 232px; /* Data: current underlying strike */
|
391
381
|
bottom: 0;
|
392
382
|
|
393
383
|
|
@@ -439,3 +429,32 @@
|
|
439
429
|
}
|
440
430
|
}
|
441
431
|
}
|
432
|
+
.next-position {
|
433
|
+
.elephant {
|
434
|
+
border: 1px solid white; /* 4.5% more */
|
435
|
+
border-radius: 50% 50% 0 0;
|
436
|
+
// background-size: 120%;
|
437
|
+
|
438
|
+
background-image: url('https://d15g8hc4183yn4.cloudfront.net/wp-content/uploads/2023/04/04103931/200x125-elephant-1rmTiny.png');
|
439
|
+
width: 200px;
|
440
|
+
height: 125px;
|
441
|
+
|
442
|
+
padding-left: 100px;
|
443
|
+
|
444
|
+
position: absolute;
|
445
|
+
left: -100px;
|
446
|
+
bottom: 0;
|
447
|
+
|
448
|
+
z-index: 1;
|
449
|
+
}
|
450
|
+
.elephantLoss {
|
451
|
+
border: 1px solid red;
|
452
|
+
border-radius: 50% 50% 0 0;
|
453
|
+
width: 200px;
|
454
|
+
height: 125px;
|
455
|
+
|
456
|
+
position: absolute;
|
457
|
+
left: 0;
|
458
|
+
bottom: 0;
|
459
|
+
}
|
460
|
+
}
|
@@ -33,10 +33,17 @@ class ::IshManager::EmailCampaignLeadsController < IshManager::ApplicationContro
|
|
33
33
|
# redirect_to :action => 'index'
|
34
34
|
# end
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
def destroy
|
37
|
+
@clead = EmailCampaignLead.find params[:id]
|
38
|
+
authorize! :destroy, @clead
|
39
|
+
flag = @clead.delete
|
40
|
+
if flag
|
41
|
+
flash[:notice] = 'ok'
|
42
|
+
else
|
43
|
+
flash[:alert] = 'no luck'
|
44
|
+
end
|
45
|
+
redirect_to controller: 'email_campaigns', action: :show, id: @clead.email_campaign_id
|
46
|
+
end
|
40
47
|
|
41
48
|
# def index
|
42
49
|
# authorize! :index, ::Lead
|
@@ -101,12 +101,9 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
|
|
101
101
|
def summary
|
102
102
|
authorize! :summary, Ish::EmailContext
|
103
103
|
@results = Ish::EmailContext.summary
|
104
|
-
puts! @results, 'r'
|
105
|
-
|
106
|
-
# headers["Content-Type"] ||= 'text/csv'
|
107
104
|
|
108
105
|
respond_to do |format|
|
109
|
-
format.html
|
106
|
+
format.html
|
110
107
|
format.csv do
|
111
108
|
render layout: false
|
112
109
|
end
|
@@ -28,6 +28,15 @@ class ::IshManager::IroPositionsController < IshManager::ApplicationController
|
|
28
28
|
authorize! :new, @position
|
29
29
|
end
|
30
30
|
|
31
|
+
## prepare to roll
|
32
|
+
def roll
|
33
|
+
@position = Iro::Position.find( params[:id] )
|
34
|
+
# puts! @position, 'zze'
|
35
|
+
|
36
|
+
authorize! :roll, @position
|
37
|
+
@next_positions = Iro::Position.find( 13, 14, 15, 16 )
|
38
|
+
end
|
39
|
+
|
31
40
|
def update
|
32
41
|
@position = Iro::Position.find params[:id]
|
33
42
|
authorize! :update, @position
|
@@ -34,9 +34,11 @@ class ::IshManager::IroPursesController < IshManager::ApplicationController
|
|
34
34
|
|
35
35
|
@strategies = @purse.strategies
|
36
36
|
|
37
|
+
|
37
38
|
underlyings = Tda::Stock.get_quotes( @strategies.map(&:ticker).compact.uniq.join(",") )
|
38
|
-
|
39
|
+
json_puts! underlyings, 'out'
|
39
40
|
underlyings.each do |ticker, v|
|
41
|
+
puts! v[:mark], 'ze mark'
|
40
42
|
Iro::CoveredCallStrategy.where( ticker: ticker ).update( current_underlying_strike: v[:mark] )
|
41
43
|
end
|
42
44
|
|
@@ -31,7 +31,7 @@ class ::IshManager::IroStrategiesController < IshManager::ApplicationController
|
|
31
31
|
flag = @strategy.update params[:iro_strategy].permit!
|
32
32
|
if flag
|
33
33
|
flash[:notice] = 'Success.'
|
34
|
-
redirect_to
|
34
|
+
redirect_to controller: 'ish_manager/iro_purses', action: :show, id: @strategy.iro_purse_id
|
35
35
|
else
|
36
36
|
flash[:alert] = "No luck: #{@strategy.errors.full_messages.join(', ')}."
|
37
37
|
render action: 'new'
|
@@ -52,8 +52,8 @@
|
|
52
52
|
.a
|
53
53
|
%ul
|
54
54
|
%li
|
55
|
-
|
56
|
-
|
55
|
+
|
56
|
+
= link_to "#{WpTag::INBOX} (#{Office::EmailConversation.in_emailtag(WpTag::INBOX).length})", email_conversations_in_path(WpTag::INBOX), class: 'chip'
|
57
57
|
= link_to '[+]', new_email_context_path
|
58
58
|
%li
|
59
59
|
= link_to "Tmpls (#{Ish::EmailTemplate.all.count})", email_templates_path
|
@@ -73,6 +73,8 @@
|
|
73
73
|
%li
|
74
74
|
= link_to "Ctxs (#{Ctx.notsent.length})", notsent_email_contexts_path
|
75
75
|
= link_to '[+]', new_email_context_path
|
76
|
+
%br
|
77
|
+
= link_to 'summary', email_contexts_summary_path( format: :html )
|
76
78
|
= link_to '[csv]', email_contexts_summary_path( format: :csv )
|
77
79
|
|
78
80
|
%li
|
@@ -15,9 +15,9 @@
|
|
15
15
|
|
16
16
|
.collapse-expand#campaignLeads Email Campaign leads (#{@campaign.campaign_leads.length})
|
17
17
|
%ul.email-campaign-leads.items.browser-default
|
18
|
-
- @campaign.
|
18
|
+
- @campaign.campaign_leads.each do |clead|
|
19
19
|
%li.item
|
20
|
-
=
|
21
|
-
|
22
|
-
|
20
|
+
.inline-block= button_to '[x]', email_campaign_lead_path(clead), method: :delete, :data => { :confirm => 'Are you sure?' }
|
21
|
+
= link_to clead.lead.email, lead_path(clead.lead.id)
|
22
|
+
(#{clead.lead.email_contexts.length} ctxs)
|
23
23
|
|
@@ -0,0 +1,105 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
.iro-positions-roll.max-width
|
4
|
+
|
5
|
+
- p = @position
|
6
|
+
.gameuiW.show-amounts{ data: { cc: { strike: p.strike, startPrice: p.opened_price, currentPrice: p.current_price, cus: p.strategy.current_underlying_strike } } }
|
7
|
+
.gameui
|
8
|
+
.gameuiC
|
9
|
+
= link_to '[roll]', roll_iro_position_path(p)
|
10
|
+
|
11
|
+
.elephantW
|
12
|
+
.elephant
|
13
|
+
.elephantC
|
14
|
+
|
15
|
+
.amount
|
16
|
+
|
17
|
+
.q= p.quantity
|
18
|
+
|
19
|
+
.riderW
|
20
|
+
.rider
|
21
|
+
.riderC
|
22
|
+
|
23
|
+
.riderStart
|
24
|
+
.amount
|
25
|
+
.riderCurrent
|
26
|
+
.amount
|
27
|
+
|
28
|
+
.riderStart2
|
29
|
+
.amount
|
30
|
+
.riderCurrent2
|
31
|
+
.amount
|
32
|
+
|
33
|
+
|
34
|
+
.sunflowerW
|
35
|
+
.sunflower
|
36
|
+
.sunflowerC
|
37
|
+
|
38
|
+
.days-left= (p.expires_on.to_date - Time.now.to_date).to_i
|
39
|
+
|
40
|
+
.windW
|
41
|
+
.wind
|
42
|
+
.c-u-s= pp_currency p.strategy.current_underlying_strike
|
43
|
+
.windC
|
44
|
+
|
45
|
+
|
46
|
+
.spearW
|
47
|
+
.spear
|
48
|
+
.spearC
|
49
|
+
.spearStart
|
50
|
+
.spearCurrent
|
51
|
+
.c
|
52
|
+
|
53
|
+
-# next position
|
54
|
+
- @next_positions.each do |p|
|
55
|
+
- gainp = p.strike / @position.strike - 1
|
56
|
+
.gameuiW.next-position.show-amounts{ data: { cc: { gainp: gainp, strike: p.strike, startPrice: p.current_price, currentPrice: @position.current_price, cus: p.strategy.current_underlying_strike } } }
|
57
|
+
.gameui
|
58
|
+
.gameuiC
|
59
|
+
= link_to '[roll]', roll_iro_position_path(p)
|
60
|
+
|
61
|
+
.elephantW
|
62
|
+
|
63
|
+
.elephant
|
64
|
+
.elephantLoss
|
65
|
+
.elephantC
|
66
|
+
|
67
|
+
.amount
|
68
|
+
|
69
|
+
.q= p.quantity
|
70
|
+
|
71
|
+
.riderW
|
72
|
+
.rider
|
73
|
+
.riderC
|
74
|
+
|
75
|
+
.riderStart
|
76
|
+
.amount
|
77
|
+
.riderCurrent
|
78
|
+
.amount
|
79
|
+
|
80
|
+
.riderStart2
|
81
|
+
.amount
|
82
|
+
.riderCurrent2
|
83
|
+
.amount
|
84
|
+
|
85
|
+
|
86
|
+
.sunflowerW
|
87
|
+
.sunflower
|
88
|
+
.sunflowerC
|
89
|
+
|
90
|
+
.days-left= (p.expires_on.to_date - Time.now.to_date).to_i
|
91
|
+
|
92
|
+
.windW
|
93
|
+
.wind
|
94
|
+
.c-u-s= pp_currency p.strategy.current_underlying_strike
|
95
|
+
.windC
|
96
|
+
|
97
|
+
|
98
|
+
.spearW
|
99
|
+
.spear
|
100
|
+
.spearC
|
101
|
+
.spearStart
|
102
|
+
.spearCurrent
|
103
|
+
.c
|
104
|
+
|
105
|
+
|
@@ -26,8 +26,6 @@
|
|
26
26
|
Positions (#{@positions.length})
|
27
27
|
= link_to '[+]', new_iro_position_path({ iro_purse_id: @purse.id })
|
28
28
|
.positions
|
29
|
-
|
30
|
-
|
31
29
|
%table.bordered
|
32
30
|
%thead
|
33
31
|
%tr
|
@@ -92,7 +90,8 @@
|
|
92
90
|
%td.q= p.quantity
|
93
91
|
%td.begin-on= pp_date p.opened_on
|
94
92
|
%td.price= p.opened_price
|
95
|
-
%td.to-open
|
93
|
+
%td.to-open
|
94
|
+
-# pp_amount( p.opened_price * 100 * p.quantity )
|
96
95
|
%td.begin-delta= sprintf('%.2f', p.opened_delta ) rescue nil
|
97
96
|
%td= pp_money p.current_price
|
98
97
|
%td.net= pp_money ( p.opened_price - p.current_price ) * 100 - 1.3
|
@@ -9,10 +9,9 @@
|
|
9
9
|
|
10
10
|
%h5.collapse-expand#iroPurseConfig
|
11
11
|
Config
|
12
|
-
-# #{link_to '[~]', edit_iro_purse_path(@purse)}
|
13
12
|
.config
|
14
|
-
-# %pre= @purse.config
|
15
13
|
= render 'form', iro_purse: @purse
|
14
|
+
.c
|
16
15
|
|
17
16
|
%h5.collapse-expand#strategies
|
18
17
|
Strategies (#{@strategies.length})
|
@@ -20,12 +19,11 @@
|
|
20
19
|
.strategies.items
|
21
20
|
- @strategies.each do |strat|
|
22
21
|
.strategy.item= render 'ish_manager/iro_strategies/form', strategy: strat
|
23
|
-
|
22
|
+
.c
|
24
23
|
|
25
24
|
%h5.collapse-expand#gameuiPositions
|
26
25
|
Gameui Positions (#{@positions.length})
|
27
26
|
= link_to '[+]', new_iro_position_path({ iro_purse_id: @purse.id })
|
28
|
-
|
29
27
|
.gameui-positions
|
30
28
|
- @positions.each do |p|
|
31
29
|
|
@@ -33,6 +31,7 @@
|
|
33
31
|
.gameuiW.show-amounts{ data: { cc: { strike: p.strike, startPrice: p.opened_price, currentPrice: p.current_price, cus: p.strategy.current_underlying_strike } } }
|
34
32
|
.gameui
|
35
33
|
.gameuiC
|
34
|
+
= link_to '[roll]', roll_iro_position_path(p)
|
36
35
|
|
37
36
|
.elephantW
|
38
37
|
.elephant
|
@@ -50,7 +49,12 @@
|
|
50
49
|
.amount
|
51
50
|
.riderCurrent
|
52
51
|
.amount
|
52
|
+
|
53
53
|
.riderStart2
|
54
|
+
.amount
|
55
|
+
.riderCurrent2
|
56
|
+
.amount
|
57
|
+
|
54
58
|
|
55
59
|
.sunflowerW
|
56
60
|
.sunflower
|
@@ -69,14 +73,12 @@
|
|
69
73
|
.spearC
|
70
74
|
.spearStart
|
71
75
|
.spearCurrent
|
72
|
-
|
76
|
+
.c
|
73
77
|
|
74
78
|
%h5.collapse-expand#spreadsheetPositions
|
75
79
|
Positions (#{@positions.length})
|
76
80
|
= link_to '[+]', new_iro_position_path({ iro_purse_id: @purse.id })
|
77
81
|
.positions
|
78
|
-
|
79
|
-
|
80
82
|
%table.bordered
|
81
83
|
%thead
|
82
84
|
%tr
|
@@ -99,7 +101,7 @@
|
|
99
101
|
%td
|
100
102
|
.begin-on Begin On
|
101
103
|
%td
|
102
|
-
.price Price
|
104
|
+
.price Begin Price
|
103
105
|
%td
|
104
106
|
.to-open To Open
|
105
107
|
%td
|
@@ -140,12 +142,15 @@
|
|
140
142
|
%td.days-left= (p.expires_on.to_date - Time.now.to_date).to_i
|
141
143
|
%td.q= p.quantity
|
142
144
|
%td.begin-on= pp_date p.opened_on
|
143
|
-
%td.price= p.opened_price
|
144
|
-
%td.to-open
|
145
|
+
%td.price= pp_amount p.opened_price
|
146
|
+
%td.to-open
|
147
|
+
-# = pp_amount( p.opened_price * p.quantity )
|
145
148
|
%td.begin-delta= sprintf('%.2f', p.opened_delta ) rescue nil
|
146
149
|
%td= pp_money p.current_price
|
147
|
-
%td.net
|
148
|
-
|
150
|
+
%td.net
|
151
|
+
= pp_money ( p.opened_price - p.current_price ) - 0.013
|
152
|
+
%td.netp
|
153
|
+
= pp_percent ( p.opened_price - p.current_price ) / p.opened_price
|
149
154
|
%td= sprintf('%.2f', p.current_delta ) rescue nil
|
150
155
|
%td= (p.expires_on.to_date - p.opened_on).to_i
|
151
156
|
%td.must-roll= pp_bool p.must_roll?
|
@@ -157,5 +162,5 @@
|
|
157
162
|
%td.next-delta= p.next_position[:delta]
|
158
163
|
%td.next-outcome= pp_money p.next_outcome
|
159
164
|
%td.state= p.status
|
160
|
-
|
165
|
+
.c
|
161
166
|
|
@@ -2,7 +2,8 @@
|
|
2
2
|
- url = strategy.new_record? ? iro_strategies_path : iro_strategy_path(strategy)
|
3
3
|
.iro-strategies--form
|
4
4
|
= form_for strategy, url: url, as: :iro_strategy do |f|
|
5
|
-
|
5
|
+
- if params[:iro_purse_id]
|
6
|
+
= hidden_field_tag 'iro_strategy[iro_purse_id]', params[:iro_purse_id]
|
6
7
|
.field
|
7
8
|
= "#{strategy.id}." if strategy.id
|
8
9
|
= f.label :slug
|
data/config/routes.rb
CHANGED
@@ -24,6 +24,7 @@ IshManager::Engine.routes.draw do
|
|
24
24
|
# end
|
25
25
|
# resources :orders
|
26
26
|
|
27
|
+
get 'iro_positions/roll/:id', to: 'iro_positions#roll', as: :roll_iro_position
|
27
28
|
resources :iro_positions
|
28
29
|
|
29
30
|
resources :iro_watches
|
@@ -60,7 +61,7 @@ IshManager::Engine.routes.draw do
|
|
60
61
|
post 'email_campaigns/:id/send', to: 'email_campaigns#do_send', as: :send_email_campaign
|
61
62
|
resources :email_campaigns
|
62
63
|
|
63
|
-
resources :email_campaign_leads, as: :campaign_leads
|
64
|
+
resources :email_campaign_leads # , as: :campaign_leads
|
64
65
|
|
65
66
|
resources :email_filters
|
66
67
|
|
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.417
|
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-
|
11
|
+
date: 2023-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -468,6 +468,7 @@ files:
|
|
468
468
|
- app/views/ish_manager/iro_positions/_form.haml
|
469
469
|
- app/views/ish_manager/iro_positions/edit.haml
|
470
470
|
- app/views/ish_manager/iro_positions/new.haml
|
471
|
+
- app/views/ish_manager/iro_positions/roll.haml
|
471
472
|
- app/views/ish_manager/iro_purses/_form.haml
|
472
473
|
- app/views/ish_manager/iro_purses/edit.haml
|
473
474
|
- app/views/ish_manager/iro_purses/new.haml
|