diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 60f289d..ac442dd 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -23,6 +23,10 @@ /* Margin bottom by footer height */ margin-bottom: 60px; } + .starter { + padding-left: 0.2em; + padding-right: 0.2em; + } .footer { position: absolute; bottom: 0; @@ -31,4 +35,7 @@ height: 60px; line-height: 60px; /* Vertically center the text there */ background-color: #f5f5f5; + } + .li_active { + color: #0923ff; } \ No newline at end of file diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index aaec5e0..1ccd1a8 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,6 +1,8 @@ class HomeController < ApplicationController def index @currencies = Currency.all + @curr_id = Currency.first.id + bbt end def seed @@ -18,4 +20,14 @@ class HomeController < ApplicationController end end end + + def get_trades + @currencies = Currency.all + @curr_id = params[:curr_id] + bbt + end + + def bbt + @bbt = BitBayTrade.where('currency_id = ?', @curr_id).order('cast(tid as unsigned) DESC').limit(20) + end end diff --git a/app/views/home/get_trades.js.erb b/app/views/home/get_trades.js.erb new file mode 100644 index 0000000..497255e --- /dev/null +++ b/app/views/home/get_trades.js.erb @@ -0,0 +1,2 @@ +$("#bbt_ajax").html("<%= escape_javascript(render('/home/partials/bb_trades')) %>"); +$("#left_menu").html("<%= escape_javascript(render('/home/partials/left_menu')) %>"); \ No newline at end of file diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index b6c8c97..33b0e9f 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,8 +1,15 @@ -
-
+
+ +| tid | +Data | +Cena | +Ilość | +Koszt transakcji | +
|---|---|---|---|---|
| <%= bbt.tid %> | +<%= bbt.date %> | +<%= '%.2f' % bbt.price %> | +<%= bbt.amount %> | +<%= '%.2f' % (bbt.price * bbt.amount) %> | +