Implement a market
This commit is contained in:
@@ -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>
|
||||
|
63
templates/market/index.html
Normal file
63
templates/market/index.html
Normal 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 %}
|
||||
|
53
templates/market/item.html
Normal file
53
templates/market/item.html
Normal file
@@ -0,0 +1,53 @@
|
||||
{% extends 'base_simple.html' %}
|
||||
{% block title %}Market Details{% endblock %}
|
||||
{% block sectiontitle %}The Market{% endblock %}
|
||||
|
||||
{% block breadcrumb %}
|
||||
Home
|
||||
> <a href="{% url market.views.index %}">Market</a>
|
||||
> {{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 %}
|
Reference in New Issue
Block a user