Add skin value and back-nine doubling to skins games
Players can now set a monetary value per skin when starting a skins game. For 18-hole games, an option to double the value on holes 10–18 is available. The value is stored at game creation and displayed throughout the live game and summary (leaderboard, scorecard, and totals). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -16,8 +16,13 @@
|
||||
<div class="card" style="padding:0.75rem 1rem;">
|
||||
{% for p in results %}
|
||||
{% if game.format == 'skins' %}
|
||||
{% set score_val = skins_won.get(p.id, 0) %}
|
||||
{% set score_label = score_val | string + ' skin' + ('s' if score_val != 1 else '') %}
|
||||
{% if skin_value and money_won %}
|
||||
{% set score_val = money_won.get(p.id, 0) %}
|
||||
{% set score_label = "%.4g" % score_val %}
|
||||
{% else %}
|
||||
{% set score_val = skins_won.get(p.id, 0) %}
|
||||
{% set score_label = score_val | string + ' skin' + ('s' if score_val != 1 else '') %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% set t = totals.get(p.id, {}) %}
|
||||
{% set score_val = t.total %}
|
||||
@@ -43,7 +48,8 @@
|
||||
{% endfor %}
|
||||
{% if game.format == 'skins' and unclaimed %}
|
||||
<div style="font-size:0.8rem; color:var(--text-muted); margin-top:0.5rem; text-align:center;">
|
||||
{{ unclaimed }} skin{{ 's' if unclaimed != 1 else '' }} unclaimed
|
||||
{% if skin_value and unclaimed_money %}{{ "%.4g" % unclaimed_money }} unclaimed
|
||||
{% else %}{{ unclaimed }} skin{{ 's' if unclaimed != 1 else '' }} unclaimed{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -246,8 +252,12 @@
|
||||
{% endfor %}
|
||||
<td class="score-cell">
|
||||
{% if hr %}
|
||||
{% if hr.winner %}✓{% if hr.pot > 1 %} {{ hr.pot }}{% endif %}
|
||||
{% else %}→ {{ hr.pot }}{% endif %}
|
||||
{% if skin_value %}
|
||||
{% if hr.winner %}{{ "%.4g" % hr.money_pot }}{% else %}→ {{ "%.4g" % hr.money_pot }}{% endif %}
|
||||
{% else %}
|
||||
{% if hr.winner %}✓{% if hr.pot > 1 %} {{ hr.pot }}{% endif %}
|
||||
{% else %}→ {{ hr.pot }}{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -255,12 +265,16 @@
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="totals-row">
|
||||
<td>Skins</td>
|
||||
<td>{% if skin_value %}Value{% else %}Skins{% endif %}</td>
|
||||
{% if hole_pars %}<td></td>{% endif %}
|
||||
{% for p in players %}
|
||||
{% if skin_value and money_won %}
|
||||
<td>{{ "%.4g" % money_won.get(p.id, 0) }}</td>
|
||||
{% else %}
|
||||
<td>{{ skins_won.get(p.id, 0) }}</td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<td>{% if unclaimed %}({{ unclaimed }}){% endif %}</td>
|
||||
<td>{% if skin_value and unclaimed_money %}({{ "%.4g" % unclaimed_money }}){% elif unclaimed %}({{ unclaimed }}){% endif %}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user