<!DOCTYPE html>
<html lang="en-US">
<head>
    <title>Control Service</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    {{> control/partials/head-includes }}
</head>
<body>
{{> control/partials/nav}}
<div class="container">
    <h1 class="my-3">Search to Ban</h1>
    <form action="/search-to-ban">
        <div class="mb-3">
            <label for="q" class="form-label">Search Query</label><br>
            <div class="row">
                <div class="col">
                    <input type="text" class="form-control" value="{{specs.humanQuery}}" name="q" id="q" />
                </div>
                <div class="col">
                    <button type="submit" class="btn btn-primary">Search</button>
                </div>
            </div>
        </div>
    </form>
    {{#unless results}}
    <p>This utility lets you use the search engine to find spammy results, and ban them
    by using the checkbox next to the result. </p>
    {{/unless}}
    {{#if results}}
    <hr>
    <form action="/search-to-ban" method="post">
    <div class="my-5">
        <button type="submit" class="btn btn-danger">Blacklist Selected Domains</button>
    </div>
    <input type="hidden" name="query" value="{{specs.humanQuery}}" />
    <table class="table">
    {{#each results}}
        <tr>
            <td><input id="{{url}}" type="checkbox" name="{{url}}"></td>
            <th><label for="{{url}}">{{title}}</label></th>
        </tr>
        <tr><td colspan="2"><a href="{{url}}">{{url}}</a></td></tr>
        <tr><td colspan="2">{{description}}</td></tr>
    {{/each}}
    </table>
    {{/if}}
    </form>
</div>
</body>
{{> control/partials/foot-includes }}
</html>