Implement a market

This commit is contained in:
Trever Fischer
2012-11-17 16:09:29 -05:00
parent 57b21f9316
commit 563ab161f9
19 changed files with 664 additions and 0 deletions

View File

@@ -125,6 +125,7 @@ s.parentNode.insertBefore(po, s);
</div>
<ul>
<li><a href="/">Home</a></li>
<li><a href="{%url 'market.views.index' %}">Market</a></li>
<li><a href="{%url 'local.views.list' %}">User List</a></li>
<li><a href="{% url 'petition.views.create' %}">Create Petition</a></li>
<li><a href="{% url 'donate.views.index' %}">Donate!</a></li>

View File

@@ -0,0 +1,63 @@
{% extends 'base_simple.html' %}
{% block title %}The Market{% endblock %}
{% block sectiontitle %}The Market{% endblock %}
{% block content %}
<h2>Market Prices</h2>
<table>
<tr>
<th>Item</th>
<th>High</th>
<th>Low</th>
</tr>
{% for itemData in items %}
<tr>
<td>
<a href="{% url market.views.itemStats itemID=itemData.item.id%}">
{% include 'common/item.html' with item=itemData.item %}
</a>
</td>
<td>{{itemData.high}}</td>
<td>{{itemDta.low}}</td>
</tr>
{% endfor %}
</table>
<h2>Sell Orders</h2>
<table>
<tr>
<th>Item</th>
<th>Quantity</th>
<th>Unit Price</th>
<th>Total Price</th>
<th>Action</th>
</tr>
{% for order in sell_orders %}
<tr>
<td><a href="{% url market.views.itemStats itemID=order.item.id%}">{{order.item}}</a></td>
<td>{{order.quantity}}</td>
<td>{{order.unit_price}}</td>
<td>{{order.total_price}}</td>
<td><a href="{% url market.views.buy orderID=order.id %}">Buy Now</a></td>
</tr>
{% endfor %}
</table>
<h2>Buy Orders</h2>
<table>
<tr>
<th>Item</th>
<th>Quantity</th>
<th>Unit Price</th>
<th>Total Price</th>
</tr>
{% for order in buy_orders %}
<tr>
<td>{{order.item}}</td>
<td>{{order.quantity}}</td>
<td>{{order.unit_price}}</td>
<td>{{order.total_price}}</td>
</tr>
{% endfor %}
</table>
{% endblock %}

View File

@@ -0,0 +1,53 @@
{% extends 'base_simple.html' %}
{% block title %}Market Details{% endblock %}
{% block sectiontitle %}The Market{% endblock %}
{% block breadcrumb %}
Home
&gt; <a href="{% url market.views.index %}">Market</a>
&gt; {{item.name}}
{% endblock %}
{% block content %}
{% include 'common/item.html' with item=item %}
<table>
<tr><th>High</th><th>Low</th></tr>
<tr><td>{{high}}</td><td>{{low}}</td></tr>
</table>
<h2>Sell Orders</h2>
<table>
<tr>
<th>Item</th>
<th>Quantity</th>
<th>Unit Price</th>
<th>Total Price</th>
<th>Action</th>
</tr>
{% for order in sell_orders %}
<tr>
<td><a href="{% url market.views.itemStats itemID=order.item.id%}">{{order.item}}</a></td>
<td>{{order.quantity}}</td>
<td>{{order.unit_price}}</td>
<td>{{order.total_price}}</td>
<td><a href="{% url market.views.buy orderID=order.id %}">Buy Now</a></td>
</tr>
{% endfor %}
</table>
<h2>Buy Orders</h2>
<table>
<tr>
<th>Item</th>
<th>Quantity</th>
<th>Unit Price</th>
<th>Total Price</th>
</tr>
{% for order in buy_orders %}
<tr>
<td>{{order.item}}</td>
<td>{{order.quantity}}</td>
<td>{{order.unit_price}}</td>
<td>{{order.total_price}}</td>
</tr>
{% endfor %}
</table>
{% endblock %}