paxful_engine-rails 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d817baab866145e535dc28f7cc9a8031448e08ba21f4a9acfc36e0c179106cf9
4
- data.tar.gz: eb31ac85370223ea2d1236587209da31decd596ade63fb85f9e4d292a34b4be6
3
+ metadata.gz: d152498f075ac905b808122006bc8049bc7f9f1dc3557aa28bef97adf27829b3
4
+ data.tar.gz: 9ca59758c13c5228c5dc9a32b8e831df3281be2078679be82caf0d0627a198e1
5
5
  SHA512:
6
- metadata.gz: 804eea2db930ac5c49c68c8c874543c15330423f3465b0cd94542d57e3ad64fbc7d044ec88e3c62b7d128d02369bd5a719d488ed18d86a0e8550efc48c262baf
7
- data.tar.gz: 7e0b5ce157c1a3f0c0e39946af73e71c8606327ade9c8760f11f6e8fdf7eebfd3c0ad78cddeb24754d7e8f762d022886027207fa6abb8354f4257631754f20f6
6
+ metadata.gz: 8f800fec47aea83992830ab7c1ae70eff5fa14a4810daee4328479bc489b12d2b0e5d1e899d0359da2dc7dfbf8e73a8237c9771c06c1576cf765cbd3a3c3ef7c
7
+ data.tar.gz: 223f46864b93dce3fc966f9f15b12aa7a6e6aad550e62a1c104d5503313698f21a03eff66ebf1af3c3aba2b0e0d9ad4ac32abd5759420f4e4e8fe1f016f908d0
data/README.md CHANGED
@@ -57,7 +57,6 @@ end
57
57
  ### Usage
58
58
 
59
59
  Add this to your scheduler somewhere:
60
-
61
60
  ```
62
61
  # sidekiq_cron.yml
63
62
  refresh_paxful_order_book:
@@ -65,6 +64,10 @@ refresh_paxful_order_book:
65
64
  class: "PaxfulEngine::SyncOrderBookJob"
66
65
  ```
67
66
 
67
+ From the host app:
68
+ - Check list of trades at `/paxful_engine/trades`.
69
+ - Details per trade at `/paxful_engine/trades/:id`.
70
+
68
71
  ### Development
69
72
 
70
73
  ```
@@ -1,4 +1,10 @@
1
1
  module PaxfulEngine
2
2
  module ApplicationHelper
3
+
4
+ def highlight_status(trade)
5
+ status = trade.status.downcase
6
+ status == "successful" ? "text-success" : "text-danger"
7
+ end
8
+
3
9
  end
4
10
  end
@@ -1,3 +1,6 @@
1
+ <span class="font-weight-bold"> Found <%= pluralize(@trades.count, "trade") %></span>
2
+ <hr />
3
+
1
4
  <div class="table-responsive">
2
5
  <table class="table table-striped table-bordered">
3
6
  <thead>
@@ -12,12 +15,20 @@
12
15
  </tr>
13
16
  </thead>
14
17
  <tbody>
18
+ <% if @trades.empty? %>
19
+ <tr>
20
+ <td colspan="7"> No trades found </td>
21
+ </tr>
22
+ <% end %>
23
+
15
24
  <% @trades.each do |trade| %>
16
25
  <tr scope="row">
17
26
  <td> <%= trade.created_at.strftime("%m/%d/%Y %I:%M%p") %> </td>
18
27
  <td> <%= trade.trade_hash %> </td>
19
28
  <td> <%= trade.offer_type.upcase %> </td>
20
- <td> <%= trade.status.upcase %> </td>
29
+ <td>
30
+ <span class="<%= highlight_status(trade) %>"> <%= trade.status.upcase %> </span>
31
+ </td>
21
32
  <td> <%= trade.seller %> </td>
22
33
  <td> <%= trade.buyer %> </td>
23
34
  <td> <%= link_to "Check trade details", paxful_engine.trade_path(trade) %> </td>
@@ -1,3 +1,3 @@
1
1
  module PaxfulEngine
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
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.2.0
4
+ version: 0.3.0
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-10-23 00:00:00.000000000 Z
11
+ date: 2020-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_config