Browse Source

Actually enumerate rules on /rules

master
Graham Northup 3 years ago
parent
commit
68bba1765e
Signed by untrusted user: grissess GPG Key ID: 5D000E6F539376FB
  1. 10
      app/new_content.txt
  2. 3
      app/rules.py
  3. 4
      app/static/style.css
  4. 17
      app/templates/rules.html

10
app/new_content.txt

@ -1,10 +1,10 @@
Spells/bigbys_hand.txt
Spells/depolymorph.txt
Spells/despell.txt
Spells/enrage.txt
Spells/wingbind.txt
Items/fractal_sponge.txt
Items/manite.txt
Spells/stasis.txt
Items/ring_of_enlargement_reduction.txt
Items/ring_of_greater_enlargment_reduction.txt
Items/ring_of_the_mastermind.txt
Items/anchored_mithril.txt
Items/firestorm_quartz.txt
Items/lunar_steel.txt
Spells/antidivinity_strike.txt

3
app/rules.py

@ -59,6 +59,9 @@ def get_rules():
for rule in rules_of_kind(kind):
yield rule
def sorted_rules():
return sorted(get_rules(), key=lambda ru: ru.name)
class Campaign(object):
def __init__(self, path):
f = open(path, 'r')

4
app/static/style.css

@ -41,6 +41,10 @@ h4 {
color: #6c6;
}
.sec:target {
background-color: #040;
}
nav {
font-size: 200%;
}

17
app/templates/rules.html

@ -1,8 +1,23 @@
{% extends "base.html" %}
{% block content %}
<h2>Rules &middot; <a href="/campaigns">Campaigns</a></h2>
<ul class= "headlist special">
{% for kind in rules.get_kinds() %}
<li><a href="#{{kind}}">{{kind}}</a> {% if not loop.last %} &middot; {% endif %}</li>
{% endfor %}
</ul>
<ul class="headlist">
{% for ru in rules.sorted_rules() %}
<li><a href="#{{ru.name}}">{{ru.name}}</a> {% if not loop.last %} &middot; {% endif %}</li>
{% endfor %}
</ul>
{% for kind in rules.get_kinds() %}
<h3 id="{{kind}}" class="sec">{{kind}}</h2>
<h3 id="{{kind}}" class="sec">{{kind}}</h3>
<ul class="headlist">
{% for ru in rules.sorted_rules_of_kind(kind) %}
<li><a href="#{{ru.name}}">{{ru.name}}</a> {% if not loop.last %} &middot; {% endif %}</li>
{% endfor %}
</ul>
{% for ru in rules.sorted_rules_of_kind(kind) %}
{{ macros.rule(ru) }}
{% endfor %}

Loading…
Cancel
Save