summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2008-05-04 10:29:40 +0000
committerGuillaume Seguin <guillaume@segu.in>2008-05-04 10:29:40 +0000
commite5f071a75f14ea2500f094d4ad3027622eaabb3f (patch)
tree07af12dc269f32b263d34c5a777e8c1e02f68c59
parent67d84219d34ae5d327a2f09a699bafcec6d796e8 (diff)
downloadstocktrader-e5f071a75f14ea2500f094d4ad3027622eaabb3f.tar.gz
stocktrader-e5f071a75f14ea2500f094d4ad3027622eaabb3f.tar.bz2
* Group quotes by index on Place view
-rw-r--r--templates/main/place.html10
1 files changed, 9 insertions, 1 deletions
diff --git a/templates/main/place.html b/templates/main/place.html
index 27421fc..95501ba 100644
--- a/templates/main/place.html
+++ b/templates/main/place.html
@@ -11,6 +11,13 @@
{% block content %}<div id="content" class="large">
<h3>{{ place.name }}</h3>
{{ buysell_block|safe }}
+ {% regroup place_quotes by index as grouped %}
+ {% for group in grouped %}
+ {% if group.grouper %}
+ <h4>{{ group.grouper }}</h4>
+ {% else %}
+ <h4>{% trans 'Unindexed' %}</h4>
+ {% endif %}
<table id="index-list-table">
<tr>
<td class="index-name-column">{% trans 'Quote' %}</td>
@@ -18,7 +25,7 @@
<td class="index-delta-column">{% trans '1-day evolution' %}</td>
<td class="index-actions-column"></td>
</tr>
- {% for quote in place_quotes %}<tr>
+ {% for quote in group.list %}<tr>
<td><a href ="/trade/{{ place.name }}/{{ quote.short_name }}">{{ quote.name }}</a></td>
<td>{% blocktrans with quote.place.currency_symbol as currency and quote.current_value as current_value %}{{ current_value }} {{ currency }}{% endblocktrans %}</td>
<td>
@@ -27,6 +34,7 @@
<td><a href ="{% url stocktrader.main.views.buy_view place.name,quote.short_name %}">{% trans 'Buy' %}</a> - <a href ="{% url stocktrader.main.views.sell_view place.name,quote.short_name %}">{% trans 'Sell' %}</a></td>
</tr>{% endfor %}
</table>
+ {% endfor %}
{{ buysell_block|safe }}
</div>{% endblock %}