{{define "title"}}Remove from the inner circle{{end}}
{{define "content"}}
<div class="container">
    <section class="hero is-inner-circle is-bold">
        <div class="hero-body">
            <div class="container">
                <h1 class="title has-text-light">
                    <img src="/static/img/circle-24.png">
                    Remove from the inner circle
                </h1>
            </div>
        </div>
    </section>

    <div class="block p-4">
        <div class="columns is-centered">
            <div class="column is-half">

                <div class="card" style="width: 100%; max-width: 640px">
                    <header class="card-header has-background-warning">
                        <p class="card-header-title has-text-black">
                            <span class="icon"><img src="/static/img/circle-16.png"></span>
                            Remove from the inner circle
                        </p>
                    </header>
                    <div class="card-content">

                        <div class="media block">
                            <div class="media-left">
                                {{template "avatar-64x64" .User}}
                            </div>
                            <div class="media-content">
                                <p class="title is-4">{{.User.NameOrUsername}}</p>
                                <p class="subtitle is-6">
                                    <span class="icon"><i class="fa fa-user"></i></span>
                                    <a href="/u/{{.User.Username}}" target="_blank">{{.User.Username}}</a>
                                </p>
                            </div>
                        </div>

                        <form action="/inner-circle/remove" method="POST">
                            {{InputCSRF}}
                            <input type="hidden" name="to" value="{{.User.Username}}">

                            {{if .CurrentUser.IsAdmin}}
                            <div class="content">
                                <p>
                                    Do you want to <strong class="has-text-danger">remove</strong> {{.User.Username}} from
                                    the {{PrettyCircle}}? Doing so will:
                                </p>

                                <ul>
                                    <li>
                                        Unset their inner circle flag, removing them from all inner circle features.
                                    </li>
                                    <li>
                                        Set any photo they had for "inner circle only" to be "public" instead.
                                    </li>
                                    <li>
                                        Clean up any notification they once received about being invited to the inner circle.
                                    </li>
                                </ul>
                            </div>
                            {{else}}
                            <div class="content">
                                <p>
                                    Do you want to <strong class="has-text-danger">request removal</strong> of {{.User.Username}}
                                    from the {{PrettyCircle}}?
                                </p>
                                <p>
                                    If {{.User.Username}} should no longer <a href="/inner-circle#qualify">qualify</a> to be a
                                    part of the inner circle, you may flag them to be removed from the circle. For example: to
                                    be invited into the circle someone should need to have <strong>at least 5 (five) pictures</strong>
                                    that are on <strong>public</strong> visibility and which show their <strong>face and nude body</strong>
                                    together. But if they have taken down their pictures and should no longer qualify to remain in
                                    the {{PrettyCircle}}, you may request them to be removed and an admin will check them out.
                                </p>
                                <p>
                                    Note: removal requests are <strong>completely anonymous</strong>: we trust your judgment when
                                    inviting others to join the circle so we also trust you to help maintain the integrity of the
                                    circle when flagging people for removal.
                                </p>
                            </div>
                            {{end}}

                            <div class="field has-text-centered">
                                <button type="submit" name="intent" value="confirm" class="button is-danger">
                                    {{if .CurrentUser.IsAdmin}}Remove{{else}}Request removal{{end}} from the inner circle
                                </button>
                                <button type="submit" name="intent" value="cancel" class="button is-warning ml-1">
                                    Cancel
                                </button>
                            </div>
                        </form>

                    </div>
                </div>

            </div>
        </div>
    </div>

</div>

<script type="text/javascript">
    window.addEventListener("DOMContentLoaded", (event) => {
        let $file = document.querySelector("#file"),
            $fileName = document.querySelector("#fileName");

        $file.addEventListener("change", function() {
            let file = this.files[0];
            $fileName.innerHTML = file.name;
        });
    });
</script>
{{end}}
