Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

2.3 KB
Raw Blame
@using Microsoft.AspNetCore.Mvc.Razor
@model CurrencyModel

@{
    Func<int, HelperResult>
        template = @<div class="grand-fields">
            <admin-field asp-for="@Model.Locales[item].Name"/>
            <input type="hidden" asp-for="@Model.Locales[item].LanguageId"/>
        </div>;
    var cultures = CultureInfo.GetCultures(CultureTypes.SpecificCultures)
        .OrderBy(x => x.EnglishName)
        .Select(x => new SelectListItem
        {
            Value = x.IetfLanguageTag,
            Text = $"{x.EnglishName}. {x.IetfLanguageTag}"
        })
        .ToList();
    cultures.Insert(0, new SelectListItem
    {
        Value = "",
        Text = Loc["Admin.Configuration.Currencies.Fields.DisplayLocale.Select"]
    });
}

@* the currency and its rate, then how an amount is written and rounded *@
<admin-card>
    @if (!string.IsNullOrEmpty(Model.Id))
    {
        <div class="grand-facts mb-3">
            <div>
                <admin-label asp-for="CreatedOn" asp-display-hint="false" class="grand-fact__label"/>
                <div class="grand-fact__value">@Model.CreatedOn</div>
            </div>
        </div>
    }
    <localized-editor localized-template="@template" name="currency-info-localized" language-ids="@Model.Locales.Select(c => c.LanguageId).ToList()">
        <div class="grand-fields">
            <admin-field asp-for="Name"/>
        </div>
    </localized-editor>
    <div class="grand-fields grand-fields--2col mt-3">
        <admin-field asp-for="CurrencyCode" size="sm"/>
        <admin-field asp-for="Rate" size="md"/>
        <admin-field asp-for="Published"/>
        <admin-field asp-for="DisplayOrder" size="sm"/>
        <admin-field asp-for="Stores"/>
    </div>
</admin-card>
<admin-card>
    <div class="grand-fields grand-fields--2col">
        <admin-field asp-for="DisplayLocale" asp-items="cultures" size="lg"/>
        <admin-field asp-for="CustomFormatting" size="md"/>
        <admin-field asp-for="RoundingTypeId" asp-items="EnumTranslationService.ToSelectList((RoundingType)Model.RoundingTypeId)" size="md"/>
        <admin-field asp-for="MidpointRoundId" asp-items="EnumTranslationService.ToSelectList((MidpointRounding)Model.MidpointRoundId)" size="md"/>
        <admin-field asp-for="NumberDecimal" size="sm"/>
    </div>
</admin-card>