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.

Admin panel - Use modal popup with magnific popup js library (#120)

Krzysztof Pajakad1f767ffc7b
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/_CreateOrUpdate.TabInfo.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/_CreateOrUpdate.TabInfo.cshtml
index 1bb862307..56b581486 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/_CreateOrUpdate.TabInfo.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/_CreateOrUpdate.TabInfo.cshtml
@@ -105,8 +105,24 @@
@if (!string.IsNullOrEmpty(Model.PictureId))
{
<label class="control-label">
- <a class='k-link' href='javascript:OpenWindow("@Url.Action("PicturePopup", "Brand", new { area = Constants.AreaAdmin })/?brandId=@(Model.Id)", 800, 600, true);'>@Loc["Admin.Common.Picture.Attributes"]</a>
+ <a class='k-link editpicture' href="@Url.Action("PicturePopup", "Brand", new { area = Constants.AreaAdmin })/?brandId=@(Model.Id)">@Loc["Admin.Common.Picture.Attributes"]</a>
</label>
+ <script>
+ $(document).ready(function () {
+ $('.editpicture').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ });
+ </script>
}
</div>
</div>
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/ProductAddPopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/ProductAddPopup.cshtml
index 3a2f1d5c5..3826077b0 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/ProductAddPopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/ProductAddPopup.cshtml
@@ -2,11 +2,11 @@
@inject AdminAreaSettings adminAreaSettings
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
//page title
ViewBag.Title = Loc["Admin.Catalog.Categories.Products.AddNew"];
}
-<form asp-area="@Constants.AreaAdmin" asp-controller="Category" asp-action="ProductAddPopup" method="post"
+<form id="ProductAddPopup" asp-area="@Constants.AreaAdmin" asp-controller="Category" asp-action="ProductAddPopup" method="post"
asp-route-CategoryId="@Context.Request.Query["CategoryId"]"
asp-route-btnId="@Context.Request.Query["btnId"]"
asp-route-formId="@Context.Request.Query["formId"]">
@@ -105,8 +105,36 @@
</form>
<script>
- $(document).ready(function () {
-
+ var mfp = $.magnificPopup.instance;
+ $("#ProductAddPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshProducts').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+
$('.extend-collapse').hide();
$('.filter-extend-button').click(function () {
$('.extend-collapse').toggle("slow");
@@ -166,11 +194,7 @@
template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
}]
});
- });
-</script>
-<script>
- $(document).ready(function() {
$('#search-products').click(function() {
var grid = $('#products-grid').data('kendoGrid');
grid.dataSource.page(1); //new search. Set page size to 1
@@ -195,7 +219,6 @@
$('#products-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function(e) {
updateMasterCheckbox();
});
- });
function additionalData() {
var data = {
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/_CreateOrUpdate.TabInfo.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/_CreateOrUpdate.TabInfo.cshtml
index 6f647ae1c..0fb5dc442 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/_CreateOrUpdate.TabInfo.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/_CreateOrUpdate.TabInfo.cshtml
@@ -144,8 +144,24 @@
@if (!string.IsNullOrEmpty(Model.PictureId))
{
<label class="control-label">
- <a class='k-link' href='javascript:OpenWindow("@Url.Action("PicturePopup", "Category", new { area = Constants.AreaAdmin })/?categoryId=@(Model.Id)", 800, 600, true);'>@Loc["Admin.Common.Picture.Attributes"]</a>
+ <a class='k-link editpicture' href="@Url.Action("PicturePopup", "Category", new { area = Constants.AreaAdmin })/?categoryId=@(Model.Id)">@Loc["Admin.Common.Picture.Attributes"]</a>
</label>
+ <script>
+ $(document).ready(function () {
+ $('.editpicture').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ });
+ </script>
}
</div>
</div>
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/_CreateOrUpdate.TabProducts.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/_CreateOrUpdate.TabProducts.cshtml
index 534489142..8e5bdcd95 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/_CreateOrUpdate.TabProducts.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/_CreateOrUpdate.TabProducts.cshtml
@@ -8,12 +8,24 @@
<div id="products-grid"></div>
</div>
<div class="panel-footer">
- <button type="submit" id="btnAddNewProduct" onclick="javascript:OpenWindow('@(Url.Action("ProductAddPopup", "Category", new { categoryId = Model.Id, btnId = "btnRefreshProducts", formId = "category-form", area = Constants.AreaAdmin }))', 1000, 1000, true); return false;" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Categories.Products.AddNew"]</button>
+ <a id="btnAddNewProduct" href="@(Url.Action("ProductAddPopup", "Category", new { categoryId = Model.Id, btnId = "btnRefreshProducts", formId = "category-form", area = Constants.AreaAdmin }))" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Categories.Products.AddNew"]</a>
<input type="submit" id="btnRefreshProducts" style="display: none" />
</div>
</div>
<script>
$(document).ready(function () {
+ $('#btnAddNewProduct').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
$("#products-grid").kendoGrid({
dataSource: {
transport: {
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/ProductAddPopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/ProductAddPopup.cshtml
index 3ba12be1c..041a6179c 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/ProductAddPopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/ProductAddPopup.cshtml
@@ -1,12 +1,12 @@
@model CollectionModel.AddCollectionProductModel
@inject AdminAreaSettings adminAreaSettings
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
//page title
ViewBag.Title = Loc["Admin.Catalog.Collections.Products.AddNew"];
}
-<form asp-area="@Constants.AreaAdmin" asp-controller="Collection" asp-action="ProductAddPopup" method="post"
+<form id="ProductAddPopup" asp-area="@Constants.AreaAdmin" asp-controller="Collection" asp-action="ProductAddPopup" method="post"
asp-route-CollectionId="@Context.Request.Query["CollectionId"]"
asp-route-btnId="@Context.Request.Query["btnId"]"
asp-route-formId="@Context.Request.Query["formId"]">
@@ -106,7 +106,35 @@
</script>
}
<script>
- $(document).ready(function () {
+ var mfp = $.magnificPopup.instance;
+ $("#ProductAddPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshProducts').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
$('.extend-collapse').hide();
$('.filter-extend-button').click(function () {
@@ -169,10 +197,7 @@
template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
}]
});
- });
- </script>
- <script>
- $(document).ready(function () {
+
$('#search-products').click(function () {
var grid = $('#products-grid').data('kendoGrid');
grid.dataSource.page(1); //new search. Set page size to 1
@@ -197,7 +222,6 @@
$('#products-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function(e) {
updateMasterCheckbox();
});
- });
function additionalData() {
var data = {
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabInfo.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabInfo.cshtml
index 1dc975850..ee71fa25b 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabInfo.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabInfo.cshtml
@@ -106,8 +106,24 @@
@if (!string.IsNullOrEmpty(Model.PictureId))
{
<label class="control-label">
- <a class='k-link' href='javascript:OpenWindow("@Url.Action("PicturePopup", "Collection", new { area = Constants.AreaAdmin })/?collectionId=@(Model.Id)", 800, 600, true);'>@Loc["Admin.Common.Picture.Attributes"]</a>
+ <a class='k-link editpicture' href="@Url.Action("PicturePopup", "Collection", new { area = Constants.AreaAdmin })/?collectionId=@(Model.Id)">@Loc["Admin.Common.Picture.Attributes"]</a>
</label>
+ <script>
+ $(document).ready(function () {
+ $('.editpicture').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ });
+ </script>
}
</div>
</div>
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabProducts.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabProducts.cshtml
index f04ae8bfc..4c6fa847c 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabProducts.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabProducts.cshtml
@@ -8,13 +8,25 @@
<div id="products-grid"></div>
</div>
<div class="panel-footer">
- <button type="submit" id="btnAddNewProduct" onclick="javascript:OpenWindow('@(Url.Action("ProductAddPopup", "Collection", new { collectionId = Model.Id, btnId = "btnRefreshProducts", formId = "collection-form", area = Constants.AreaAdmin }))', 1000, 1000, true); return false;" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Collections.Products.AddNew"]</button>
+ <a id="btnAddNewProduct" href="@(Url.Action("ProductAddPopup", "Collection", new { collectionId = Model.Id, btnId = "btnRefreshProducts", formId = "collection-form", area = Constants.AreaAdmin }))" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Collections.Products.AddNew"]</a>
<input type="submit" id="btnRefreshProducts" style="display: none" />
</div>
<vc:admin-widget widget-zone="collection_details_products_bottom" additional-data="Model" />
</div>
<script>
$(document).ready(function () {
+ $('#btnAddNewProduct').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
$("#products-grid").kendoGrid({
dataSource: {
transport: {
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/AssociateProductToAttributeValuePopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/AssociateProductToAttributeValuePopup.cshtml
index c1e1c82f1..449caaba8 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/AssociateProductToAttributeValuePopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/AssociateProductToAttributeValuePopup.cshtml
@@ -1,7 +1,7 @@
@model ProductModel.ProductAttributeValueModel.AssociateProductToAttributeValueModel
@inject AdminAreaSettings adminAreaSettings
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
//page title
ViewBag.Title = Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AssociatedProduct.AddNew"];
}
@@ -96,7 +96,7 @@
@if (ViewBag.RefreshPage == true)
{
- <script>
+<script>
try {
//window.opener.document.getElementById('@(ViewBag.productIdInput)').value = '@(ViewBag.productId)';
//window.opener.document.getElementById('@(ViewBag.productNameInput)').innerHTML = '@(ViewBag.productName)';
@@ -105,13 +105,65 @@
}
catch (e){}
window.close();
- </script>
+</script>
}
<input asp-for="AssociatedToProductId" type="hidden" />
<script>
- $(document).ready(function () {
+ var mfp = $.magnificPopup.instance;
+ $("#associateproduct").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ var productId = $("#@Html.IdFor(model => model.AssociatedToProductId)").val();
+ var productName = $("#@Html.IdFor(model => model.AssociatedToProductId)").data("name");
+ var id = $('.btnProductAttributeValueEditPopup.active').data("id");
+ var button = $('.btnProductAttributeValueEditPopup[data-id="' + id + '"]');
+ var mfp = $('.mfp-wrap');
+
+ mfp.attr("data-id", id);
+ mfp.attr("data-prodid", productId);
+ mfp.attr("data-prodname", productName);
+
+ $('.btnProductAttributeValueEditPopup.active').removeClass('active');
+
+ button.click();
+
+ } else {
+ $.magnificPopup.instance.currItem.src = data;
+ $.magnificPopup.instance.updateItemHTML();
+ }
+ }
+ });
+ });
+
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchStoreId: $('#SearchStoreId').val(),
+ SearchVendorId: $('#SearchVendorId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ function selectAssociatedProduct(productid, productname) {
+ $("#@Html.IdFor(model => model.AssociatedToProductId)").val(productid);
+ $("#@Html.IdFor(model => model.AssociatedToProductId)").attr("data-name", productname);
+ $('#associateproduct').submit();
+ }
+
$("#products-grid").kendoGrid({
dataSource: {
transport: {
@@ -156,7 +208,7 @@
field: "Name",
title: "@Loc["Admin.Common.Select"]",
width: 50,
- template: '<input type="button" value="@Loc["Admin.Common.Select"]" onclick="selectAssociatedProduct(\'#=Id#\')" class="k-button" />'
+ template: '<input type="button" value="@Loc["Admin.Common.Select"]" onclick="selectAssociatedProduct(\'#=Id#\',\'#=Name#\')" class="k-button" />'
},{
field: "Name",
title: "@Loc["Admin.Catalog.Products.Fields.Name"]"
@@ -169,19 +221,13 @@
template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
}]
});
- });
- </script>
-
- <script>
- $(document).ready(function () {
$('#search-products').click(function () {
var grid = $('#products-grid').data('kendoGrid');
grid.dataSource.page(1); //new search. Set page size to 1
//grid.dataSource.read(); we already loaded the grid above using "page" function
return false;
});
- });
$("#@Html.IdFor(model => model.SearchProductName)").keydown(function (event) {
if (event.keyCode == 13) {
@@ -190,23 +236,5 @@
}
});
- function additionalData() {
- var data = {
- SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
- SearchCategoryId: $('#SearchCategoryId').val(),
- SearchBrandId: $('#SearchBrandId').val(),
- SearchCollectionId: $('#SearchCollectionId').val(),
- SearchStoreId: $('#SearchStoreId').val(),
- SearchVendorId: $('#SearchVendorId').val(),
- SearchProductTypeId: $('#SearchProductTypeId').val()
- };
- addAntiForgeryToken(data);
- return data;
- }
-
- function selectAssociatedProduct(productid) {
- $("#@Html.IdFor(model => model.AssociatedToProductId)").val(productid);
- $('#associateproduct').submit();
- }
</script>
</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/AssociatedProductAddPopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/AssociatedProductAddPopup.cshtml
index c99c49973..d1979e64e 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/AssociatedProductAddPopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/AssociatedProductAddPopup.cshtml
@@ -6,7 +6,7 @@
ViewBag.Title = Loc["Admin.Catalog.Products.AssociatedProducts.AddNew"];
}
-<form asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="AssociatedProductAddPopup"
+<form id="AssociatedProductAddPopup" asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="AssociatedProductAddPopup"
asp-route-ProductId="@Context.Request.Query["ProductId"]"
asp-route-btnId="@Context.Request.Query["btnId"]"
asp-route-formId="@Context.Request.Query["formId"]">
@@ -106,7 +106,36 @@
<script>
- $(document).ready(function () {
+
+ var mfp = $.magnificPopup.instance;
+ $("#AssociatedProductAddPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshAssociatedProducts').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
$('.extend-collapse').hide();
$('.filter-extend-button').click(function () {
@@ -114,6 +143,27 @@
$('.filter-text-close').toggle();
});
+
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchStoreId: $('#SearchStoreId').val(),
+ SearchVendorId: $('#SearchVendorId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ function updateMasterCheckbox() {
+ var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
+ var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
+ $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
+ }
+
$("#products-grid").kendoGrid({
dataSource: {
transport: {
@@ -170,12 +220,7 @@
template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
}]
});
- });
- </script>
-
- <script>
- $(document).ready(function () {
$('#search-products').click(function () {
var grid = $('#products-grid').data('kendoGrid');
grid.dataSource.page(1); //new search. Set page size to 1
@@ -200,26 +245,5 @@
$('#products-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function(e) {
updateMasterCheckbox();
});
- });
-
- function additionalData() {
- var data = {
- SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
- SearchCategoryId: $('#SearchCategoryId').val(),
- SearchBrandId: $('#SearchBrandId').val(),
- SearchCollectionId: $('#SearchCollectionId').val(),
- SearchStoreId: $('#SearchStoreId').val(),
- SearchVendorId: $('#SearchVendorId').val(),
- SearchProductTypeId: $('#SearchProductTypeId').val()
- };
- addAntiForgeryToken(data);
- return data;
- }
-
- function updateMasterCheckbox() {
- var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
- var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
- $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
- }
</script>
</form>
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/AttributeCombinationPopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/AttributeCombinationPopup.cshtml
index e9b5a6b73..964400612 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/AttributeCombinationPopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/AttributeCombinationPopup.cshtml
@@ -2,7 +2,7 @@
@inject Grand.Business.Common.Interfaces.Stores.IStoreService _storeService
@inject Grand.Business.Common.Interfaces.Directory.IGroupService _groupService
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
if (string.IsNullOrEmpty(Model.Id))
{
ViewBag.Title = Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.AddTitle"];
@@ -12,7 +12,7 @@
ViewBag.Title = Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Update"];
}
}
-<form asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="AttributeCombinationPopup" enctype="multipart/form-data"
+<form id="AttributeCombinationPopup" asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="AttributeCombinationPopup" enctype="multipart/form-data"
asp-route-productId="@Context.Request.Query["productId"]"
asp-route-Id="@Context.Request.Query["Id"]"
asp-route-btnId="@Context.Request.Query["btnId"]"
@@ -262,188 +262,218 @@
window.close();
</script>
}
- @if (!string.IsNullOrEmpty(Model.Id))
- {
- <script>
- $(document).ready(function () {
- $("#tierprices-grid").kendoGrid({
- dataSource: {
- transport: {
- read: {
- url: "@Html.Raw(Url.Action("ProductAttributeCombinationTierPriceList", "Product", new { productId = Model.ProductId, productAttributeCombinationId = Model.Id, area = Constants.AreaAdmin }))",
- type: "POST",
- dataType: "json",
- data: addAntiForgeryToken
- },
- create: {
- url: "@Html.Raw(Url.Action("ProductAttributeCombinationTierPriceInsert", "Product", new { productId = Model.ProductId, productAttributeCombinationId = Model.Id, area = Constants.AreaAdmin }))",
- type: "POST",
- dataType: "json",
- data: addAntiForgeryToken
- },
- update: {
- url:"@Html.Raw(Url.Action("ProductAttributeCombinationTierPriceUpdate", "Product", new { productId = Model.ProductId, productAttributeCombinationId = Model.Id, area = Constants.AreaAdmin }))",
- type: "POST",
- dataType: "json",
- data: addAntiForgeryToken
- },
- destroy: {
- url: "@Html.Raw(Url.Action("ProductAttributeCombinationTierPriceDelete", "Product", new { productId = Model.ProductId, productAttributeCombinationId = Model.Id, area = Constants.AreaAdmin }))",
- type: "POST",
- dataType: "json",
- data: addAntiForgeryToken
- }
- },
- schema: {
- data: "Data",
- total: "Total",
- errors: "Errors",
- model: {
- id: "Id",
- fields: {
- Store: { editable: true, type: "string" },
- StoreId: { editable: true, type: "string" },
- CustomerGroup: { editable: true, type: "string" },
- CustomerGroupId: { editable: true, type: "string" },
- Quantity: { editable: true, type: "number" },
- Price: { editable: true, type: "number" },
- Id: { editable: false, type: "string" }
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#AttributeCombinationPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshCombinations').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
}
- }
- },
- requestEnd: function (e) {
- if (e.type == "create" || e.type == "update") {
- this.read();
- }
- },
- error: function (e) {
- display_kendoui_grid_error(e);
- // Cancel the changes
- this.cancelChanges();
- },
- serverPaging: true,
- serverFiltering: true,
- serverSorting: true
- },
- pageable: {
- refresh: true,
- numeric: false,
- previousNext: false,
- info: false
- },
- toolbar: [{ name: "create", text: "@Loc["Admin.Common.AddNewRecord"]" }],
- editable: {
- confirmation: false,
- mode: "inline"
- },
- scrollable: false,
- columns: [{
- field: "StoreId",
- title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.TierPrices.Store"]",
- width: 250,
- editor: storeDropDownEditor,
- template: "#:Store#"
- },
- {
- field: "CustomerGroupId",
- title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.TierPrices.CustomerGroup"]",
- width: 250,
- editor: customerGroupDropDownEditor,
- template: "#:CustomerGroup#"
- },
-
- {
- field: "Quantity",
- title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.TierPrices.Quantity"]",
- width: 150,
- format: "{0:0}"
- }, {
- field: "Price",
- title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.TierPrices.Price"]",
- width: 150,
- editor: function (container, options) {
- $('<input name="' + options.field + '"/>')
- .appendTo(container)
- .kendoNumericTextBox({
- format: "{0:n4}",
- decimals: 4
- });
+ });
}
- },{
- command: [{
- name: "edit",
- text: {
- edit: "@Loc["Admin.Common.Edit"]",
- update: "@Loc["Admin.Common.Update"]",
- cancel: "@Loc["Admin.Common.Cancel"]"
- }
- }, {
- name: "destroy",
- text: "@Loc["Admin.Common.Delete"]"
- }],
- width: 200
- }]
+ }
});
});
+ </script>
+ @if (!string.IsNullOrEmpty(Model.Id))
+ {
+ <script>
+ //local datasource
+ var allStores = [
+ {
+ Id : ' ',
+ Name : "@Loc["Admin.Settings.AllSettings.Fields.StoreName.AllStores"]"
+ }
+ @{
+ var allStores = await _storeService.GetAllStores();
+ }
+ @foreach (var store in allStores)
+ {
+ <text>
+ , {
+ Id: "@(store.Id)",
+ Name: "@(Html.Raw(System.Text.Encodings.Web.JavaScriptEncoder.Default.Encode(string.IsNullOrEmpty(store.Shortcut) ? "" : store.Shortcut)))"
+ }
+ </text>
+ }
- //local datasource
- var allStores = [
- {
- Id : ' ',
- Name : "@Loc["Admin.Settings.AllSettings.Fields.StoreName.AllStores"]"
- }
- @{
- var allStores = await _storeService.GetAllStores();
- }
- @foreach (var store in allStores)
- {
- <text>
- , {
- Id: "@(store.Id)",
- Name: "@(Html.Raw(System.Text.Encodings.Web.JavaScriptEncoder.Default.Encode(string.IsNullOrEmpty(store.Shortcut) ? "" : store.Shortcut)))"
- }
- </text>
- }
-
- ];
+ ];
- var allCustomerGroups = [
- {
- Id : ' ',
- Name : "@Loc["Admin.Catalog.Products.TierPrices.Fields.CustomerGroup.All"]"
- }
- @{
- var allCustomerGroups = await _groupService.GetAllCustomerGroups(showHidden: true);
- }
- @foreach (var customerGroup in allCustomerGroups)
- {
- <text>
- , {
- Id: "@(customerGroup.Id)",
- Name: "@(Html.Raw(System.Text.Encodings.Web.JavaScriptEncoder.Default.Encode(string.IsNullOrEmpty(customerGroup.Name) ? "": customerGroup.Name)))"
+ var allCustomerGroups = [
+ {
+ Id : ' ',
+ Name : "@Loc["Admin.Catalog.Products.TierPrices.Fields.CustomerGroup.All"]"
+ }
+ @{
+ var allCustomerGroups = await _groupService.GetAllCustomerGroups(showHidden: true);
}
+ @foreach (var customerGroup in allCustomerGroups)
+ {
+ <text>
+ , {
+ Id: "@(customerGroup.Id)",
+ Name: "@(Html.Raw(System.Text.Encodings.Web.JavaScriptEncoder.Default.Encode(string.IsNullOrEmpty(customerGroup.Name) ? "": customerGroup.Name))))"
+ }
</text>
- }
- ];
+ }
+ ];
- function storeDropDownEditor(container, options) {
- $('<input required data-text-field="Name" data-value-field="Id" data-bind="value:StoreId"/>')
- .appendTo(container)
- .kendoDropDownList({
- autoBind: true,
- dataSource: allStores,
- });
- }
+ function storeDropDownEditor(container, options) {
+ $('<input required data-text-field="Name" data-value-field="Id" data-bind="value:StoreId"/>')
+ .appendTo(container)
+ .kendoDropDownList({
+ autoBind: true,
+ dataSource: allStores,
+ });
+ }
- function customerGroupDropDownEditor(container, options) {
- $('<input required data-text-field="Name" data-value-field="Id" data-bind="value:CustomerGroupId"/>')
- .appendTo(container)
- .kendoDropDownList({
- autoBind: true,
- dataSource: allCustomerGroups,
+ function customerGroupDropDownEditor(container, options) {
+ $('<input required data-text-field="Name" data-value-field="Id" data-bind="value:CustomerGroupId"/>')
+ .appendTo(container)
+ .kendoDropDownList({
+ autoBind: true,
+ dataSource: allCustomerGroups,
+
+ });
+ }
+
+ $("#tierprices-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ProductAttributeCombinationTierPriceList", "Product", new { productId = Model.ProductId, productAttributeCombinationId = Model.Id, area = Constants.AreaAdmin }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ create: {
+ url: "@Html.Raw(Url.Action("ProductAttributeCombinationTierPriceInsert", "Product", new { productId = Model.ProductId, productAttributeCombinationId = Model.Id, area = Constants.AreaAdmin }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ update: {
+ url:"@Html.Raw(Url.Action("ProductAttributeCombinationTierPriceUpdate", "Product", new { productId = Model.ProductId, productAttributeCombinationId = Model.Id, area = Constants.AreaAdmin }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ },
+ destroy: {
+ url: "@Html.Raw(Url.Action("ProductAttributeCombinationTierPriceDelete", "Product", new { productId = Model.ProductId, productAttributeCombinationId = Model.Id, area = Constants.AreaAdmin }))",
+ type: "POST",
+ dataType: "json",
+ data: addAntiForgeryToken
+ }
+ },
+ schema: {
+ data: "Data",
+ total: "Total",
+ errors: "Errors",
+ model: {
+ id: "Id",
+ fields: {
+ Store: { editable: true, type: "string" },
+ StoreId: { editable: true, type: "string" },
+ CustomerGroup: { editable: true, type: "string" },
+ CustomerGroupId: { editable: true, type: "string" },
+ Quantity: { editable: true, type: "number" },
+ Price: { editable: true, type: "number" },
+ Id: { editable: false, type: "string" }
+ }
+ }
+ },
+ requestEnd: function (e) {
+ if (e.type == "create" || e.type == "update") {
+ this.read();
+ }
+ },
+ error: function (e) {
+ display_kendoui_grid_error(e);
+ // Cancel the changes
+ this.cancelChanges();
+ },
+ serverPaging: true,
+ serverFiltering: true,
+ serverSorting: true
+ },
+ pageable: {
+ refresh: true,
+ numeric: false,
+ previousNext: false,
+ info: false
+ },
+ toolbar: [{ name: "create", text: "@Loc["Admin.Common.AddNewRecord"]" }],
+ editable: {
+ confirmation: false,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "StoreId",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.TierPrices.Store"]",
+ width: 250,
+ editor: storeDropDownEditor,
+ template: "#:Store#"
+ },
+ {
+ field: "CustomerGroupId",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.TierPrices.CustomerGroup"]",
+ width: 250,
+ editor: customerGroupDropDownEditor,
+ template: "#:CustomerGroup#"
+ },
+
+ {
+ field: "Quantity",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.TierPrices.Quantity"]",
+ width: 150,
+ format: "{0:0}"
+ }, {
+ field: "Price",
+ title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.TierPrices.Price"]",
+ width: 150,
+ editor: function (container, options) {
+ $('<input name="' + options.field + '"/>')
+ .appendTo(container)
+ .kendoNumericTextBox({
+ format: "{0:n4}",
+ decimals: 4
+ });
+ }
+ },{
+ command: [{
+ name: "edit",
+ text: {
+ edit: "@Loc["Admin.Common.Edit"]",
+ update: "@Loc["Admin.Common.Update"]",
+ cancel: "@Loc["Admin.Common.Cancel"]"
+ }
+ }, {
+ name: "destroy",
+ text: "@Loc["Admin.Common.Delete"]"
+ }],
+ width: 200
+ }]
+ });
- });
- }
</script>
}
</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/BundleProductAddPopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/BundleProductAddPopup.cshtml
index aae8c2b3c..7145cfeee 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/BundleProductAddPopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/BundleProductAddPopup.cshtml
@@ -1,18 +1,16 @@
@model ProductModel.AddBundleProductModel
@inject AdminAreaSettings adminAreaSettings
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
//page title
ViewBag.Title = Loc["Admin.Catalog.Products.BundleProducts.AddNew"];
}
-<form asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="BundleProductAddPopup"
+<form id="BundleProductAddPopup" asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="BundleProductAddPopup"
asp-route-ProductId="@Context.Request.Query["ProductId"]"
asp-route-btnId="@Context.Request.Query["btnId"]"
asp-route-formId="@Context.Request.Query["formId"]">
-
-
<div class="row">
<div class="col-md-12">
<div class="x_panel light form-fit popup-window">
@@ -99,7 +97,36 @@
</script>
}
<script>
- $(document).ready(function () {
+ var mfp = $.magnificPopup.instance;
+ $("#BundleProductAddPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshBundleProducts').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+
$("#products-grid").kendoGrid({
dataSource: {
transport: {
@@ -153,12 +180,8 @@
template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
}]
});
- });
- </script>
- <script>
- $(document).ready(function () {
$('#search-products').click(function () {
var grid = $('#products-grid').data('kendoGrid');
grid.dataSource.page(1); //new search. Set page size to 1
@@ -183,7 +206,6 @@
$('#products-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function(e) {
updateMasterCheckbox();
});
- });
function additionalData() {
var data = {
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/CrossSellProductAddPopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/CrossSellProductAddPopup.cshtml
index 689768727..92950d09a 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/CrossSellProductAddPopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/CrossSellProductAddPopup.cshtml
@@ -1,11 +1,11 @@
@model ProductModel.AddCrossSellProductModel
@inject AdminAreaSettings adminAreaSettings
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
//page title
ViewBag.Title = Loc["Admin.Catalog.Products.CrossSells.AddNew"];
}
-<form asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="CrossSellProductAddPopup"
+<form id="CrossSellProductAddPopup" asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="CrossSellProductAddPopup"
asp-route-ProductId="@Context.Request.Query["ProductId"]"
asp-route-btnId="@Context.Request.Query["btnId"]"
asp-route-formId="@Context.Request.Query["formId"]">
@@ -103,7 +103,55 @@
}
<script>
- $(document).ready(function () {
+ var mfp = $.magnificPopup.instance;
+ $("#CrossSellProductAddPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshCrossSellProducts').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchStoreId: $('#SearchStoreId').val(),
+ SearchVendorId: $('#SearchVendorId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+ function updateMasterCheckbox() {
+ var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
+ var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
+ $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
+ }
+
$("#products-grid").kendoGrid({
dataSource: {
transport: {
@@ -158,12 +206,7 @@
template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
}]
});
- });
- </script>
-
- <script>
- $(document).ready(function () {
$('#search-products').click(function () {
var grid = $('#products-grid').data('kendoGrid');
grid.dataSource.page(1); //new search. Set page size to 1
@@ -188,25 +231,6 @@
$('#products-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function(e) {
updateMasterCheckbox();
});
- });
- function additionalData() {
- var data = {
- SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
- SearchCategoryId: $('#SearchCategoryId').val(),
- SearchBrandId: $('#SearchBrandId').val(),
- SearchCollectionId: $('#SearchCollectionId').val(),
- SearchStoreId: $('#SearchStoreId').val(),
- SearchVendorId: $('#SearchVendorId').val(),
- SearchProductTypeId: $('#SearchProductTypeId').val()
- };
- addAntiForgeryToken(data);
- return data;
- }
- function updateMasterCheckbox() {
- var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
- var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
- $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
- }
</script>
</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeConditionPopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeConditionPopup.cshtml
index 244811c51..25885dc11 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeConditionPopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeConditionPopup.cshtml
@@ -1,10 +1,10 @@
@using Grand.Domain.Catalog
@model ProductAttributeConditionModel
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
ViewBag.Title = Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Condition"];
}
-<form asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="ProductAttributeConditionPopup" enctype="multipart/form-data" method="post"
+<form id="ProductAttributeConditionPopup" asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="ProductAttributeConditionPopup" enctype="multipart/form-data" method="post"
asp-route-ProductId="@Context.Request.Query["ProductId"]"
asp-route-productAttributeMappingId="@Context.Request.Query["ProductAttributeMappingId"]"
asp-route-btnId="@Context.Request.Query["btnId"]"
@@ -168,13 +168,37 @@
- <script>
- $(document).ready(function() {
- $("#@Html.IdFor(model => model.EnableCondition)").click(toggleEnableCondition);
-
- toggleEnableCondition();
+<script>
+ var mfp = $.magnificPopup.instance;
+ $("#ProductAttributeConditionPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshProductAttributes').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
});
-
+
function toggleEnableCondition() {
if ($('#@Html.IdFor(model => model.EnableCondition)').is(':checked')) {
$('#pnlAttributes').show();
@@ -182,6 +206,10 @@
$('#pnlAttributes').hide();
}
}
- </script>
+
+ $("#@Html.IdFor(model => model.EnableCondition)").click(toggleEnableCondition);
+
+ toggleEnableCondition();
+</script>
</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeMappingPopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeMappingPopup.cshtml
index 56a4f0b8c..88fa88529 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeMappingPopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeMappingPopup.cshtml
@@ -1,17 +1,17 @@
@using Grand.Domain.Catalog
@model ProductModel.ProductAttributeMappingModel
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
//page title
ViewBag.Title = Loc["Admin.Catalog.Products.ProductAttributes.Details"];
}
-<form asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="ProductAttributeMappingPopup" enctype="multipart/form-data" method="post"
+<form id="ProductAttributeMappingPopup" asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="ProductAttributeMappingPopup" enctype="multipart/form-data" method="post"
asp-route-ProductId="@Context.Request.Query["ProductId"]"
asp-route-productAttributeMappingId="@Context.Request.Query["ProductAttributeMappingId"]"
asp-route-btnId="@Context.Request.Query["btnId"]"
asp-route-formId="@Context.Request.Query["formId"]">
-
+
<div asp-validation-summary="All"></div>
<input asp-for="ProductId" type="hidden" />
<input asp-for="Id" type="hidden" />
@@ -111,9 +111,41 @@
@if (ViewBag.RefreshPage == true)
{
<script>
+ alert('test');
try {window.opener.document.forms['@(Context.Request.Query["formId"])'].@(Context.Request.Query["btnId"]).click();}
catch (e){}
window.close();
</script>
}
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#ProductAttributeMappingPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshProductAttributes').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+ </script>
</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeValidationRulesPopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeValidationRulesPopup.cshtml
index a99ba1716..e7452b983 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeValidationRulesPopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeValidationRulesPopup.cshtml
@@ -1,17 +1,17 @@
@model ProductModel.ProductAttributeMappingModel
@using Grand.Domain.Catalog
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
//page title
ViewBag.Title = Loc["Admin.Catalog.Products.ProductAttributes.Attributes.ValidationRules"];
var attributeControlType = (AttributeControlType)Model.AttributeControlTypeId;
}
-<form asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="ProductAttributeValidationRulesPopup" enctype="multipart/form-data" method="post"
+<form id="ProductAttributeValidationRulesPopup" asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="ProductAttributeValidationRulesPopup" enctype="multipart/form-data" method="post"
asp-route-ProductId="@Context.Request.Query["ProductId"]"
asp-route-btnId="@Context.Request.Query["btnId"]"
asp-route-formId="@Context.Request.Query["formId"]">
-
+
<div class="row">
<div class="col-md-12">
<div class="x_panel light form-fit">
@@ -85,6 +85,37 @@
}
@if (!Model.ValidationRulesAllowed)
{
- <div class="note note-danger">>This attribute type cannot have validation rules</div>
+ <div class="note note-danger">This attribute type cannot have validation rules</div>
}
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#ProductAttributeValidationRulesPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshProductAttributes').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+ </script>
</form>
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeValueCreatePopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeValueCreatePopup.cshtml
index 28e9bb2a5..ed6a1318e 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeValueCreatePopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeValueCreatePopup.cshtml
@@ -1,16 +1,15 @@
@model ProductModel.ProductAttributeValueModel
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
//page title
ViewBag.Title = Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Values.AddNew"];
}
-<form asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="ProductAttributeValueCreatePopup" method="post"
+<form id="ProductAttributeValueCreatePopup" asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="ProductAttributeValueCreatePopup" method="post"
asp-route-ProductId="@Context.Request.Query["ProductId"]"
asp-route-productAttributeMappingId="@Context.Request.Query["ProductAttributeMappingId"]"
asp-route-btnId="@Context.Request.Query["btnId"]"
- asp-route-formId="@Context.Request.Query["formId"]"
- >
-
+ asp-route-formId="@Context.Request.Query["formId"]">
+
<div class="row">
<div class="col-md-12">
<div class="x_panel light form-fit">
@@ -25,9 +24,39 @@
</div>
</div>
<div class="x_content form">
- <partial name="_CreateOrUpdateProductAttributeValue" model="Model" />
+ <partial name="_CreateOrUpdateProductAttributeValue" model="Model" />
</div>
</div>
</div>
</div>
+ <script>
+ $("#ProductAttributeValueCreatePopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ $.magnificPopup.instance.close();
+ $('#btnRefreshProductAttributes').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+ </script>
</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeValueEditPopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeValueEditPopup.cshtml
index 781399b3d..cdfd2821b 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeValueEditPopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductAttributeValueEditPopup.cshtml
@@ -1,16 +1,15 @@
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
//page title
ViewBag.Title = Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Values.EditValueDetails"];
}
@model ProductModel.ProductAttributeValueModel
-<form asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="ProductAttributeValueEditPopup" method="post"
+<form id="ProductAttributeValueEditPopup" asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="ProductAttributeValueEditPopup" method="post"
asp-route-ProductId="@Context.Request.Query["ProductId"]"
asp-route-productAttributeMappingId="@Context.Request.Query["ProductAttributeMappingId"]"
asp-route-btnId="@Context.Request.Query["btnId"]"
- asp-route-formId="@Context.Request.Query["formId"]"
- >
-
+ asp-route-formId="@Context.Request.Query["formId"]">
+
<div class="row">
<div class="col-md-12">
<div class="x_panel light form-fit">
@@ -25,9 +24,40 @@
</div>
</div>
<div class="x_content form">
- <partial name="_CreateOrUpdateProductAttributeValue" model="Model" />
+ <partial name="_CreateOrUpdateProductAttributeValue" model="Model" />
</div>
</div>
</div>
</div>
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#ProductAttributeValueEditPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshProductAttributes').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+ </script>
</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductPicturePopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductPicturePopup.cshtml
index e32162e26..0321f5659 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductPicturePopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/ProductPicturePopup.cshtml
@@ -2,11 +2,11 @@
@model ProductModel.ProductPictureModel
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
//page title
ViewBag.Title = Loc["Admin.Catalog.Products.Pictures.Details"];
}
-<form asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="ProductPicturePopup" enctype="multipart/form-data" method="post"
+<form id="ProductPicturePopup" asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="ProductPicturePopup" enctype="multipart/form-data" method="post"
asp-route-ProductId="@Context.Request.Query["ProductId"]"
asp-route-Id="@Context.Request.Query["Id"]"
asp-route-btnId="@Context.Request.Query["btnId"]"
@@ -97,4 +97,35 @@
window.close();
</script>
}
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#ProductPicturePopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshProductPictures').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+ </script>
</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/RecommendedProductAddPopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/RecommendedProductAddPopup.cshtml
index 4b0cbec2b..0c2f7f4aa 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/RecommendedProductAddPopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/RecommendedProductAddPopup.cshtml
@@ -1,16 +1,14 @@
@model ProductModel.AddRecommendedProductModel
@inject AdminAreaSettings adminAreaSettings
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
//page title
ViewBag.Title = Loc["Admin.Catalog.Products.Recommended.AddNew"];
}
-<form asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="RecommendedProductAddPopup"
+<form id="RecommendedProductAddPopup" asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="RecommendedProductAddPopup"
asp-route-ProductId="@Context.Request.Query["ProductId"]"
asp-route-btnId="@Context.Request.Query["btnId"]"
asp-route-formId="@Context.Request.Query["formId"]">
-
-
<div class="row">
<div class="col-md-12">
<div class="x_panel light form-fit popup-window">
@@ -102,8 +100,55 @@
</script>
}
- <script>
- $(document).ready(function () {
+<script>
+ var mfp = $.magnificPopup.instance;
+ $("#RecommendedProductAddPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshRecommendedProducts').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchStoreId: $('#SearchStoreId').val(),
+ SearchVendorId: $('#SearchVendorId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+ function updateMasterCheckbox() {
+ var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
+ var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
+ $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
+ }
$("#products-grid").kendoGrid({
dataSource: {
transport: {
@@ -158,12 +203,7 @@
template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
}]
});
- });
- </script>
-
- <script>
- $(document).ready(function () {
$('#search-products').click(function () {
var grid = $('#products-grid').data('kendoGrid');
grid.dataSource.page(1); //new search. Set page size to 1
@@ -188,25 +228,5 @@
$('#products-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function(e) {
updateMasterCheckbox();
});
- });
-
- function additionalData() {
- var data = {
- SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
- SearchCategoryId: $('#SearchCategoryId').val(),
- SearchBrandId: $('#SearchBrandId').val(),
- SearchCollectionId: $('#SearchCollectionId').val(),
- SearchStoreId: $('#SearchStoreId').val(),
- SearchVendorId: $('#SearchVendorId').val(),
- SearchProductTypeId: $('#SearchProductTypeId').val()
- };
- addAntiForgeryToken(data);
- return data;
- }
- function updateMasterCheckbox() {
- var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
- var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
- $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
- }
- </script>
+</script>
</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/RelatedProductAddPopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/RelatedProductAddPopup.cshtml
index 6f01ebef0..224a247ef 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/RelatedProductAddPopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/RelatedProductAddPopup.cshtml
@@ -1,11 +1,11 @@
@model ProductModel.AddRelatedProductModel
@inject AdminAreaSettings adminAreaSettings
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
//page title
ViewBag.Title = Loc["Admin.Catalog.Products.RelatedProducts.AddNew"];
}
-<form asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="RelatedProductAddPopup"
+<form id="RelatedProductAddPopup" asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="RelatedProductAddPopup"
asp-route-productId="@Context.Request.Query["productId"]"
asp-route-btnId="@Context.Request.Query["btnId"]"
asp-route-formId="@Context.Request.Query["formId"]">
@@ -102,7 +102,55 @@
</script>
}
<script>
- $(document).ready(function () {
+ var mfp = $.magnificPopup.instance;
+ $("#RelatedProductAddPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshRelatedProducts').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchStoreId: $('#SearchStoreId').val(),
+ SearchVendorId: $('#SearchVendorId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ function updateMasterCheckbox() {
+ var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
+ var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
+ $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
+ }
+
$("#products-grid").kendoGrid({
dataSource: {
transport: {
@@ -156,12 +204,7 @@
template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
}]
});
- });
- </script>
-
-
- <script>
- $(document).ready(function () {
+
$('#search-products').click(function () {
var grid = $('#products-grid').data('kendoGrid');
grid.dataSource.page(1); //new search. Set page size to 1
@@ -186,26 +229,6 @@
$('#products-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function(e) {
updateMasterCheckbox();
});
- });
-
- function additionalData() {
- var data = {
- SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
- SearchCategoryId: $('#SearchCategoryId').val(),
- SearchBrandId: $('#SearchBrandId').val(),
- SearchCollectionId: $('#SearchCollectionId').val(),
- SearchStoreId: $('#SearchStoreId').val(),
- SearchVendorId: $('#SearchVendorId').val(),
- SearchProductTypeId: $('#SearchProductTypeId').val()
- };
- addAntiForgeryToken(data);
- return data;
- }
-
- function updateMasterCheckbox() {
- var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
- var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
- $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
- }
+
</script>
</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/RequiredProductAddPopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/RequiredProductAddPopup.cshtml
index 8c92606c2..93782d856 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/RequiredProductAddPopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/RequiredProductAddPopup.cshtml
@@ -1,97 +1,121 @@
@model ProductModel.AddRequiredProductModel
@inject AdminAreaSettings adminAreaSettings
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
//page title
ViewBag.Title = Loc["Admin.Catalog.Products.Fields.RequiredProductIds.Choose"];
}
-
- <div class="row">
- <div class="col-md-12">
- <div class="x_panel light form-fit popup-window">
- <div class="x_title">
- <div class="caption">
- <i class="fa fa-cubes"></i>
- @Loc["Admin.Catalog.Products.Fields.RequiredProductIds.Choose"]
- </div>
+<div class="row">
+ <div class="col-md-12">
+ <div class="x_panel light form-fit popup-window">
+ <div class="x_title">
+ <div class="caption">
+ <i class="fa fa-cubes"></i>
+ @Loc["Admin.Catalog.Products.Fields.RequiredProductIds.Choose"]
</div>
- <div class="x_content form">
- <div class="form-horizontal">
- <div class="form-body">
- <div class="main-header col-12 px-0">
- <div class="row align-items-end">
- <div class="col-md-8 col-ms-12 col-12">
- <div class="form-group mb-0">
- <admin-label asp-for="SearchProductName" class="control-label" />
- <admin-input asp-for="SearchProductName" />
- </div>
+ </div>
+ <div class="x_content form">
+ <div class="form-horizontal">
+ <div class="form-body">
+ <div class="main-header col-12 px-0">
+ <div class="row align-items-end">
+ <div class="col-md-8 col-ms-12 col-12">
+ <div class="form-group mb-0">
+ <admin-label asp-for="SearchProductName" class="control-label" />
+ <admin-input asp-for="SearchProductName" />
</div>
- <div class="col-md-4 col-sm-12 col-12">
- <div class="form-actions">
- <div class="btn-group btn-group-sm btn-group-devided">
- <button class="btn btn-success filter-submit" id="search-products">
- <i class="fa fa-search"></i>&nbsp; @Loc["Admin.Common.Search"]
- </button>
- <button class="btn btn-success" type="submit" name="save"><i class="fa fa-check"></i> &nbsp; @Loc["Admin.Common.Save"] </button>
- <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
- <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
- </button>
- </div>
+ </div>
+ <div class="col-md-4 col-sm-12 col-12">
+ <div class="form-actions">
+ <div class="btn-group btn-group-sm btn-group-devided">
+ <button class="btn btn-success filter-submit" id="search-products">
+ <i class="fa fa-search"></i>&nbsp; @Loc["Admin.Common.Search"]
+ </button>
+ <button class="btn btn-success" type="submit" name="save"><i class="fa fa-check"></i> &nbsp; @Loc["Admin.Common.Save"] </button>
+ <button class="btn btn-info" type="button" data-toggle="collapse" data-target="#filterCollapse" aria-expanded="false" aria-controls="filterCollapse">
+ <i class="fa fa-filter"></i>&nbsp; @Loc["Admin.Common.Filters"]
+ </button>
</div>
</div>
</div>
</div>
- <div class="collapse" id="filterCollapse">
- <div class="drop-filters-container">
- <div class="form-group">
- <admin-label asp-for="SearchCategoryId" class="col-sm-3 control-label" />
- <div class="col-md-9 col-sm-9">
- <admin-input asp-for="SearchCategoryId" />
- </div>
+ </div>
+ <div class="collapse" id="filterCollapse">
+ <div class="drop-filters-container">
+ <div class="form-group">
+ <admin-label asp-for="SearchCategoryId" class="col-sm-3 control-label" />
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCategoryId" />
</div>
- <div class="form-group">
- <admin-label asp-for="SearchBrandId" class="col-sm-3 control-label" />
- <div class="col-md-9 col-sm-9">
- <admin-input asp-for="SearchBrandId" />
- </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchBrandId" class="col-sm-3 control-label" />
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchBrandId" />
</div>
- <div class="form-group">
- <admin-label asp-for="SearchCollectionId" class="col-sm-3 control-label" />
- <div class="col-md-9 col-sm-9">
- <admin-input asp-for="SearchCollectionId" />
- </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchCollectionId" class="col-sm-3 control-label" />
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="SearchCollectionId" />
</div>
- <div class="form-group">
- <admin-label asp-for="SearchStoreId" class="col-sm-3 control-label" />
- <div class="col-md-9 col-sm-9">
- <admin-select asp-for="SearchStoreId" asp-items="Model.AvailableStores" />
- </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchStoreId" class="col-sm-3 control-label" />
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchStoreId" asp-items="Model.AvailableStores" />
</div>
- <div class="form-group">
- <admin-label asp-for="SearchVendorId" class="col-sm-3 control-label" />
- <div class="col-md-9 col-sm-9">
- <admin-select asp-for="SearchVendorId" asp-items="Model.AvailableVendors" />
- </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchVendorId" class="col-sm-3 control-label" />
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchVendorId" asp-items="Model.AvailableVendors" />
</div>
- <div class="form-group">
- <admin-label asp-for="SearchProductTypeId" class="col-sm-3 control-label" />
- <div class="col-md-9 col-sm-9">
- <admin-select asp-for="SearchProductTypeId" asp-items="Model.AvailableProductTypes" />
- </div>
+ </div>
+ <div class="form-group">
+ <admin-label asp-for="SearchProductTypeId" class="col-sm-3 control-label" />
+ <div class="col-md-9 col-sm-9">
+ <admin-select asp-for="SearchProductTypeId" asp-items="Model.AvailableProductTypes" />
</div>
</div>
</div>
- <div id="products-grid"></div>
</div>
+ <div id="products-grid"></div>
</div>
</div>
</div>
</div>
</div>
-
<script>
- $(document).ready(function () {
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchStoreId: $('#SearchStoreId').val(),
+ SearchVendorId: $('#SearchVendorId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ function selectRequiredProduct(productid) {
+ try {
+ var currentValue = document.getElementById('@(Context.Request.Query["productIdsInput"])').value;
+ if (currentValue) {
+ //add comma
+ document.getElementById('@(Context.Request.Query["productIdsInput"])').value += ', ';
+ }
+ document.getElementById('@(Context.Request.Query["productIdsInput"])').value += productid;
+ document.getElementById('@(Context.Request.Query["btnId"])').click();
+ }
+ catch (e){}
+ $.magnificPopup.instance.close();
+ }
+
$("#products-grid").kendoGrid({
dataSource: {
transport: {
@@ -143,19 +167,13 @@
template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
}]
});
- });
- </script>
-
- <script>
- $(document).ready(function () {
$('#search-products').click(function () {
var grid = $('#products-grid').data('kendoGrid');
grid.dataSource.page(1); //new search. Set page size to 1
//grid.dataSource.read(); we already loaded the grid above using "page" function
return false;
});
- });
$("#@Html.IdFor(model => model.SearchProductName)").keydown(function (event) {
if (event.keyCode == 13) {
@@ -164,31 +182,6 @@
}
});
- function additionalData() {
- var data = {
- SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
- SearchCategoryId: $('#SearchCategoryId').val(),
- SearchBrandId: $('#SearchBrandId').val(),
- SearchCollectionId: $('#SearchCollectionId').val(),
- SearchStoreId: $('#SearchStoreId').val(),
- SearchVendorId: $('#SearchVendorId').val(),
- SearchProductTypeId: $('#SearchProductTypeId').val()
- };
- addAntiForgeryToken(data);
- return data;
- }
-
- function selectRequiredProduct(productid) {
- try {
- var currentValue = window.opener.document.getElementById('@(Context.Request.Query["productIdsInput"])').value;
- if (currentValue) {
- //add comma
- window.opener.document.getElementById('@(Context.Request.Query["productIdsInput"])').value += ', ';
- }
- window.opener.document.getElementById('@(Context.Request.Query["productIdsInput"])').value += productid;
- window.opener.document.getElementById('@(Context.Request.Query["btnId"])').click();
- }
- catch (e){}
- window.close();
- }
</script>
+</div>
+
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/SimilarProductAddPopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/SimilarProductAddPopup.cshtml
index 2ef34c68b..46f09ee1d 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/SimilarProductAddPopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/SimilarProductAddPopup.cshtml
@@ -1,16 +1,14 @@
@model ProductModel.AddSimilarProductModel
@inject AdminAreaSettings adminAreaSettings
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
//page title
ViewBag.Title = Loc["Admin.Catalog.Products.SimilarProducts.AddNew"];
}
-<form asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="SimilarProductAddPopup"
+<form id="SimilarProductAddPopup" asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="SimilarProductAddPopup"
asp-route-productId="@Context.Request.Query["productId"]"
asp-route-btnId="@Context.Request.Query["btnId"]"
asp-route-formId="@Context.Request.Query["formId"]">
-
-
<div class="row">
<div class="col-md-12">
<div class="x_panel light form-fit popup-window">
@@ -102,7 +100,56 @@
</script>
}
<script>
- $(document).ready(function () {
+ var mfp = $.magnificPopup.instance;
+ $("#SimilarProductAddPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshSimilarProducts').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+
+ function additionalData() {
+ var data = {
+ SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
+ SearchCategoryId: $('#SearchCategoryId').val(),
+ SearchBrandId: $('#SearchBrandId').val(),
+ SearchCollectionId: $('#SearchCollectionId').val(),
+ SearchStoreId: $('#SearchStoreId').val(),
+ SearchVendorId: $('#SearchVendorId').val(),
+ SearchProductTypeId: $('#SearchProductTypeId').val()
+ };
+ addAntiForgeryToken(data);
+ return data;
+ }
+
+ function updateMasterCheckbox() {
+ var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
+ var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
+ $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
+ }
+
$("#products-grid").kendoGrid({
dataSource: {
transport: {
@@ -156,12 +203,7 @@
template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
}]
});
- });
- </script>
-
- <script>
- $(document).ready(function () {
$('#search-products').click(function () {
var grid = $('#products-grid').data('kendoGrid');
grid.dataSource.page(1); //new search. Set page size to 1
@@ -186,26 +228,5 @@
$('#products-grid').on('change', 'input[type=checkbox][id!=mastercheckbox]', function(e) {
updateMasterCheckbox();
});
- });
-
- function additionalData() {
- var data = {
- SearchProductName: $('#@Html.IdFor(model => model.SearchProductName)').val(),
- SearchCategoryId: $('#SearchCategoryId').val(),
- SearchBrandId: $('#SearchBrandId').val(),
- SearchCollectionId: $('#SearchCollectionId').val(),
- SearchStoreId: $('#SearchStoreId').val(),
- SearchVendorId: $('#SearchVendorId').val(),
- SearchProductTypeId: $('#SearchProductTypeId').val()
- };
- addAntiForgeryToken(data);
- return data;
- }
-
- function updateMasterCheckbox() {
- var numChkBoxes = $('#products-grid input[type=checkbox][id!=mastercheckbox]').length;
- var numChkBoxesChecked = $('#products-grid input[type=checkbox][id!=mastercheckbox]:checked').length;
- $('#mastercheckbox').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
- }
</script>
</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/TierPriceCreatePopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/TierPriceCreatePopup.cshtml
index 58f992000..a7d3028fb 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/TierPriceCreatePopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/TierPriceCreatePopup.cshtml
@@ -1,17 +1,17 @@
@model ProductModel.TierPriceModel
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
//page title
ViewBag.Title = Loc["Admin.Catalog.Products.TierPrices.AddNew"];
}
-<form asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="TierPriceCreatePopup"
+<form id="TierPriceCreatePopup" asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="TierPriceCreatePopup"
asp-route-ProductId="@Context.Request.Query["ProductId"]"
asp-route-btnId="@Context.Request.Query["btnId"]"
asp-route-formId="@Context.Request.Query["formId"]">
-
+
<div class="row">
<div class="col-md-12">
<div class="x_panel light form-fit">
@@ -26,9 +26,40 @@
</div>
</div>
<div class="x_content form">
- <partial name="_CreateOrUpdateTierPrice" model="Model" />
+ <partial name="_CreateOrUpdateTierPrice" model="Model" />
</div>
</div>
</div>
</div>
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#TierPriceCreatePopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ $('#btnRefreshTierPrices').click();
+ }
+ });
+ });
+ </script>
</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/TierPriceEditPopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/TierPriceEditPopup.cshtml
index 06068c1d0..2f8918dfd 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/TierPriceEditPopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/TierPriceEditPopup.cshtml
@@ -1,17 +1,17 @@
@model ProductModel.TierPriceModel
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
//page title
ViewBag.Title = Loc["Admin.Catalog.Products.TierPrices.Edit"];
}
-<form asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="TierPriceEditPopup"
+<form id="TierPriceEditPopup" asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="TierPriceEditPopup"
asp-route-ProductId="@Context.Request.Query["ProductId"]"
asp-route-btnId="@Context.Request.Query["btnId"]"
asp-route-formId="@Context.Request.Query["formId"]">
-
+
<div class="row">
<div class="col-md-12">
<div class="x_panel light form-fit">
@@ -26,9 +26,40 @@
</div>
</div>
<div class="x_content form">
- <partial name="_CreateOrUpdateTierPrice" model="Model" />
+ <partial name="_CreateOrUpdateTierPrice" model="Model" />
</div>
</div>
</div>
</div>
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#TierPriceEditPopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ $('#btnRefreshTierPrices').click();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+ </script>
</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.Additional.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.Additional.cshtml
index 0216cf5cb..0c15f74b2 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.Additional.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.Additional.cshtml
@@ -203,12 +203,26 @@
<admin-input asp-for="RequiredProductIds" />
<span asp-validation-for="RequiredProductIds"></span>
<span id="required-products-check-progress" style="display: none;" class="please-wait">@Loc["Common.Wait..."]</span>
- <input type="submit" id="btnAddNewRequiredProduct" value="@Loc["Admin.Catalog.Products.Fields.RequiredProductIds.AddNew"]"
- onclick="javascript:OpenWindow('@(Url.Action("RequiredProductAddPopup", "Product",
- new { btnId = "btnRefreshRequiredProducts", productIdsInput = "RequiredProductIds", area = Constants.AreaAdmin }))', 800, 800, true); return false;" class="k-button" />
+ <a id="btnAddNewRequiredProduct"
+ href="@(Url.Action("RequiredProductAddPopup", "Product", new { btnId = "btnRefreshRequiredProducts", productIdsInput = "RequiredProductIds", area = Constants.AreaAdmin }))"
+ class="k-button">
+ @Loc["Admin.Catalog.Products.Fields.RequiredProductIds.AddNew"]
+ </a>
<input type="submit" id="btnRefreshRequiredProducts" style="display: none" />
- <script>
+ <script>
$(document).ready(function () {
+ $('#btnAddNewRequiredProduct').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
$('#btnRefreshRequiredProducts').click(function () {
loadRequiredProductFriendlyNames();
return false;
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.AssociatedProducts.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.AssociatedProducts.cshtml
index 99d5689c3..dc6d89d87 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.AssociatedProducts.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.AssociatedProducts.cshtml
@@ -11,13 +11,27 @@
<div id="associatedproducts-grid"></div>
</div>
<div class="panel-footer">
- <input type="submit" id="btnAddNewAssociatedProduct" value="@Loc["Admin.Catalog.Products.AssociatedProducts.AddNew"]" onclick="javascript:OpenWindow('@(Url.Action("AssociatedProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshAssociatedProducts", formId = "product-form", area = Constants.AreaAdmin })) ', 1000, 1000, true); return false;" class="k-button" />
+ <a id="btnAddNewAssociatedProduct" href="@(Url.Action("AssociatedProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshAssociatedProducts", formId = "product-form", area = Constants.AreaAdmin }))" class="k-button">
+ @Loc["Admin.Catalog.Products.AssociatedProducts.AddNew"]
+ </a>
<input type="submit" id="btnRefreshAssociatedProducts" style="display: none" />
</div>
<vc:admin-widget widget-zone="product_details_associated_products_bottom" additional-data="Model" />
</div>
<script>
$(document).ready(function () {
+ $('#btnAddNewAssociatedProduct').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
$("#associatedproducts-grid").kendoGrid({
dataSource: {
transport: {
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.BundleProducts.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.BundleProducts.cshtml
index 446ca2598..38e877805 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.BundleProducts.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.BundleProducts.cshtml
@@ -9,7 +9,9 @@
<div id="bundleproducts-grid"></div>
</div>
<div class="panel-footer">
- <input type="submit" id="btnAddNewBundleProduct" value="@Loc["Admin.Catalog.Products.BundleProducts.AddNew"]" onclick="javascript:OpenWindow('@(Url.Action("BundleProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshBundleProducts", formId = "product-form", area = Constants.AreaAdmin })) ', 1000, 1000, true); return false;" class="k-button" />
+ <a id="btnAddNewBundleProduct" href="@(Url.Action("BundleProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshBundleProducts", formId = "product-form", area = Constants.AreaAdmin }))" class="k-button">
+ @Loc["Admin.Catalog.Products.BundleProducts.AddNew"]
+ </a>
<input type="submit" id="btnRefreshBundleProducts" style="display: none" />
</div>
<vc:admin-widget widget-zone="product_details_bundle_products_bottom" additional-data="Model" />
@@ -17,6 +19,18 @@
<script>
$(document).ready(function () {
+ $('#btnAddNewBundleProduct').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
$("#bundleproducts-grid").kendoGrid({
dataSource: {
transport: {
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.CrossSells.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.CrossSells.cshtml
index 82b4f5065..151170e3b 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.CrossSells.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.CrossSells.cshtml
@@ -12,7 +12,7 @@
<div id="crosssellproducts-grid"></div>
</div>
<div class="panel-footer">
- <button type="submit" id="btnAddNewCrossSellProduct" onclick="javascript:OpenWindow('@(Url.Action("CrossSellProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshCrossSellProducts", formId = "product-form", area = Constants.AreaAdmin })) ', 1000, 1000, true); return false;" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.CrossSells.AddNew"]</button>
+ <a id="btnAddNewCrossSellProduct" href="@(Url.Action("CrossSellProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshCrossSellProducts", formId = "product-form", area = Constants.AreaAdmin }))" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.CrossSells.AddNew"]</a>
<input type="submit" id="btnRefreshCrossSellProducts" style="display: none" />
</div>
<vc:admin-widget widget-zone="product_details_cross_sells_bottom" additional-data="Model" />
@@ -20,6 +20,18 @@
<script>
$(document).ready(function () {
+ $('#btnAddNewCrossSellProduct').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
$("#crosssellproducts-grid").kendoGrid({
dataSource: {
transport: {
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.Pictures.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.Pictures.cshtml
index afbb220fe..394a5f9a2 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.Pictures.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.Pictures.cshtml
@@ -12,6 +12,20 @@
<script>
$(document).ready(function () {
$("#productpictures-grid").kendoGrid({
+ dataBound: function () {
+ $('.editpicture').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ },
dataSource: {
transport: {
read: {
@@ -42,8 +56,8 @@
fields: {
PictureUrl: {editable: false, type: "string" },
DisplayOrder: {editable: true, type: "number" },
- OverrideAltAttribute: {editable: true, type: "string" },
- OverrideTitleAttribute: {editable: true, type: "string" }
+ AltAttribute: {editable: true, type: "string" },
+ TitleAttribute: {editable: true, type: "string" }
}
}
},
@@ -76,7 +90,7 @@
columns: [{
field: "PictureUrl",
title: "@Loc["Admin.Catalog.Products.Pictures.Fields.Picture"]",
- template: "<a class='k-link' href='javascript:OpenWindow(\"@Url.Action("ProductPicturePopup", "Product", new { area = Constants.AreaAdmin })/?productId=@(Model.Id)&Id=#=Id#&btnId=btnRefreshProductPictures&formId=product-form\", 800, 600, true);'><img alt='#=PictureId#' src='#=PictureUrl#' width='150' /></a>",
+ template: "<a class='k-link editpicture' href=\"@Url.Action("ProductPicturePopup", "Product", new { area = Constants.AreaAdmin })/?productId=@(Model.Id)&Id=#=Id#&btnId=btnRefreshProductPictures&formId=product-form\"><img alt='#=PictureId#' src='#=PictureUrl#' width='150' /></a>",
width: 165
}, {
field: "DisplayOrder",
@@ -87,11 +101,11 @@
attributes: { style: "text-align:center" },
format: "{0:0}",
}, {
- field: "OverrideAltAttribute",
+ field: "AltAttribute",
minScreenWidth: 500,
title: "@Loc["Admin.Catalog.Products.Pictures.Fields.OverrideAltAttribute"]",
}, {
- field: "OverrideTitleAttribute",
+ field: "TitleAttribute",
title: "@Loc["Admin.Catalog.Products.Pictures.Fields.OverrideTitleAttribute"]",
minScreenWidth: 500,
}, {
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.Prices.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.Prices.cshtml
index 94f779948..52a7d14d2 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.Prices.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.Prices.cshtml
@@ -191,14 +191,40 @@
<div id="tierprices-grid"></div>
</div>
<div class="panel-footer">
- <button type="submit" id="btnAddNewTierPrice" onclick="javascript:OpenWindow('@(Url.Action("TierPriceCreatePopup", "Product", new { productId = Model.Id, btnId = "btnRefreshTierPrices", formId = "product-form", area = Constants.AreaAdmin }))', 800, 600, true); return false;" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.TierPrices.AddNew"]</button>
+ <a id="btnAddNewTierPrice" href="@(Url.Action("TierPriceCreatePopup", "Product", new { productId = Model.Id, btnId = "btnRefreshTierPrices", formId = "product-form", area = Constants.AreaAdmin }))" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.TierPrices.AddNew"]</a>
<input type="submit" id="btnRefreshTierPrices" style="display: none" />
</div>
</div>
<script>
$(document).ready(function () {
+ $('#btnAddNewTierPrice').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
$("#tierprices-grid").kendoGrid({
+ dataBound: function () {
+ $('.tierpriceedit').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ },
dataSource: {
transport: {
read: {
@@ -289,7 +315,7 @@
}, {
field: "Id",
title: "@Loc["Admin.Common.Edit"]",
- template: "<button type=\"button\" onclick=\"javascript:OpenWindow('@Url.Action("TierPriceEditPopup", "Product", new { area = Constants.AreaAdmin })/#=Id#?productId=@(Model.Id)&btnId=btnRefreshTierPrices&formId=product-form', 800, 600, true); return false;\" class=\"k-button\"><span class=\"k-icon k-i-edit\"></span>&nbsp;@Loc["Admin.Common.Edit"]</button>"
+ template: "<a class='tierpriceedit' href=\"@Url.Action("TierPriceEditPopup", "Product", new { area = Constants.AreaAdmin })/#=Id#?productId=@(Model.Id)&btnId=btnRefreshTierPrices&formId=product-form\" class=\"k-button\"><span class=\"k-icon k-i-edit\"></span>&nbsp;@Loc["Admin.Common.Edit"]</a>"
}, {
command: { name: "destroy", text: "@Loc["Admin.Common.Delete"]" },
title: "@Loc["Admin.Common.Delete"]"
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.ProductAttributes.TabAttributeCombinations.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.ProductAttributes.TabAttributeCombinations.cshtml
index e1d977b4f..ef47a6286 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.ProductAttributes.TabAttributeCombinations.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.ProductAttributes.TabAttributeCombinations.cshtml
@@ -14,7 +14,7 @@
<div id="attributecombinations-grid"></div>
</div>
<div class="panel-footer">
- <button type="submit" id="btnAddNewCombination" onclick="javascript:OpenWindow('@(Url.Action("AttributeCombinationPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshCombinations", formId = "product-form", area = Constants.AreaAdmin }))', 800, 600, true); return false;" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.AddNew"]</button>
+ <a id="btnAddNewCombination" href="@(Url.Action("AttributeCombinationPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshCombinations", formId = "product-form", area = Constants.AreaAdmin }))" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.AddNew"]</a>
<button type="submit" id="btnGenerateAllCombinations" class="k-button"><span class="k-icon k-i-style-builder"></span>&nbsp;@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.GenerateAll"]</button>
<button type="submit" id="btnClearAllCombinations" class="k-button"><span class="k-icon k-i-cut"></span>&nbsp;@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.ClearAll"]</button>
<input type="submit" id="btnRefreshCombinations" style="display: none" />
@@ -23,8 +23,34 @@
</div>
<script>
- $(document).ready(function() {
+ $(document).ready(function () {
+ $('#btnAddNewCombination').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
$("#attributecombinations-grid").kendoGrid({
+ dataBound: function () {
+ $('.editcombinationlink').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ },
dataSource: {
transport: {
read: {
@@ -94,7 +120,7 @@
title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.Attributes"]",
width: 340,
encoded: false,
- template: "<a class='k-link' href='javascript:OpenWindow(\"@Url.Action("AttributeCombinationPopup", "Product", new { area = Constants.AreaAdmin })/?productId=@(Model.Id)&Id=#=Id#&btnId=btnRefreshCombinations&formId=product-form\", 800, 600, true);'>#=Attributes#<br /> # if(Warnings !== null) {# <span style=\"color: red\">#=Warnings#</span> #} #</a>"
+ template: "<a class='k-link editcombinationlink' href=\"@Url.Action("AttributeCombinationPopup", "Product", new { area = Constants.AreaAdmin })/?productId=@(Model.Id)&Id=#=Id#&btnId=btnRefreshCombinations&formId=product-form\">#=Attributes#<br /> # if(Warnings !== null) {# <span style=\"color: red\">#=Warnings#</span> #} #</a>"
}, {
field: "StockQuantity",
title: "@Loc["Admin.Catalog.Products.ProductAttributes.AttributeCombinations.Fields.StockQuantity"]",
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.ProductAttributes.TabAttributes.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.ProductAttributes.TabAttributes.cshtml
index b8a51972f..5965600f7 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.ProductAttributes.TabAttributes.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.ProductAttributes.TabAttributes.cshtml
@@ -1,4 +1,4 @@
-@model ProductModel
+@model ProductModel
<div class="panel panel-default">
<vc:admin-widget widget-zone="product_details_product_attributes_top" additional-data="Model" />
@@ -7,12 +7,24 @@
</div>
<vc:admin-widget widget-zone="product_details_product_attributes_bottom" additional-data="Model" />
<div class="panel-footer">
- <button type="submit" id="btnAddNewAttributes" onclick="javascript:OpenWindow('@(Url.Action("ProductAttributeMappingPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshProductAttributes", formId = "product-form", area = Constants.AreaAdmin }))', 800, 600, true); return false;" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.ProductAttributes.AddNew"]</button>
+ <a id="btnAddNewAttributes" href="@(Url.Action("ProductAttributeMappingPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshProductAttributes", formId = "product-form", area = Constants.AreaAdmin }))" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.ProductAttributes.AddNew"]</a>
</div>
</div>
<script>
- $(document).ready(function() {
+ $(document).ready(function () {
+ $('#btnAddNewAttributes').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
$("#productattributemappings-grid").kendoGrid({
dataSource: {
transport: {
@@ -88,6 +100,18 @@
$('tr[data-uid="' + row.uid + '"] ').find(".k-hierarchy-cell a").remove();;
}
});
+ $('.btnMagnificPopup').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
},
pageable: {
refresh: true,
@@ -105,7 +129,7 @@
field: "ProductAttributeId",
title: "@Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Fields.Attribute"]",
width: 190,
- template: "<a class='k-link' href='javascript:OpenWindow(\"@Url.Action("ProductAttributeMappingPopup", "Product", new { area = Constants.AreaAdmin })/?productId=@(Model.Id)&productAttributeMappingId=#=Id#&btnId=btnRefreshProductAttributes&formId=product-form\", 800, 600, true);'>#=kendo.htmlEncode(ProductAttribute)#<br /></a>"
+ template: "<a class='k-link btnMagnificPopup' href='@Url.Action("ProductAttributeMappingPopup", "Product", new { area = Constants.AreaAdmin })/?productId=@(Model.Id)&productAttributeMappingId=#=Id#&btnId=btnRefreshProductAttributes&formId=product-form'>#=kendo.htmlEncode(ProductAttribute)#<br /></a>"
}, {
field: "TextPrompt",
title: "@Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Fields.TextPrompt"]",
@@ -122,13 +146,13 @@
field: "AttributeControlTypeId",
title: "@Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Fields.AttributeControlType"]",
width: 140,
- template: "#:AttributeControlType# <br> # if(ValidationRulesAllowed) {# <a href='javascript:OpenWindow(\"@Url.Action("ProductAttributeValidationRulesPopup", "Product", new { area = Constants.AreaAdmin })/#=Id#?&productId=@(Model.Id)&btnId=btnRefreshProductAttributes&formId=product-form\", 800, 300, true);'>@Loc["Admin.Catalog.Products.ProductAttributes.Attributes.ValidationRules.ViewLink"]</a><br />#=ValidationRulesString# #} #"
+ template: "#:AttributeControlType# <br> # if(ValidationRulesAllowed) {# <a class='btnMagnificPopup' href='@Url.Action("ProductAttributeValidationRulesPopup", "Product", new { area = Constants.AreaAdmin })/#=Id#?&productId=@(Model.Id)&btnId=btnRefreshProductAttributes&formId=product-form'>@Loc["Admin.Catalog.Products.ProductAttributes.Attributes.ValidationRules.ViewLink"]</a><br />#=ValidationRulesString# #} #"
},
{
field: "ConditionAllowed",
title: "@Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Condition"]",
width: 80,
- template: "# if(ConditionAllowed) {# <a href='javascript:OpenWindow(\"@Url.Action("ProductAttributeConditionPopup", "Product", new { area = Constants.AreaAdmin })/?productId=@(Model.Id)&productAttributeMappingId=#=Id#&btnId=btnRefreshProductAttributes&formId=product-form\", 800, 400, true);'>@Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Condition.ViewLink"]</a><br /> #} #"
+ template: "# if(ConditionAllowed) {# <a class='btnMagnificPopup' href='@Url.Action("ProductAttributeConditionPopup", "Product", new { area = Constants.AreaAdmin })/?productId=@(Model.Id)&productAttributeMappingId=#=Id#&btnId=btnRefreshProductAttributes&formId=product-form\'>@Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Condition.ViewLink"]</a><br /> #} #"
},
{
command: [
@@ -142,7 +166,6 @@
]
});
});
-
//details grid
function toolbar_click_newProductAttributeValue(id) {
javascript: OpenWindow('@Url.Action("ProductAttributeValueCreatePopup", "Product", new { area = Constants.AreaAdmin })/' + '?productAttributeMappingId=' + id + '&[email protected]&formId=product-form&btnId=btnRefreshProductAttributesValues', 800, 550, true);
@@ -186,9 +209,37 @@
serverFiltering: true,
serverSorting: true
},
+ dataBound: function () {
+ $('.btnProductAttributeValueEditPopup').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ $('.mfp-wrap').attr("data-id", $('.btnProductAttributeValueEditPopup.active').data("id"));
+ if (document.querySelector('.mfp-wrap').dataset.prodid !== undefined) {
+ var id = document.querySelector('.mfp-wrap').dataset.prodid;
+ var name = document.querySelector('.mfp-wrap').dataset.prodname;
+ $('#AttributeValueTypeId').val('10').change();
+ $('#AssociatedProductId').val(id);
+ $('#associate-product-name').html(name);
+ }
+ },
+ close: function () {
+ $('.mfp-wrap').removeAttr('data-prodid');
+ $('.mfp-wrap').removeAttr('data-prodname');
+ $('.btnProductAttributeValueEditPopup.active').removeClass('active');
+ $('#AttributeValueTypeId').val('0').change();
+ }
+ }
+ });
+ },
toolbar: [
{
- template: "<a class='k-button' href='\\#' onclick=\"return toolbar_click_newProductAttributeValue('"+e.data.Id+"')\">@Loc["Admin.Common.AddNew"]</a>"
+ template: "<a class='k-button btnProductAttributeValueEditPopup' data-id='" + e.data.Id + "' onclick=\"this.classList.add('active')\" href='@Url.Action("ProductAttributeValueCreatePopup", "Product", new { area = Constants.AreaAdmin })/?productAttributeMappingId=" + e.data.Id + "&[email protected]&formId=product-form&btnId=btnRefreshProductAttributesValues'>@Loc["Admin.Common.AddNew"]</a>"
}
],
scrollable: false,
@@ -207,7 +258,7 @@
{
field: "Name",
title: "@Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.Name"]",
- template: "<a class='k-link' href='\\#' onclick=\"toolbar_click_editProductAttributeValue('#=Id#', '" + e.data.Id + "')\">#=Name#</a>"
+ template: "<a class='k-link btnProductAttributeValueEditPopup' data-id='#=Id#' onclick=\"this.classList.add('active')\" href='@Url.Action("ProductAttributeValueEditPopup", "Product", new { area = Constants.AreaAdmin })/#=Id#?productId=@(Model.Id)&productAttributeMappingId=" + e.data.Id + "&btnId=btnRefreshProductAttributesValues&formId=product-form'>#=Name#</a>"
}, {
command: { name: "destroy", text: "@Loc["Admin.Common.Delete"]" },
title: "@Loc["Admin.Common.Delete"]"
@@ -215,7 +266,6 @@
]
});
}
-
</script>
<input type="submit" id="btnRefreshProductAttributes" style="display: none" />
<input type="button" id="btnRefreshProductAttributesValues" style="display: none" />
@@ -225,7 +275,6 @@
//refresh grid
var grid = $("#productattributemappings-grid").data('kendoGrid');
grid.dataSource.read();
-
//return false to don't reload a page
return false;
});
@@ -234,10 +283,9 @@
var dataid = $(this).attr("data-id");
var grid = $('[data-id="' + dataid + '"]').data('kendoGrid');
grid.dataSource.read();
-
//return false to don't reload a page
return false;
});
+ $('#btnRefreshProductAttributes').click();
});
-
</script>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.Recommended.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.Recommended.cshtml
index 40b70e135..2b933fadc 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.Recommended.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.Recommended.cshtml
@@ -12,7 +12,7 @@
<div id="recommendedproducts-grid"></div>
</div>
<div class="panel-footer">
- <button type="submit" id="btnAddNewRecommendedProduct" onclick="javascript:OpenWindow('@(Url.Action("RecommendedProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshRecommendedProducts", formId = "product-form", area = Constants.AreaAdmin })) ', 1000, 1000, true); return false;" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.Recommended.AddNew"]</button>
+ <a id="btnAddNewRecommendedProduct" href="@(Url.Action("RecommendedProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshRecommendedProducts", formId = "product-form", area = Constants.AreaAdmin }))" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.Recommended.AddNew"]</a>
<input type="submit" id="btnRefreshRecommendedProducts" style="display: none" />
</div>
<vc:admin-widget widget-zone="product_details_recommended_bottom" additional-data="Model" />
@@ -20,6 +20,18 @@
<script>
$(document).ready(function () {
+ $('#btnAddNewRecommendedProduct').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
$("#recommendedproducts-grid").kendoGrid({
dataSource: {
transport: {
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.RelatedProducts.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.RelatedProducts.cshtml
index 478505e3e..d867a1691 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.RelatedProducts.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.RelatedProducts.cshtml
@@ -11,13 +11,25 @@
<div id="relatedproducts-grid"></div>
</div>
<div class="panel-footer">
- <button type="submit" id="btnAddNewRelatedProduct" onclick="javascript:OpenWindow('@(Url.Action("RelatedProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshRelatedProducts", formId = "product-form", area = Constants.AreaAdmin })) ', 1000, 1000, true); return false;" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.RelatedProducts.AddNew"]</button>
+ <a id="btnAddNewRelatedProduct" href="@(Url.Action("RelatedProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshRelatedProducts", formId = "product-form", area = Constants.AreaAdmin }))" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.RelatedProducts.AddNew"]</a>
<input type="submit" id="btnRefreshRelatedProducts" style="display: none" />
</div>
</div>
<script>
$(document).ready(function () {
+ $('#btnAddNewRelatedProduct').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
$("#relatedproducts-grid").kendoGrid({
dataSource: {
transport: {
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.SimilarProducts.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.SimilarProducts.cshtml
index 64b29f919..7954f4730 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.SimilarProducts.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdate.SimilarProducts.cshtml
@@ -11,13 +11,25 @@
<div id="similarproducts-grid"></div>
</div>
<div class="panel-footer">
- <button type="submit" id="btnAddNewSimilarProduct" onclick="javascript:OpenWindow('@(Url.Action("SimilarProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshSimilarProducts", formId = "product-form", area = Constants.AreaAdmin })) ', 1000, 1000, true); return false;" class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.SimilarProducts.AddNew"]</button>
+ <a id="btnAddNewSimilarProduct" href="@(Url.Action("SimilarProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshSimilarProducts", formId = "product-form", area = Constants.AreaAdmin })) " class="k-button"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Catalog.Products.SimilarProducts.AddNew"]</a>
<input type="submit" id="btnRefreshSimilarProducts" style="display: none" />
</div>
</div>
<script>
$(document).ready(function () {
+ $('#btnAddNewSimilarProduct').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
$("#similarproducts-grid").kendoGrid({
dataSource: {
transport: {
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdateProductAttributeValue.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdateProductAttributeValue.cshtml
index ae7b3ce0b..d9d98a728 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdateProductAttributeValue.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/_CreateOrUpdateProductAttributeValue.cshtml
@@ -11,18 +11,7 @@
<input asp-for="DisplayColorSquaresRgb" type="hidden" />
<input asp-for="DisplayImageSquaresPicture" type="hidden" />
-@if (ViewBag.RefreshPage == true)
-{
-<script>
- try {
- window.opener.document.forms['@(Context.Request.Query["formId"])'].@(Context.Request.Query["btnId"]).setAttribute('data-id', '@Model.ProductAttributeMappingId');
- window.opener.document.forms['@(Context.Request.Query["formId"])'].@(Context.Request.Query["btnId"]).click();
-
- }
- catch (e){}
- window.close();
-</script>
-}
+
<script>
$(document).ready(function () {
@@ -31,6 +20,19 @@
toggleProductType();
});
+ $('#btnAssociateProductToAttributeValuePopup').magnificPopup({
+ type: 'ajax',
+ settings: { cache: false, async: false },
+ callbacks: {
+ parseAjax: function (mfpResponse) {
+ mfpResponse.data = $('<div></div>').html(mfpResponse.data);
+ },
+ ajaxContentAdded: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+
function toggleProductType() {
var selectedProductTypeId = $("#@Html.IdFor(model => model.AttributeValueTypeId)").val();
if (selectedProductTypeId == @(((int)AttributeValueType.Simple).ToString())) {
@@ -48,7 +50,7 @@
</script>
<!-- #region languages template -->
@{ Func<int, HelperResult>
- template = @<div class="form-body">
+ template = @<div class="form-body">
<div class="form-group">
<admin-label asp-for="@Model.Locales[item].Name" class="col-sm-3 control-label" />
<div class="col-md-9 col-sm-9">
@@ -76,7 +78,9 @@
<input asp-for="AssociatedProductId" type="hidden" />
<span id="associate-product-name">@Model.AssociatedProductName</span>
<span asp-validation-for="AssociatedProductId"></span>
- <input type="submit" value=@Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AssociatedProduct.AddNew"] onclick="javascript:OpenWindow('@(Url.Action("AssociateProductToAttributeValuePopup", "Product", new { productIdInput = Html.IdFor(model => model.AssociatedProductId), productNameInput = "associate-product-name", area = Constants.AreaAdmin }))', 800, 800, true); return false;" class="k-button" />
+ <a id="btnAssociateProductToAttributeValuePopup" href="@(Url.Action("AssociateProductToAttributeValuePopup", "Product", new { productIdInput = Html.IdFor(model => model.AssociatedProductId), productNameInput = "associate-product-name", area = Constants.AreaAdmin }))" class="k-button">
+ @Loc["Admin.Catalog.Products.ProductAttributes.Attributes.Values.Fields.AssociatedProduct.AddNew"]
+ </a>
</div>
</div>
<div class="form-group" id="group-quantity">
@@ -205,4 +209,3 @@
</div>
</div>
-
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/HeadAdmin.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/HeadAdmin.cshtml
index e720a16e9..dc929fdd2 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/HeadAdmin.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/HeadAdmin.cshtml
@@ -10,6 +10,7 @@
<link rel="stylesheet" type="text/css" href="/_content/Grand.Web.Admin/administration/build/css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="/_content/Grand.Web.Admin/administration/simple-line-icons/simple-line-icons.min.css" />
<link rel="stylesheet" type="text/css" href="/_content/Grand.Web.Admin/administration/bootstrap/css/bootstrap.min.css" />
+ <link rel="stylesheet" type="text/css" href="/_content/Grand.Web.Admin/administration/magnific-popup/magnific-popup.min.css" />
<link rel="stylesheet" type="text/css" href="/_content/Grand.Web.Admin/administration/summernote/summernote.min.css" />
<link rel="stylesheet" type="text/css" href="/_content/Grand.Web.Admin/administration/jquery-ui-themes/smoothness/jquery-ui-1.10.3.custom.min.css" />
<link rel="stylesheet" type="text/css" href="@string.Format("/_content/Grand.Web.Admin/administration/kendo/styles/{0}/kendo.material.mobile.min.css", kendoVersion)" />
@@ -48,5 +49,6 @@
<script asp-location="Footer" asp-src="/_content/Grand.Web.Admin/administration/build/js/smartresize.js"></script>
<script asp-location="Footer" asp-src="/_content/Grand.Web.Admin/administration/build/js/custom.js"></script>
<script asp-location="Footer" asp-src="/_content/Grand.Web.Admin/administration/summernote/summernote.min.js"></script>
+ <script asp-location="Footer" asp-src="/_content/Grand.Web.Admin/administration/magnific-popup/jquery.magnific-popup.min.js"></script>
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/PicturePopup.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/PicturePopup.cshtml
index 1e0b0d68f..1fed45c86 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/PicturePopup.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shared/PicturePopup.cshtml
@@ -2,11 +2,11 @@
@model PictureModel
@{
- Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup;
+ Layout = "";
//page title
ViewBag.Title = Loc["Admin.Catalog.Picture"];
}
-<form asp-area="@Constants.AreaAdmin" asp-action="PicturePopup" enctype="multipart/form-data" method="post">
+<form id="PicturePopup" asp-area="@Constants.AreaAdmin" asp-action="PicturePopup" enctype="multipart/form-data" method="post">
<!-- #region languages template -->
@{ Func<int, HelperResult> template = @<div class="form-body">
<div class="form-group">
@@ -80,4 +80,34 @@
window.close();
</script>
}
+ <script>
+ var mfp = $.magnificPopup.instance;
+ $("#PicturePopup").submit(function (e) {
+ e.preventDefault();
+ var form = $(this);
+ var url = form.attr('action');
+ $.ajax({
+ type: "POST",
+ url: url,
+ data: form.serialize(),
+ success: function (data) {
+ if (data == "") {
+ mfp.close();
+ } else {
+ $.magnificPopup.open({
+ items: {
+ src: data,
+ type: 'inline'
+ },
+ callbacks: {
+ open: function () {
+ $('.mfp-wrap').removeAttr('tabindex');
+ }
+ }
+ });
+ }
+ }
+ });
+ });
+ </script>
</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Controllers/BrandController.cs b/src/Web/Grand.Web.Admin/Controllers/BrandController.cs
index c507d1a8c..f443ec384 100644
--- a/src/Web/Grand.Web.Admin/Controllers/BrandController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/BrandController.cs
@@ -326,7 +326,7 @@ namespace Grand.Web.Admin.Controllers
await _pictureViewModelService.UpdatePicture(model);
ViewBag.RefreshPage = true;
- return View("PicturePopup", model);
+ return Content("");
}
Error(ModelState);
diff --git a/src/Web/Grand.Web.Admin/Controllers/CategoryController.cs b/src/Web/Grand.Web.Admin/Controllers/CategoryController.cs
index 6703029fb..84edd7c84 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CategoryController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CategoryController.cs
@@ -295,7 +295,7 @@ namespace Grand.Web.Admin.Controllers
await _pictureViewModelService.UpdatePicture(model);
ViewBag.RefreshPage = true;
- return View("PicturePopup", model);
+ return Content("");
}
Error(ModelState);
@@ -431,11 +431,15 @@ namespace Grand.Web.Admin.Controllers
await _categoryViewModelService.InsertCategoryProductModel(model);
}
ViewBag.RefreshPage = true;
+ return Content("");
}
else
+ {
Error(ModelState);
+ return View(model);
+ }
- return View(model);
+
}
#endregion
diff --git a/src/Web/Grand.Web.Admin/Controllers/CollectionController.cs b/src/Web/Grand.Web.Admin/Controllers/CollectionController.cs
index e14939a38..f1dc6581d 100644
--- a/src/Web/Grand.Web.Admin/Controllers/CollectionController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/CollectionController.cs
@@ -329,7 +329,7 @@ namespace Grand.Web.Admin.Controllers
await _pictureViewModelService.UpdatePicture(model);
ViewBag.RefreshPage = true;
- return View("PicturePopup", model);
+ return Content("");
}
Error(ModelState);
@@ -469,11 +469,14 @@ namespace Grand.Web.Admin.Controllers
await _collectionViewModelService.InsertCollectionProductModel(model);
}
ViewBag.RefreshPage = true;
+ return Content("");
}
else
+ {
Error(ModelState);
+ return View(model);
+ }
- return View(model);
}
#endregion
diff --git a/src/Web/Grand.Web.Admin/Controllers/ProductController.cs b/src/Web/Grand.Web.Admin/Controllers/ProductController.cs
index 0d0fe4bea..be5ce0b8e 100644
--- a/src/Web/Grand.Web.Admin/Controllers/ProductController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/ProductController.cs
@@ -649,15 +649,15 @@ namespace Grand.Web.Admin.Controllers
//a vendor should have access only to his products
model.IsLoggedInAsVendor = _workContext.CurrentVendor != null;
- ViewBag.RefreshPage = true;
+ return Content("");
}
else
{
Error(ModelState);
model = await _productViewModelService.PrepareRelatedProductModel();
model.ProductId = model.ProductId;
+ return View(model);
}
- return View(model);
}
#endregion
@@ -753,14 +753,15 @@ namespace Grand.Web.Admin.Controllers
//a vendor should have access only to his products
model.IsLoggedInAsVendor = _workContext.CurrentVendor != null;
ViewBag.RefreshPage = true;
+ return Content("");
}
else
{
Error(ModelState);
model = await _productViewModelService.PrepareSimilarProductModel();
model.ProductId = model.ProductId;
+ return View(model);
}
- return View(model);
}
#endregion
@@ -857,14 +858,15 @@ namespace Grand.Web.Admin.Controllers
//a vendor should have access only to his products
model.IsLoggedInAsVendor = _workContext.CurrentVendor != null;
ViewBag.RefreshPage = true;
+ return Content("");
}
else
{
Error(ModelState);
model = await _productViewModelService.PrepareBundleProductModel();
model.ProductId = model.ProductId;
+ return View(model);
}
- return View(model);
}
#endregion
@@ -954,14 +956,15 @@ namespace Grand.Web.Admin.Controllers
//a vendor should have access only to his products
model.IsLoggedInAsVendor = _workContext.CurrentVendor != null;
ViewBag.RefreshPage = true;
+ return Content("");
}
else
{
Error(ModelState);
model = await _productViewModelService.PrepareCrossSellProductModel();
model.ProductId = model.ProductId;
+ return View(model);
}
- return View(model);
}
#endregion
@@ -1050,14 +1053,15 @@ namespace Grand.Web.Admin.Controllers
//a vendor should have access only to his products
model.IsLoggedInAsVendor = _workContext.CurrentVendor != null;
ViewBag.RefreshPage = true;
+ return Content("");
}
else
{
Error(ModelState);
model = await _productViewModelService.PrepareRecommendedProductModel();
model.ProductId = model.ProductId;
+ return View(model);
}
- return View(model);
}
#endregion
@@ -1167,14 +1171,15 @@ namespace Grand.Web.Admin.Controllers
//a vendor should have access only to his products
model.IsLoggedInAsVendor = _workContext.CurrentVendor != null;
ViewBag.RefreshPage = true;
+ return Content("");
}
else
{
Error(ModelState);
model = await _productViewModelService.PrepareAssociatedProductModel();
model.ProductId = model.ProductId;
+ return View(model);
}
- return View(model);
}
#endregion
@@ -1362,7 +1367,7 @@ namespace Grand.Web.Admin.Controllers
await _productViewModelService.UpdateProductPicture(model);
ViewBag.RefreshPage = true;
- return View(model);
+ return Content("");
}
Error(ModelState);
@@ -1830,15 +1835,15 @@ namespace Grand.Web.Admin.Controllers
var tierPrice = model.ToEntity(_dateTimeService);
await _productService.InsertTierPrice(tierPrice, product.Id);
ViewBag.RefreshPage = true;
- return View(model);
+ return Content("");
}
else
{
Error(ModelState);
+ //If we got this far, something failed, redisplay form
+ await _productViewModelService.PrepareTierPriceModel(model);
+ return View(model);
}
- //If we got this far, something failed, redisplay form
- await _productViewModelService.PrepareTierPriceModel(model);
- return View(model);
}
[PermissionAuthorizeAction(PermissionActionName.Edit)]
@@ -1880,7 +1885,7 @@ namespace Grand.Web.Admin.Controllers
await _productService.UpdateTierPrice(tierPrice, product.Id);
ViewBag.RefreshPage = true;
- return View(model);
+ return Content("");
}
Error(ModelState);
//stores
@@ -1968,8 +1973,7 @@ namespace Grand.Web.Admin.Controllers
else
await _productViewModelService.UpdateProductAttributeMappingModel(model);
- ViewBag.RefreshPage = true;
- return View(model);
+ return Content("");
}
Error(ModelState);
model = await _productViewModelService.PrepareProductAttributeMappingModel(model);
@@ -2035,7 +2039,7 @@ namespace Grand.Web.Admin.Controllers
{
await _productViewModelService.UpdateProductAttributeValidationRulesModel(productAttributeMapping, model);
ViewBag.RefreshPage = true;
- return View(model);
+ return Content("");
}
Error(ModelState);
model = await _productViewModelService.PrepareProductAttributeMappingModel(productAttributeMapping);
@@ -2090,8 +2094,7 @@ namespace Grand.Web.Admin.Controllers
formcollection.Add(item.Key, item.Value);
}
await _productViewModelService.UpdateProductAttributeConditionModel(product, productAttributeMapping, model, formcollection);
- ViewBag.RefreshPage = true;
- return View(model);
+ return Content("");
}
#endregion
@@ -2203,7 +2206,7 @@ namespace Grand.Web.Admin.Controllers
{
await _productViewModelService.InsertProductAttributeValueModel(model);
ViewBag.RefreshPage = true;
- return View(model);
+ return Content("");
}
//If we got this far, something failed, redisplay form
await _productViewModelService.PrepareProductAttributeValueModel(product, model);
@@ -2271,7 +2274,7 @@ namespace Grand.Web.Admin.Controllers
{
await _productViewModelService.UpdateProductAttributeValueModel(pav, model);
ViewBag.RefreshPage = true;
- return View(model);
+ return Content("");
}
//If we got this far, something failed, redisplay form
await _productViewModelService.PrepareProductAttributeValueModel(product, model);
@@ -2342,7 +2345,7 @@ namespace Grand.Web.Admin.Controllers
ViewBag.RefreshPage = true;
ViewBag.productId = associatedProduct.Id;
ViewBag.productName = associatedProduct.Name;
- return View(model);
+ return Content("");
}
#endregion
@@ -2441,7 +2444,7 @@ namespace Grand.Web.Admin.Controllers
if (!warnings.Any())
{
ViewBag.RefreshPage = true;
- return View(model);
+ return Content("");
}
//If we got this far, something failed, redisplay form
await _productViewModelService.PrepareAddProductAttributeCombinationModel(model, product);
diff --git a/src/Web/Grand.Web.Admin/wwwroot/administration/build/css/custom-rtl.css b/src/Web/Grand.Web.Admin/wwwroot/administration/build/css/custom-rtl.css
index 5c77d7ca8..8d3459b71 100644
--- a/src/Web/Grand.Web.Admin/wwwroot/administration/build/css/custom-rtl.css
+++ b/src/Web/Grand.Web.Admin/wwwroot/administration/build/css/custom-rtl.css
@@ -4770,6 +4770,33 @@ div[data-role="editor-toolbar"] {
border: 1px solid #ccc;
}
+/* magnific popup */
+
+.mfp-bg {
+ z-index: 10000 !important;
+}
+.mfp-wrap {
+ z-index: 10001 !important;
+}
+.mfp-container {
+ padding: 8px;
+}
+.mfp-content {
+ max-width: 800px;
+ padding: 15px;
+ background-color: #fff;
+}
+.nav-sm .mfp-content .container.body .right_col {
+ margin: 0;
+ border: 0;
+}
+.mfp-content .x_title .caption, .mfp-content .x_panel {
+ padding: 0;
+}
+.mfp-content .x_title .actions {
+ padding: 25px 0 10px 0;
+}
+
/* store news */
.store-news {
@@ -5215,6 +5242,9 @@ fieldset {
.k-tabstrip-items-wrapper, .k-autocomplete, .k-draghandle, .k-dropdown-wrap, .k-header, .k-window-titlebar, k-hstack, .k-numeric-wrap, .k-panelbar .k-tabstrip-items .k-item, .k-picker-wrap, .k-progressbar, .k-state-highlight, .k-tabstrip-items .k-item, .k-textbox {
background-color: #f5f5f5;
}
+.k-formatted-value.k-input[type="text"] {
+ min-width: 32px;
+}
.k-panelbar .k-tabstrip-items .k-state-active, .k-tabstrip-items .k-state-active {
background-color: #e6e6e6 !important;
border-bottom: 2px solid #1ABB9C;
@@ -6892,7 +6922,7 @@ h2 {
}
[data-theme="dark"] body .container.body .right_col,
[data-theme="dark"] .x_panel,
-[data-theme="dark"] .top_nav .nav > li > a:focus, [data-theme="dark"] .top_nav .nav > li > a:hover, [data-theme="dark"] .top_nav .nav .open > a, [data-theme="dark"] .top_nav .nav .open > a:focus, [data-theme="dark"] .top_nav .nav .open > a:hover {
+[data-theme="dark"] .top_nav .nav > li > a:focus, [data-theme="dark"] .mfp-content, [data-theme="dark"] .top_nav .nav > li > a:hover, [data-theme="dark"] .top_nav .nav .open > a, [data-theme="dark"] .top_nav .nav .open > a:focus, [data-theme="dark"] .top_nav .nav .open > a:hover {
background: #2F3C48;
}
[data-theme="dark"] .whiteBg,
diff --git a/src/Web/Grand.Web.Admin/wwwroot/administration/build/css/custom.css b/src/Web/Grand.Web.Admin/wwwroot/administration/build/css/custom.css
index 39835855e..48fb6d694 100644
--- a/src/Web/Grand.Web.Admin/wwwroot/administration/build/css/custom.css
+++ b/src/Web/Grand.Web.Admin/wwwroot/administration/build/css/custom.css
@@ -5643,6 +5643,33 @@ a span.username {
padding: 0px 10px 0px 0px;
}
+/* magnific popup */
+
+.mfp-bg {
+ z-index: 10000 !important;
+}
+.mfp-wrap {
+ z-index: 10001 !important;
+}
+.mfp-container {
+ padding: 8px;
+}
+.mfp-content {
+ max-width: 800px;
+ padding: 15px;
+ background-color: #fff;
+}
+.nav-sm .mfp-content .container.body .right_col {
+ margin: 0;
+ border: 0;
+}
+.mfp-content .x_title .caption, .mfp-content .x_panel {
+ padding: 0;
+}
+.mfp-content .x_title .actions {
+ padding: 25px 0 10px 0;
+}
+
.form-control,
/* if this class is applied to a Kendo UI widget, its layout may change */
@@ -6741,10 +6768,6 @@ form>h4 {
.k-tabstrip-items-wrapper, .k-autocomplete, .k-tabstrip-items-wrapper, .k-hstack, .k-draghandle, .k-dropdown-wrap, .k-hstack, .k-header, .k-numeric-wrap, .k-panelbar .k-tabstrip-items .k-item, .k-picker-wrap, .k-progressbar, .k-state-highlight, .k-tabstrip-items .k-item, .k-textbox {
background-color: #f5f5f5;
}
-.k-tabstrip-items .k-item .k-link {
- color: #34495E;
- font-weight: 500;
-}
.k-link, .k-nav-current.k-state-hover {
color: #1ABB9C;
@@ -6988,7 +7011,7 @@ table.tableFixHead {
}
[data-theme="dark"] body .container.body .right_col,
[data-theme="dark"] .x_panel,
-[data-theme="dark"] .top_nav .nav > li > a:focus, [data-theme="dark"] .top_nav .nav > li > a:hover, [data-theme="dark"] .top_nav .nav .open > a, [data-theme="dark"] .top_nav .nav .open > a:focus, [data-theme="dark"] .top_nav .nav .open > a:hover {
+[data-theme="dark"] .top_nav .nav > li > a:focus, [data-theme="dark"] .mfp-content, [data-theme="dark"] .top_nav .nav > li > a:hover, [data-theme="dark"] .top_nav .nav .open > a, [data-theme="dark"] .top_nav .nav .open > a:focus, [data-theme="dark"] .top_nav .nav .open > a:hover {
background: #2F3C48;
}
[data-theme="dark"] .whiteBg,
diff --git a/src/Web/Grand.Web.Admin/wwwroot/administration/magnific-popup/jquery.magnific-popup.min.js b/src/Web/Grand.Web.Admin/wwwroot/administration/magnific-popup/jquery.magnific-popup.min.js
new file mode 100644
index 000000000..de71f356b
--- /dev/null
+++ b/src/Web/Grand.Web.Admin/wwwroot/administration/magnific-popup/jquery.magnific-popup.min.js
@@ -0,0 +1,4 @@
+/*! Magnific Popup - v1.1.0 - 2016-02-20
+* http://dimsemenov.com/plugins/magnific-popup/
+* Copyright (c) 2016 Dmitry Semenov; */
+!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new t,b.init(),a.magnificPopup.instance=b)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appVersion;b.isLowIE=b.isIE8=document.all&&!document.addEventListener,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var g,h=c.items;for(e=0;e<h.length;e++)if(g=h[e],g.parsed&&(g=g.el[0]),g===c.el[0]){b.index=e;break}}else b.items=a.isArray(c.items)?c.items:[c.items],b.index=c.index||0;if(b.isOpen)return void b.updateItemHTML();b.types=[],f="",c.mainEl&&c.mainEl.length?b.ev=c.mainEl.eq(0):b.ev=d,c.key?(b.popupsCache[c.key]||(b.popupsCache[c.key]={}),b.currTemplate=b.popupsCache[c.key]):b.currTemplate={},b.st=a.extend(!0,{},a.magnificPopup.defaults,c),b.fixedContentPos="auto"===b.st.fixedContentPos?!b.probablyMobile:b.st.fixedContentPos,b.st.modal&&(b.st.closeOnContentClick=!1,b.st.closeOnBgClick=!1,b.st.showCloseBtn=!1,b.st.enableEscapeKey=!1),b.bgOverlay||(b.bgOverlay=x("bg").on("click"+p,function(){b.close()}),b.wrap=x("wrap").attr("tabindex",-1).on("click"+p,function(a){b._checkIfClose(a.target)&&b.close()}),b.container=x("container",b.wrap)),b.contentContainer=x("content"),b.st.preloader&&(b.preloader=x("preloader",b.container,b.st.tLoading));var i=a.magnificPopup.modules;for(e=0;e<i.length;e++){var j=i[e];j=j.charAt(0).toUpperCase()+j.slice(1),b["init"+j].call(b)}y("BeforeOpen"),b.st.showCloseBtn&&(b.st.closeBtnInside?(w(l,function(a,b,c,d){c.close_replaceWith=z(d.type)}),f+=" mfp-close-btn-in"):b.wrap.append(z())),b.st.alignTop&&(f+=" mfp-align-top"),b.fixedContentPos?b.wrap.css({overflow:b.st.overflowY,overflowX:"hidden",overflowY:b.st.overflowY}):b.wrap.css({top:v.scrollTop(),position:"absolute"}),(b.st.fixedBgPos===!1||"auto"===b.st.fixedBgPos&&!b.fixedContentPos)&&b.bgOverlay.css({height:d.height(),position:"absolute"}),b.st.enableEscapeKey&&d.on("keyup"+p,function(a){27===a.keyCode&&b.close()}),v.on("resize"+p,function(){b.updateSize()}),b.st.closeOnContentClick||(f+=" mfp-auto-cursor"),f&&b.wrap.addClass(f);var k=b.wH=v.height(),n={};if(b.fixedContentPos&&b._hasScrollBar(k)){var o=b._getScrollbarSize();o&&(n.marginRight=o)}b.fixedContentPos&&(b.isIE7?a("body, html").css("overflow","hidden"):n.overflow="hidden");var r=b.st.mainClass;return b.isIE7&&(r+=" mfp-ie7"),r&&b._addClassToMFP(r),b.updateItemHTML(),y("BuildControls"),a("html").css(n),b.bgOverlay.add(b.wrap).prependTo(b.st.prependTo||a(document.body)),b._lastFocusedEl=document.activeElement,setTimeout(function(){b.content?(b._addClassToMFP(q),b._setFocus()):b.bgOverlay.addClass(q),d.on("focusin"+p,b._onFocusIn)},16),b.isOpen=!0,b.updateSize(k),y(m),c},close:function(){b.isOpen&&(y(i),b.isOpen=!1,b.st.removalDelay&&!b.isLowIE&&b.supportsTransition?(b._addClassToMFP(r),setTimeout(function(){b._close()},b.st.removalDelay)):b._close())},_close:function(){y(h);var c=r+" "+q+" ";if(b.bgOverlay.detach(),b.wrap.detach(),b.container.empty(),b.st.mainClass&&(c+=b.st.mainClass+" "),b._removeClassFromMFP(c),b.fixedContentPos){var e={marginRight:""};b.isIE7?a("body, html").css("overflow",""):e.overflow="",a("html").css(e)}d.off("keyup"+p+" focusin"+p),b.ev.off(p),b.wrap.attr("class","mfp-wrap").removeAttr("style"),b.bgOverlay.attr("class","mfp-bg"),b.container.attr("class","mfp-container"),!b.st.showCloseBtn||b.st.closeBtnInside&&b.currTemplate[b.currItem.type]!==!0||b.currTemplate.closeBtn&&b.currTemplate.closeBtn.detach(),b.st.autoFocusLast&&b._lastFocusedEl&&a(b._lastFocusedEl).focus(),b.currItem=null,b.content=null,b.currTemplate=null,b.prevHeight=0,y(j)},updateSize:function(a){if(b.isIOS){var c=document.documentElement.clientWidth/window.innerWidth,d=window.innerHeight*c;b.wrap.css("height",d),b.wH=d}else b.wH=a||v.height();b.fixedContentPos||b.wrap.css("height",b.wH),y("Resize")},updateItemHTML:function(){var c=b.items[b.index];b.contentContainer.detach(),b.content&&b.content.detach(),c.parsed||(c=b.parseEl(b.index));var d=c.type;if(y("BeforeChange",[b.currItem?b.currItem.type:"",d]),b.currItem=c,!b.currTemplate[d]){var f=b.st[d]?b.st[d].markup:!1;y("FirstMarkupParse",f),f?b.currTemplate[d]=a(f):b.currTemplate[d]=!0}e&&e!==c.type&&b.container.removeClass("mfp-"+e+"-holder");var g=b["get"+d.charAt(0).toUpperCase()+d.slice(1)](c,b.currTemplate[d]);b.appendContent(g,d),c.preloaded=!0,y(n,c),e=c.type,b.container.prepend(b.contentContainer),y("AfterChange")},appendContent:function(a,c){b.content=a,a?b.st.showCloseBtn&&b.st.closeBtnInside&&b.currTemplate[c]===!0?b.content.find(".mfp-close").length||b.content.append(z()):b.content=a:b.content="",y(k),b.container.addClass("mfp-"+c+"-holder"),b.contentContainer.append(b.content)},parseEl:function(c){var d,e=b.items[c];if(e.tagName?e={el:a(e)}:(d=e.type,e={data:e,src:e.src}),e.el){for(var f=b.types,g=0;g<f.length;g++)if(e.el.hasClass("mfp-"+f[g])){d=f[g];break}e.src=e.el.attr("data-mfp-src"),e.src||(e.src=e.el.attr("href"))}return e.type=d||b.st.type||"inline",e.index=c,e.parsed=!0,b.items[c]=e,y("ElementParse",e),b.items[c]},addGroup:function(a,c){var d=function(d){d.mfpEl=this,b._openClick(d,a,c)};c||(c={});var e="click.magnificPopup";c.mainEl=a,c.items?(c.isObj=!0,a.off(e).on(e,d)):(c.isObj=!1,c.delegate?a.off(e).on(e,c.delegate,d):(c.items=a,a.off(e).on(e,d)))},_openClick:function(c,d,e){var f=void 0!==e.midClick?e.midClick:a.magnificPopup.defaults.midClick;if(f||!(2===c.which||c.ctrlKey||c.metaKey||c.altKey||c.shiftKey)){var g=void 0!==e.disableOn?e.disableOn:a.magnificPopup.defaults.disableOn;if(g)if(a.isFunction(g)){if(!g.call(b))return!0}else if(v.width()<g)return!0;c.type&&(c.preventDefault(),b.isOpen&&c.stopPropagation()),e.el=a(c.mfpEl),e.delegate&&(e.items=d.find(e.delegate)),b.open(e)}},updateStatus:function(a,d){if(b.preloader){c!==a&&b.container.removeClass("mfp-s-"+c),d||"loading"!==a||(d=b.st.tLoading);var e={status:a,text:d};y("UpdateStatus",e),a=e.status,d=e.text,b.preloader.html(d),b.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),b.container.addClass("mfp-s-"+a),c=a}},_checkIfClose:function(c){if(!a(c).hasClass(s)){var d=b.st.closeOnContentClick,e=b.st.closeOnBgClick;if(d&&e)return!0;if(!b.content||a(c).hasClass("mfp-close")||b.preloader&&c===b.preloader[0])return!0;if(c===b.content[0]||a.contains(b.content[0],c)){if(d)return!0}else if(e&&a.contains(document,c))return!0;return!1}},_addClassToMFP:function(a){b.bgOverlay.addClass(a),b.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),b.wrap.removeClass(a)},_hasScrollBar:function(a){return(b.isIE7?d.height():document.body.scrollHeight)>(a||v.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(c,d){if(void 0===d||d===!1)return!0;if(e=c.split("_"),e.length>1){var f=b.find(p+"-"+e[0]);if(f.length>0){var g=e[1];"replaceWith"===g?f[0]!==d[0]&&f.replaceWith(d):"img"===g?f.is("img")?f.attr("src",d):f.replaceWith(a("<img>").attr("src",d).attr("class",f.attr("class"))):f.attr(e[1],d)}}else b.find(p+"-"+c).html(d)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return A(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">&#215;</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},a.fn.magnificPopup=function(c){A();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=u?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1));else c=a.extend(!0,{},c),u?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var C,D,E,F="inline",G=function(){E&&(D.after(E.addClass(C)).detach(),E=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(F),w(h+"."+F,function(){G()})},getInline:function(c,d){if(G(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(D||(C=e.hiddenClass,D=x(C),C="mfp-"+C),E=f.after(D).detach().removeClass(C)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("<div>");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var L,M=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var N,O=function(){return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});var P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var S=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=b.st.gallery,e=".mfp-gallery";return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s);e.click(function(){b.prev()}),f.click(function(){b.next()}),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('<img class="mfp-img" />').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),A()});
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/wwwroot/administration/magnific-popup/magnific-popup.min.css b/src/Web/Grand.Web.Admin/wwwroot/administration/magnific-popup/magnific-popup.min.css
new file mode 100644
index 000000000..04f4aa05f
--- /dev/null
+++ b/src/Web/Grand.Web.Admin/wwwroot/administration/magnific-popup/magnific-popup.min.css
@@ -0,0 +1 @@
+.mfp-bg{top:0;left:0;width:100%;height:100%;z-index:1042;overflow:hidden;position:fixed;background:#0b0b0b;opacity:.8}.mfp-wrap{top:0;left:0;width:100%;height:100%;z-index:1043;position:fixed;outline:none !important;-webkit-backface-visibility:hidden}.mfp-container{text-align:center;position:absolute;width:100%;height:100%;left:0;top:0;padding:0 8px;box-sizing:border-box}.mfp-container:before{content:'';display:inline-block;height:100%;vertical-align:middle}.mfp-align-top .mfp-container:before{display:none}.mfp-content{position:relative;display:inline-block;vertical-align:middle;margin:0 auto;text-align:left;z-index:1045}.mfp-inline-holder .mfp-content,.mfp-ajax-holder .mfp-content{width:100%;cursor:auto}.mfp-ajax-cur{cursor:progress}.mfp-zoom-out-cur,.mfp-zoom-out-cur .mfp-image-holder .mfp-close{cursor:-moz-zoom-out;cursor:-webkit-zoom-out;cursor:zoom-out}.mfp-zoom{cursor:pointer;cursor:-webkit-zoom-in;cursor:-moz-zoom-in;cursor:zoom-in}.mfp-auto-cursor .mfp-content{cursor:auto}.mfp-close,.mfp-arrow,.mfp-preloader,.mfp-counter{-webkit-user-select:none;-moz-user-select:none;user-select:none}.mfp-loading.mfp-figure{display:none}.mfp-hide{display:none !important}.mfp-preloader{color:#CCC;position:absolute;top:50%;width:auto;text-align:center;margin-top:-0.8em;left:8px;right:8px;z-index:1044}.mfp-preloader a{color:#CCC}.mfp-preloader a:hover{color:#FFF}.mfp-s-ready .mfp-preloader{display:none}.mfp-s-error .mfp-content{display:none}button.mfp-close,button.mfp-arrow{overflow:visible;cursor:pointer;background:transparent;border:0;-webkit-appearance:none;display:block;outline:0;padding:0;z-index:1046;box-shadow:none;touch-action:manipulation}button::-moz-focus-inner{padding:0;border:0}.mfp-close{width:44px;height:44px;line-height:44px;position:absolute;right:0;top:0;text-decoration:none;text-align:center;opacity:.65;padding:0 0 18px 10px;color:#FFF;font-style:normal;font-size:28px;font-family:Arial,Baskerville,monospace}.mfp-close:hover,.mfp-close:focus{opacity:1}.mfp-close:active{top:1px}.mfp-close-btn-in .mfp-close{color:#333}.mfp-image-holder .mfp-close,.mfp-iframe-holder .mfp-close{color:#FFF;right:-6px;text-align:right;padding-right:6px;width:100%}.mfp-counter{position:absolute;top:0;right:0;color:#CCC;font-size:12px;line-height:18px;white-space:nowrap}.mfp-arrow{position:absolute;opacity:.65;margin:0;top:50%;margin-top:-55px;padding:0;width:90px;height:110px;-webkit-tap-highlight-color:transparent}.mfp-arrow:active{margin-top:-54px}.mfp-arrow:hover,.mfp-arrow:focus{opacity:1}.mfp-arrow:before,.mfp-arrow:after{content:'';display:block;width:0;height:0;position:absolute;left:0;top:0;margin-top:35px;margin-left:35px;border:medium inset transparent}.mfp-arrow:after{border-top-width:13px;border-bottom-width:13px;top:8px}.mfp-arrow:before{border-top-width:21px;border-bottom-width:21px;opacity:.7}.mfp-arrow-left{left:0}.mfp-arrow-left:after{border-right:17px solid #FFF;margin-left:31px}.mfp-arrow-left:before{margin-left:25px;border-right:27px solid #3f3f3f}.mfp-arrow-right{right:0}.mfp-arrow-right:after{border-left:17px solid #FFF;margin-left:39px}.mfp-arrow-right:before{border-left:27px solid #3f3f3f}.mfp-iframe-holder{padding-top:40px;padding-bottom:40px}.mfp-iframe-holder .mfp-content{line-height:0;width:100%;max-width:900px}.mfp-iframe-holder .mfp-close{top:-40px}.mfp-iframe-scaler{width:100%;height:0;overflow:hidden;padding-top:56.25%}.mfp-iframe-scaler iframe{position:absolute;display:block;top:0;left:0;width:100%;height:100%;box-shadow:0 0 8px rgba(0,0,0,0.6);background:#000}img.mfp-img{width:auto;max-width:100%;height:auto;display:block;line-height:0;box-sizing:border-box;padding:40px 0 40px;margin:0 auto}.mfp-figure{line-height:0}.mfp-figure:after{content:'';position:absolute;left:0;top:40px;bottom:40px;display:block;right:0;width:auto;height:auto;z-index:-1;box-shadow:0 0 8px rgba(0,0,0,0.6);background:#444}.mfp-figure small{color:#bdbdbd;display:block;font-size:12px;line-height:14px}.mfp-figure figure{margin:0}.mfp-bottom-bar{margin-top:-36px;position:absolute;top:100%;left:0;width:100%;cursor:auto}.mfp-title{text-align:left;line-height:18px;color:#f3f3f3;word-wrap:break-word;padding-right:36px}.mfp-image-holder .mfp-content{max-width:100%}.mfp-gallery .mfp-image-holder .mfp-figure{cursor:pointer}@media screen and (max-width:800px) and (orientation:landscape),screen and (max-height:300px){.mfp-img-mobile .mfp-image-holder{padding-left:0;padding-right:0}.mfp-img-mobile img.mfp-img{padding:0}.mfp-img-mobile .mfp-figure:after{top:0;bottom:0}.mfp-img-mobile .mfp-figure small{display:inline;margin-left:5px}.mfp-img-mobile .mfp-bottom-bar{background:rgba(0,0,0,0.6);bottom:0;margin:0;top:auto;padding:3px 5px;position:fixed;box-sizing:border-box}.mfp-img-mobile .mfp-bottom-bar:empty{padding:0}.mfp-img-mobile .mfp-counter{right:5px;top:3px}.mfp-img-mobile .mfp-close{top:0;right:0;width:35px;height:35px;line-height:35px;background:rgba(0,0,0,0.6);position:fixed;text-align:center;padding:0}}@media all and (max-width:900px){.mfp-arrow{-webkit-transform:scale(0.75);transform:scale(0.75)}.mfp-arrow-left{-webkit-transform-origin:0 0;transform-origin:0 0}.mfp-arrow-right{-webkit-transform-origin:100%;transform-origin:100%}.mfp-container{padding-left:6px;padding-right:6px}}
\ No newline at end of file