Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

_CreateOrUpdate.cshtml

@model GiftCardModel

@{
    const string hideInfoBlockAttributeName = "GiftCardPage.HideInfoBlock";
    var customer = await workContext.GetCurrentCustomerAsync();
    var hideInfoBlock = await genericAttributeService.GetAttributeAsync<bool>(customer, hideInfoBlockAttributeName);

    const string hideUsageHistoryBlockAttributeName = "GiftCardPage.HideUsageHistoryBlock";
    var hideUsageHistoryBlock = await genericAttributeService.GetAttributeAsync<bool>(customer, hideUsageHistoryBlockAttributeName, defaultValue: true);
    
    var hasGiftCardUsageHistoryWritePermission = await permissionService.AuthorizeAsync(StandardPermission.Orders.GIFT_CARDS_CREATE_EDIT_DELETE);
}

<div asp-validation-summary="All"></div>
<input asp-for="Id" type="hidden" />

<section class="content">
    <div class="container-fluid">
        <div class="form-horizontal">
            <nop-cards id="gift-card-cards">
                <nop-card asp-name="gift-card-info" asp-icon="fas fa-info" asp-title="@T("Admin.GiftCards.Info")" asp-hide-block-attribute-name="@hideInfoBlockAttributeName" asp-hide="@hideInfoBlock" asp-advanced="false">@await Html.PartialAsync("_CreateOrUpdate.Info", Model)</nop-card>

                @if (Model.Id > 0 && hasGiftCardUsageHistoryWritePermission)
                {
                    <nop-card asp-name="gift-card-usage-history" asp-icon="fas fa-clock-rotate-left" asp-title="@T("Admin.GiftCards.History")" asp-hide-block-attribute-name="@hideUsageHistoryBlockAttributeName" asp-hide="@hideUsageHistoryBlock" asp-advanced="false">@await Html.PartialAsync("_CreateOrUpdate.History", Model)</nop-card>
                }

                @await Component.InvokeAsync(typeof(AdminWidgetViewComponent), new { widgetZone = AdminWidgetZones.GiftCardDetailsBlock, additionalData = Model })
            </nop-cards>
        </div>
    </div>
</section>