Browse Source

Add search bar for stations

pull/6/head
clerie 2 years ago
parent
commit
751a1eecfd
  1. 9
      wetter/templates/base.html
  2. 6
      wetter/templates/stations.html

9
wetter/templates/base.html

@ -29,7 +29,14 @@ @@ -29,7 +29,14 @@
<a class="nav-link" href="/about/">Über</a>
</li>
</ul>
<!--<a href="#" class="btn btn-primary"></a>-->
<form class="form-inline" action="/station/">
<div class="input-group">
<input type="search" name="q" class="form-control" placeholder="Station">
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="submit">Suchen</button>
</div>
</div>
</form>
</div>
</div>
</nav>

6
wetter/templates/stations.html

@ -35,7 +35,11 @@ @@ -35,7 +35,11 @@
<script src="/static/datatables-1.10.20/js/datatables.min.js"></script>
<script>
$(document).ready(function() {
$('#tableid').DataTable();
$('#tableid').DataTable({
"search": {
"search": new URLSearchParams(window.location.search).get("q")
}
});
} );
</script>
{% endblock %}

Loading…
Cancel
Save