Skip to content

Commit

Permalink
Add rulings to the card text display
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil committed Mar 7, 2012
1 parent afc2892 commit 35fb68e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sutekhweb.py
Expand Up @@ -211,8 +211,14 @@ def print_card(sCardName):
for x in sorted(dExp)] for x in sorted(dExp)]
else: else:
aExpansions = [] aExpansions = []
if oCard.rulings:
aRulings = [oR.text.replace("\n", " ") + " " + oR.code
for oR in oCard.rulings]
else:
aRulings = []
return render_template('card.html', card=oCard, text=aText, return render_template('card.html', card=oCard, text=aText,
icons=dIcons, expansions=aExpansions) icons=dIcons, expansions=aExpansions,
rulings=aRulings)
else: else:
return render_template('invalid.html', type='Card Name', return render_template('invalid.html', type='Card Name',
requested=sCardName) requested=sCardName)
Expand Down
10 changes: 10 additions & 0 deletions templates/card.html
Expand Up @@ -122,6 +122,16 @@ <h2>Artists</h2>
</ul> </ul>
</div> </div>
{% endif %} {% endif %}
{% if rulings %}
<div id="rulings">
<h2>Rulings</h2>
<ul>
{% for line in rulings %}
<li>{{ line }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endblock %} {% endblock %}
{% block navigation %} {% block navigation %}
<p>Return to <a href="/">Main page</a></p> <p>Return to <a href="/">Main page</a></p>
Expand Down

0 comments on commit 35fb68e

Please sign in to comment.