Browse Source

Move search bar, fix bug in aura search

marches
Josh Gordon 3 years ago
parent
commit
0ea7ce9e6a
  1. 2
      app/routes.py
  2. 16
      app/templates/index.html

2
app/routes.py

@ -43,7 +43,7 @@ def search():
results.append((name,heads,body))
elif typ == "aura":
if "aura" in [h[0].lower() for h in heads]:
if query.lower() in [h[1].lower() for h in heads if h[0].lower() == "aura"]:
if query.lower() in [h[1].lower() for h in heads if "aura" in h[0].lower()][0]:
results.append((name,heads,body))
elif typ == "text":
if query.lower() in body.lower():

16
app/templates/index.html

@ -7,14 +7,6 @@
</head>
<body class="content">
<h1>COSI D&D Archive</h1>
<nav>
<ul>
<li><a href="/items">Items</a></li>
<li><a href="/places">Places</a></li>
<li><a href="/characters">Characters</a></li>
<li><a href="/spells">Spells</a></li>
</ul>
</nav>
<form action="/search" id="searchForm" method="post">
Search Type:
<select name="type">
@ -27,6 +19,14 @@
<input type="submit" value="search">
</form>
<nav>
<ul>
<li><a href="/items">Items</a></li>
<li><a href="/places">Places</a></li>
<li><a href="/characters">Characters</a></li>
<li><a href="/spells">Spells</a></li>
</ul>
</nav>
{% if searchResults is defined %}
<table>

Loading…
Cancel
Save