@using MrCMS.Helpers
@model MrCMS.Web.Apps.Ecommerce.Entities.BackInStockNotification.BackInStockNotificationRequest
@{
    var backInStock = ViewData["back-in-stock"] is bool && (bool)ViewData["back-in-stock"];
}
<div class="margin-bottom-20">
    @if (backInStock)
    {
        <p class="bg-success">Thank you, you will be notified when this product is back in stock.</p>
    }
    else
    {
        using (Html.BeginForm("BackInStock", "Product", FormMethod.Post))
        {
            @Html.Honeypot()
            @Html.Hidden("ProductVariant.Id", Model.ProductVariant.Id)

            <div class="form-group">
                @Html.LabelFor(x => x.Email)
                @Html.TextBoxFor(x => x.Email, new { placeholder = "Email address", @class = "form-control" }) <br />
                @Html.ValidationMessageFor(x => x.Email)
            </div>
            <input type="submit" class="btn btn-primary btn-block" value="Email me when back in stock" />

        }
    }
</div>
