Skip to content

Commit

Permalink
fixed orders on index page
Browse files Browse the repository at this point in the history
  • Loading branch information
sb- committed Dec 26, 2014
1 parent 3b380a4 commit fdd2e56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/routes/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import json

from flask import Blueprint, Response

from app.config import config
from app.database import redis

api = Blueprint('api', __name__, url_prefix='/api')

Expand Down
6 changes: 4 additions & 2 deletions app/templates/index2.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
{% block scripts %}

<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" ></script>
<script type="text/javascript">
google.load('visualization', '1', {
packages: ['corechart']
Expand All @@ -116,7 +117,8 @@
google.setOnLoadCallback(drawVisualization);
</script>
<script type="text/javascript">
$.getJSON("http://localhost:5000/getordersjson/{{ pair }}/ask", function(data) {

$.getJSON("/api/orders/{{ pair }}/ask", function(data) {
var items = [];
$.each(data, function(id, order) {
items.push('<tr> <td>' + order.price + '</td> <td>' + order.amount + '</td></tr>');
Expand All @@ -125,7 +127,7 @@
$(items.join("")).appendTo("#asktable");
});

$.getJSON("http://localhost:5000/getordersjson/{{ pair }}/bid", function(data) {
$.getJSON("/api/orders/{{ pair }}/bid", function(data) {
var items = [];
$.each(data, function(id, order) {
items.push('<tr> <td>' + order.price + '</td> <td>' + order.amount + '</td></tr>');
Expand Down

0 comments on commit fdd2e56

Please sign in to comment.