Skip to content

Commit

Permalink
polish(markets): Edit market templates a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
vEnhance committed Aug 5, 2023
1 parent 72712d2 commit 6b0803a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
10 changes: 1 addition & 9 deletions markets/templates/markets/market_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,12 @@
<table class="table">
<tr class="table-dark">
<th>Market</th>
<th>$w$</th>
<th>$\alpha$</th>
<th>Ending date</th>
</tr>
{% for market in markets %}
<tr class="{% if not market.has_started %}table-warning{% elif not market.has_ended %}table-success{% endif %}">
<td>
<a href="{{ market.get_absolute_url }}">
<code>{{ market.slug }}</code>
</a>
</td>
<td>{{ market.weight|floatformat:".2f" }}</td>
<td>
{% if market.alpha is not None %}{{ market.alpha|floatformat:".2f" }}{% endif %}
<a href="{{ market.get_absolute_url }}">{{ market.title }}</a>
</td>
{% if past %}
<td>{{ market.end_date }}</td>
Expand Down
19 changes: 9 additions & 10 deletions markets/templates/markets/market_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,20 @@
title="Edit in Admin"
class="btn btn-link btn-outline-success">Edit market</a>
</form>
<hr />
{% endif %}
<div class="alert alert-dark">
<h2 class="alert-heading">{{ market.title }}</h2>
{{ market.prompt_rendered|safe }}
</div>
<p>
Market parameters: $w = {{ market.weight }}$
{% if market.alpha is not None %}and $\alpha = {{ market.alpha }}${% endif %}
.
</p>
<ul>
<li>Market started: {{ market.start_date }}</li>
<li>Market ended: {{ market.end_date }}</li>
</ul>
{% if market.show_answer or request.user.is_superuser %}
<div class="alert alert-info">
<h2 class="alert-heading">
Expand Down Expand Up @@ -80,15 +88,6 @@ <h2 class="alert-heading">
</tr>
{% endfor %}
</table>
<p>
Market parameters: $w = {{ market.weight }}$
{% if market.alpha is not None %}and $\alpha = {{ market.alpha }}${% endif %}
.
</p>
<ul>
<li>Market started: {{ market.start_date }}</li>
<li>Market ended: {{ market.end_date }}</li>
</ul>
</div>
{% endif %}
{% endblock layout-content %}

0 comments on commit 6b0803a

Please sign in to comment.