Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language Page Enhancement #6914 #6919

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,24 @@
<div class="col-md-9">
@{
var cultures = System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.SpecificCultures)
.OrderBy(x => x.EnglishName)
.Select(x => new SelectListItem
{
Value = x.IetfLanguageTag,
Text = $"{x.EnglishName}. {x.IetfLanguageTag}"
});
.OrderBy(x => x.EnglishName)
.Select(x => new SelectListItem
{
Value = x.IetfLanguageTag,
Text = $"{x.EnglishName}. {x.IetfLanguageTag}"
});
}
<nop-select asp-for="LanguageCulture" asp-items="@cultures" />
<span asp-validation-for="LanguageCulture"></span>
<script>
$(document).ready(function() {
$(document).ready(function () {
$('#@Html.IdFor(model => model.LanguageCulture)').on('input change', function () {
warningValidation('@Url.Action("LanguageCultureWarning")', '@Html.NameFor(model => model.LanguageCulture)', { currentCulture: '@(Model.LanguageCulture)', changedCulture: $(this).val() });
let changedCulture = $(this).val();
warningValidation('@Url.Action("LanguageCultureWarning")', '@Html.NameFor(model => model.LanguageCulture)', { currentCulture: '@(Model.LanguageCulture)', changedCulture: changedCulture });
let seoCode = changedCulture.split('-')[0];
let flag = changedCulture.split('-')[1].toLowerCase() + '.png';
$("#@Html.IdFor(model=>model.UniqueSeoCode)").val(seoCode);
$("#@Html.IdFor(model=>model.FlagImageFileName)").val(flag).trigger('change');;
});
});
</script>
Expand All @@ -50,11 +55,11 @@
</div>
<div class="col-md-9">
<div class="select2-blue">
<nop-select asp-for="FlagImageFileName" asp-items="Model.AvailableFlagImages" class="form-control" data-dropdown-css-class="select2-blue"/>
<nop-select asp-for="FlagImageFileName" asp-items="Model.AvailableFlagImages" class="form-control" data-dropdown-css-class="select2-blue" />
</div>
<span asp-validation-for="FlagImageFileName"></span>
<script>
$(function() {
$(function () {
$('#FlagImageFileName').select2({
templateResult: function (data) {
if (data.loading) {
Expand All @@ -75,7 +80,7 @@
<nop-label asp-for="Rtl" />
</div>
<div class="col-md-9">
<nop-editor asp-for="Rtl"/>
<nop-editor asp-for="Rtl" />
<span asp-validation-for="Rtl"></span>
</div>
</div>
Expand All @@ -97,18 +102,18 @@
<div class="col-md-3">
<nop-select asp-for="SelectedStoreIds" asp-items="Model.AvailableStores" asp-multiple="true" />
<script>
$(document).ready(function() {
$(document).ready(function () {
var storesIdsInput = $('#@Html.IdFor(model => model.SelectedStoreIds)').select2({
closeOnSelect: false,
@if (!Model.AvailableStores.Any())
{
<text>
disabled: true,
placeholder: 'No stores available',
</text>
}
});
});
@if (!Model.AvailableStores.Any())
{
<text>
disabled: true,
placeholder: 'No stores available',
</text>
}
});
});
</script>
</div>
<div class="col-md-9">
Expand Down