@model ZeroFramework.IdentityServer.API.Models.Consents.ConsentViewModel
@{
    ViewData["Title"] = "授权决定";
}
<div class="page-consent py-5">
    <div class="lead">
        @if (Model.ClientLogoUrl != null)
        {
            <div class="client-logo"><img src="@Model.ClientLogoUrl"></div>
        }
        <h5 class="mb-4">
            @Model.ClientName 正在请求您的许可
        </h5>
    </div>
    <form asp-action="Index">
        <div class="form-group">
            <input type="hidden" asp-for="ReturnUrl" />
            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
        </div>
        <div class="row">
            <div class="col">
                @if (Model.IdentityScopes is not null && Model.IdentityScopes.Any())
                {
                    <div class="form-group">
                        <div class="card">
                            <div class="card-header">
                                <span class="glyphicon glyphicon-user"></span>
                                个人信息
                            </div>
                            <ul class="list-group list-group-flush">
                                @foreach (var scope in Model.IdentityScopes)
                                {
                                    <partial name="_ScopeListItem" model="@scope" />
                                }
                            </ul>
                        </div>
                    </div>
                }

                @if (Model.ApiScopes is not null && Model.ApiScopes.Any())
                {
                    <div class="form-group">
                        <div class="card">
                            <div class="card-header">
                                <span class="glyphicon glyphicon-tasks"></span>
                                应用程序访问
                            </div>
                            <ul class="list-group list-group-flush">
                                @foreach (var scope in Model.ApiScopes)
                                {
                                    <partial name="_ScopeListItem" model="scope" />
                                }
                            </ul>
                        </div>
                    </div>
                }

                <div class="form-group">
                    <div class="card">
                        <div class="card-header">
                            <span class="glyphicon glyphicon-tasks"></span>
                            描述信息
                        </div>
                        <div class="card-body">
                            <input class="form-control" placeholder="Description or name of device" asp-for="Description" autofocus>
                        </div>
                    </div>
                </div>

                @if (Model.AllowRememberConsent)
                {
                    <div class="form-group">
                        <div class="form-check">
                            <input class="form-check-input" asp-for="RememberConsent">
                            <label class="form-check-label" asp-for="RememberConsent">
                                记住我的选择
                            </label>
                        </div>
                    </div>
                }
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <button name="button" value="yes" class="btn btn-primary" autofocus>授权并登录</button>
                <button name="button" value="no" class="btn btn-secondary">拒绝访问</button>
            </div>
            <div class="col-sm-6 col-lg-auto">
                @if (Model.ClientUrl is not null)
                {
                    <a class="btn btn-outline-info" href="@Model.ClientUrl">
                        <span class="glyphicon glyphicon-info-sign"></span>
                        <strong>@Model.ClientName</strong>
                    </a>
                }
            </div>
        </div>
    </form>
</div>