@model ShoppingCartModel.GiftCardBoxModel
@if (Model.Display)
{
<div class="giftcard-box card">
    <div class="card-header">
        <h4 class="mb-0">@T("ShoppingCart.GiftCardCouponCode")</h4>
    </div>
    <div class="card-body">
        <div class="hint">@T("ShoppingCart.GiftCardCouponCode.Tooltip")</div>
        @*<div class="coupon-code">
            <input name="giftcardcouponcode" id="giftcardcouponcode" type="text" class="form-control gift-card-coupon-code" aria-label="@T("ShoppingCart.GiftCardCouponCode.Label")" />
            <button type="submit" name="applygiftcardcouponcode" id="applygiftcardcouponcode" class="btn btn-secondary button-2 apply-gift-card-coupon-code-button">@T("ShoppingCart.GiftCardCouponCode.Button")</button>
        </div>*@
        <div class="coupon-code">
            <input name="giftcardcouponcode" id="giftcardcouponcode" placeholder="@T("ShoppingCart.GiftCardCouponCode.Tooltip")" type="text" class="form-control gift-card-coupon-code" aria-label="@T("ShoppingCart.GiftCardCouponCode.Label")" />
            <button type="submit" name="applygiftcardcouponcode" id="applygiftcardcouponcode"
                    class="btn btn-secondary button-2 apply-gift-card-coupon-code-button">
                    @T("ShoppingCart.GiftCardCouponCode.Button")
                </button>
        </div>
        @if (!string.IsNullOrEmpty(Model.Message))
        {
            <div class="@(Model.IsApplied ? "message-success alert alert-success" : "message-failure alert alert-danger")">
                @Model.Message
            </div>
        }
    </div>
</div>
    <script asp-location="Footer">
        $(function () {
            $('#giftcardcouponcode').on('keydown', function (event) {
                if (event.keyCode == 13) {
                    $('#applygiftcardcouponcode').trigger("click");
                    return false;
                }
            });
        });
    </script>
}