paxful_engine-rails 0.6.0 → 0.9.1
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/controllers/paxful_engine/trades_controller.rb +5 -1
- data/app/helpers/paxful_engine/application_helper.rb +5 -0
- data/app/models/paxful_engine/trade.rb +4 -0
- data/app/views/paxful_engine/trades/index.html.erb +16 -7
- data/app/views/paxful_engine/trades/show.html.erb +14 -5
- data/lib/paxful_engine/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bf1b3bb282e90310c4c06163a3d0b0fbd7362b08608490811271abf7f7e89f8
|
4
|
+
data.tar.gz: 68d2cb65f3051c6fefa6c5c209fca6d826b695886ef4663d204fca4a3b3df376
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5b79681193267cc5b095b7b26249d11aa2fc4c36ae67c77d88c9d8d9ad5f2c4986c4f5ee10c83af54b113da4efb1d7240b11b198f070f93af2b5eae4cb03759
|
7
|
+
data.tar.gz: 83e3ac9112667ead30807ed1d16a12d503517f8f29fd6a58671849e9b90b30fac47b142cc649611fb6987e2a5cb5c0f9fdf52248f115c94e303ea0bcfb0331db
|
@@ -2,7 +2,11 @@ module PaxfulEngine
|
|
2
2
|
class TradesController < ApplicationController
|
3
3
|
|
4
4
|
def index
|
5
|
-
@trades = Trade.
|
5
|
+
@trades = Trade.order(completed_at: :desc, created_at: :desc)
|
6
|
+
|
7
|
+
if params[:q] != "all"
|
8
|
+
@trades = @trades.where.not(completed_at: nil)
|
9
|
+
end
|
6
10
|
end
|
7
11
|
|
8
12
|
def show
|
@@ -6,5 +6,10 @@ module PaxfulEngine
|
|
6
6
|
status == "successful" ? "text-success" : "text-danger"
|
7
7
|
end
|
8
8
|
|
9
|
+
def format_datetime(datetime, timezone = "Asia/Manila")
|
10
|
+
return "-" if datetime.nil?
|
11
|
+
datetime.in_time_zone(timezone).strftime("%m/%d/%Y %I:%M%p")
|
12
|
+
end
|
13
|
+
|
9
14
|
end
|
10
15
|
end
|
@@ -1,16 +1,25 @@
|
|
1
|
-
<span class="font-weight-bold"> Found <%= pluralize(@trades.count, "trade")
|
1
|
+
<span class="font-weight-bold"> Found <%= pluralize(@trades.count, "trade") %>.</span>
|
2
|
+
|
3
|
+
<div>
|
4
|
+
<% if params[:q] == "all" %>
|
5
|
+
<%= link_to "👀 Only show successful trades", trades_path %>
|
6
|
+
<% else %>
|
7
|
+
<%= link_to "👀 Include non-successful trades", trades_path(q: :all) %>
|
8
|
+
<% end %>
|
9
|
+
</div>
|
10
|
+
|
2
11
|
<hr />
|
3
12
|
|
4
13
|
<div class="table-responsive">
|
5
14
|
<table class="table table-striped table-bordered">
|
6
15
|
<thead>
|
7
16
|
<tr>
|
8
|
-
<th scope="col">
|
17
|
+
<th scope="col">Completed Date</th>
|
9
18
|
<th scope="col">Trade hash</th>
|
19
|
+
<th scope="col">Fiat</th>
|
20
|
+
<th scope="col">Crypto</th>
|
10
21
|
<th scope="col">Type</th>
|
11
22
|
<th scope="col">Status</th>
|
12
|
-
<th scope="col">Seller</th>
|
13
|
-
<th scope="col">Buyer</th>
|
14
23
|
<th scope="col"></th>
|
15
24
|
</tr>
|
16
25
|
</thead>
|
@@ -23,14 +32,14 @@
|
|
23
32
|
|
24
33
|
<% @trades.each do |trade| %>
|
25
34
|
<tr scope="row">
|
26
|
-
<td> <%= trade.
|
35
|
+
<td> <%= format_datetime(trade.completed_at) %> </td>
|
27
36
|
<td> <%= trade.trade_hash %> </td>
|
37
|
+
<td> <%= number_to_currency(trade.fiat_amount_requested, unit: "#{trade.fiat_currency_code} ") %> </td>
|
38
|
+
<td> <%= trade.crypto_currency_code %> <%= trade.base_crypto_requested %> </td>
|
28
39
|
<td> <%= trade.offer_type.upcase %> </td>
|
29
40
|
<td>
|
30
41
|
<span class="<%= highlight_status(trade) %>"> <%= trade.status.upcase %> </span>
|
31
42
|
</td>
|
32
|
-
<td> <%= trade.seller %> </td>
|
33
|
-
<td> <%= trade.buyer %> </td>
|
34
43
|
<td> <%= link_to "Check trade details", paxful_engine.trade_path(trade) %> </td>
|
35
44
|
</tr>
|
36
45
|
<% end %>
|
@@ -20,17 +20,26 @@
|
|
20
20
|
</div>
|
21
21
|
<div>
|
22
22
|
<strong>Crypto Requested:</strong>
|
23
|
-
<%=
|
24
|
-
(in sats)
|
23
|
+
<%= @trade.crypto_currency_code %> <%= @trade.base_crypto_requested %>
|
24
|
+
(<%= number_to_currency(@trade.crypto_amount_requested, unit: "") %> in sats)
|
25
25
|
</div>
|
26
26
|
</div>
|
27
27
|
|
28
28
|
<hr />
|
29
29
|
|
30
30
|
<div>
|
31
|
-
<div>
|
32
|
-
|
33
|
-
|
31
|
+
<div>
|
32
|
+
<strong>Started at:</strong>
|
33
|
+
<%= format_datetime(@trade.started_at) %>
|
34
|
+
</div>
|
35
|
+
<div>
|
36
|
+
<strong>Ended at:</strong>
|
37
|
+
<%= format_datetime(@trade.ended_at) %>
|
38
|
+
</div>
|
39
|
+
<div>
|
40
|
+
<strong>Completed at:</strong>
|
41
|
+
<%= format_datetime(@trade.completed_at) %>
|
42
|
+
</div>
|
34
43
|
</div>
|
35
44
|
|
36
45
|
<hr />
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paxful_engine-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Chavez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_config
|