<section id="complaint">
    {{#if submitted}}
        <h2>Your complaint against {{domain}} has been submitted</h2>
        <p>The review process is manual and may take a while.  If urgent action is necessary,
            reach me at kontakt@marginalia.nu!
        </p>
    {{/if}}

    {{#unless submitted}}
        <h2>Flag {{domain}} for review</h2>
        <p>
        Note, this is not intended to police acceptable thoughts or ideas.
        <p>
            That said, offensive content in obvious bad faith is not tolerated, especially when designed
            to crop up when you didn't go looking for it. How and where it is said is more
            important than what is said.
        <p>
            This form can also be used to appeal unfairly blacklisted sites.
        <p>

        <form method="POST">
            <fieldset>
                <legend>Flag for Review</legend>

                <label for="category">Category</label><br>
                <select name="category" id="category">
                    {{#each category}} <option value="{{categoryName}}">{{categoryDesc}}</option> {{/each}}
                </select>
                <br>
                <br>
                <label for="description">Description</label><br>
                <textarea type="text" name="description" id="description" rows=4></textarea><br>
                <br>
                <label for="samplequery">(Optional) Search Query </label><br>
                <input type="text" name="samplequery" id="samplequery" length=255 /><br>
                <br>
                <br/>
                <input type="submit" value="File complaint" />
            </fieldset>
        </form>
    <p>
        Communicating through forms and tables is a bit impersonal,
        you may also reach a human being through email at <tt>kontakt@marginalia.nu</tt>.
    {{/unless}}

    {{#if complaints}}
        <hr>
        <h2> Complaints against {{domain}} </h2>
        <table border width=100%>
            <tr><th>Category</th><th>Submitted</th><th>Reviewed</th></tr>
            {{#each complaints}}
                <tr>
                    <td>{{category}}</td>
                    <td>{{submitTime}}</td>
                    <td>{{#if reviewed}}&check;{{/if}}</td>
                </tr>
            {{/each}}
        </table>
    {{/if}}
</section>