8000 Fix portal issues by nhathoang989 · Pull Request #537 · mixcore/mix.core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix portal issues #537

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/Mix.Cms.Lib/Helpers/MixCmsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,11 @@ public static async Task<MixNavigation> GetNavigationAsync(string name, string c

foreach (var item in cate.MenuItems)
{
if (item.Uri.IndexOf('?') > 0)
{
item.Uri = item.Uri[..item.Uri.IndexOf('?')];
}

item.IsActive = item.Uri == activePath;
if (item.IsActive)
{
Expand Down Expand Up @@ -623,6 +628,25 @@ public static string TranslateUrl(string url, string srcCulture, string destCult
: $"/{destCulture}{url}";
}

public static string GetUrlByPageId(int pageId, string culture)
{
using var context = new MixCmsContext();
var seoName = context.MixPage.Where(p => p.Id == pageId && p.Specificulture == culture).Select(p => p.SeoName).FirstOrDefault();
if (seoName == null)
{
return $"/{culture}";
}

string seoUrl = $"/{culture}/{seoName}";
var urlAlias = context.MixUrlAlias.Where(m => m.SourceId == pageId.ToString() && m.Specificulture == culture).Select(p => p.Alias).FirstOrDefault();
if (urlAlias == null)
{
return seoUrl;
}

return urlAlias;
}

public static string BuildUrl(HttpContext context, string key, string value)
{
var nameValueCollection = new NameValueCollection
Expand Down
1 change: 1 addition & 0 deletions src/Mix.Cms.Lib/Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Update-Database -Context MixCmsContext
remove ntext type
remove default value

mysql> SET GLOBAL sort_buffer_size = 1024 * 1024 * 4;

// Clean Init Database

Expand Down
6 changes: 1 addition & 5 deletions src/Mix.Cms.Web/web.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\mixcore.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="inprocess">
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
</environmentVariables>
</aspNetCore>
<aspNetCore processPath="dotnet" arguments=".\mixcore.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion src/Mix.Cms.Web/wwwroot/mix-app/css/app-client.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/Mix.Cms.Web/wwwroot/mix-app/css/app-vendor-scss.min.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Thu Oct 07 2021 10:37:10 GMT+0700 (Indochina Time) */fb-login {
/* Sat Oct 16 2021 14:15:51 GMT+0700 (Indochina Time) */fb-login {
background-color: aqua; }

medias .modal {
Expand Down Expand Up @@ -32,6 +32,10 @@ mix-module-data-table .preview-container {
upload-croppie .cr-boundary {
overflow: hidden; }

.table-data td.preview {
max-width: 120px;
overflow: hidden; }

main-side-bar-dynamic .sw-sidebar .sw-toc-item {
position: relative; }
main-side-bar-dynamic .sw-sidebar .sw-toc-item .sw-toc-link .sw-toc-link {
Expand Down Expand Up @@ -63,7 +67,3 @@ mix-database-nav-values mix-column-preview .rowx {
#modal-content-filter .modal-lg,
#modal-content-filter .modal-xl {
max-width: 80vw; } }

.table-data td.preview {
max-width: 120px;
overflow: hidden; }
8 changes: 4 additions & 4 deletions src/Mix.Cms.Web/wwwroot/mix-app/css/app-vendor.min.css

Large diffs are not rendered by default.

204 changes: 43 additions & 161 deletions src/Mix.Cms.Web/wwwroot/mix-app/js/app-client.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,44 +462,19 @@ modules.component("fbCustomerChat", {
},
});

modules.component("fbLike", {
templateUrl: "/mix-app/views/app-client/components/fb-like/fb-like.html",
controller: [
"$location",
function ($location) {
var ctrl = this;
ctrl.href = ctrl.href || window.top.location.href;
ctrl.layout = ctrl.layout || "standard";
ctrl.size = ctrl.size || "small";
ctrl.showFaces = ctrl.showFaces || true;
this.$ () {
setTimeout(() => {
FB.XFBML.parse();
}, 200);
};
},
],
bindings: {
href: "=",
layout: "=",
size: "=",
showFaces: "=",
},
});

modules.component("fbShare", {
templateUrl: "/mix-app/views/app-client/components/fb-share/fb-share.html",
modules.component("fbSend", {
templateUrl: "/mix-app/views/app-client/components/fb-send/fb-send.html",
controller: [
"$location",
function ($location) {
var ctrl = this;
ctrl.href = ctrl.href || window.top.location.href;
ctrl.share = function () {
var href = window.top.location.href;
ctrl.send = function () {
var link = ctrl.href || window.top.location.href;
FB.ui(
{
method: "share",
href: href,
method: "send",
link: link,
},
function (response) {}
);
Expand All @@ -508,31 +483,32 @@ modules.component("fbShare", {
],
bindings: {
href: "=",
appId: "=",
},
});

modules.component("fbSend", {
templateUrl: "/mix-app/views/app-client/components/fb-send/fb-send.html",
modules.component("fbLike", {
templateUrl: "/mix-app/views/app-client/components/fb-like/fb-like.html",
controller: [
"$location",
function ($location) {
var ctrl = this;
ctrl.href = ctrl.href || window.top.location.href;
ctrl.send = function () {
var link = ctrl.href || window.top.location.href;
FB.ui(
{
method: "send",
link: link,
},
function (response) {}
);
ctrl.layout = ctrl.layout || "standard";
ctrl.size = ctrl.size || "small";
ctrl.showFaces = ctrl.showFaces || true;
this.$ () {
setTimeout(() => {
FB.XFBML.parse();
}, 200);
};
},
],
bindings: {
href: "=",
appId: "=",
layout: "=",
size: "=",
showFaces: "=",
},
});

Expand Down Expand Up @@ -779,6 +755,30 @@ modules.component("mixMessagesHubClient", {
],
});

modules.component("fbShare", {
templateUrl: "/mix-app/views/app-client/components/fb-share/fb-share.html",
controller: [
"$location",
function ($location) {
var ctrl = this;
ctrl.href = ctrl.href || window.top.location.href;
ctrl.share = function () {
var href = window.top.location.href;
FB.ui(
{
method: "share",
href: href,
},
function (response) {}
);
};
},
],
bindings: {
href: "=",
},
});

modules.component("serviceHubClient", {
templateUrl:
"/mix-app/views/app-client/components/service-hub-client/view.html",
Expand Down Expand Up @@ -1001,124 +1001,6 @@ modules.component("serviceHubClient", {
],
});

modules.component("shoppingCart", {
templateUrl: "/mix-app/views/app-client/components/shopping-cart/view.html",
bindings: {
cartData: "=?",
successCallback: "&?",
},
controller: "ShoppingCartController",
});
modules.controller("ShoppingCartController", [
"$rootScope",
"$scope",
"$element",
"localStorageService",
"RestMixDatabaseDataClientService",
function ($rootScope, $scope, $element, localStorageService, dataService) {
$scope.submitted = false;
$scope.isShow = false;
$scope.init = function (validateCallback, successCallback, failCallback) {
$scope.validateCallback = validateCallback;
$scope.successCallback = successCallback;
$scope.failCallback = failCallback;
};
$scope.translate = $rootScope.translate;

$scope.showShoppingCart = function () {
$scope.cartModal.show();
};
$scope.calculate = function () {
$scope.cartData.total = 0;
$scope.cartData.totalItem = $scope.cartData.items.length;
angular.forEach($scope.cartData.items, function (e) {
$scope.cartData.total += parseInt(e.price) * e.quantity;
});
localStorageService.set("shoppingCart", $scope.cartData);
};
$scope.removeItem = function (index) {
$scope.cartData.items.splice(index, 1);
$scope.calculate();
};
$scope.submit = async function () {
$scope.onValidate();
if ($scope.frmCheckOut.$valid) {
$rootScope.submitting = true;
var result = await dataService.saveData(
"shoppingCart",
$scope.cartData
);
if (result.isSucceed) {
$scope.onSuccess(result.data);
} else {
$scope.onFail(result.errors);
}
$scope.$apply();
}
};

$scope. function () {
$scope.frmCheckOut.$$element.addClass("was-validated");
if ($scope.validateCallback) {
let isValid = await $rootScope.executeFunctionByName(
$scope.validateCallback,
[$scope.frmCheckOut, $scope.cartData],
window
);
$scope.frmCheckOut.$valid = $scope.frmCheckOut.$valid && isValid;
}
};
$scope. (resp) {
setTimeout(() => {
$scope.submitting = false;
}, 1000);
$scope.cartData = {
items: [],
totalItem: 0,
total: 0,
};
localStorageService.set("shoppingCart", $scope.cartData);

if ($scope.successCallback) {
$rootScope.executeFunctionByName(
$scope.successCallback,
[resp],
window
);
} else {
window.location.href = "/";
}
};
$scope. (errors) {
if ($scope.failCallback) {
$rootScope.executeFunctionByName($scope.failCallback, [errors], window);
}
};
$scope.sendmail = async function () {
let edm =
'Url: <a href="[url]">View Tour</a> <br/>Name: [name] <br/>' +
"Phone: [phone]<br/>" +
"Email: [email]<br/>" +
"Quantity: [quantity]<br/>" +
"Message: [message] <br/>" +
"property: [property] <br/>Price: [price] <br/>";

edm = edm.replace(/\[url\]/g, window.top.location.href);
edm = edm.replace(/\[name\]/g, $scope.order.name);
edm = edm.replace(/\[phone\]/g, $scope.order.phone);
edm = edm.replace(/\[email\]/g, $scope.order.email);
edm = edm.replace(/\[message\]/g, $scope.order.message);
edm = edm.replace(/\[property\]/g, $scope.order.propertyId);
edm = edm.replace(/\[price\]/g, $scope.order.price);
edm = edm.replace(/\[quantity\]/g, $scope.order.quantity);

// TODO Handle cart submit
await commonService.sendMail("Booking - " + $scope.propertyName, edm);
$scope.submitted = true;
};
},
]);

app.factory("ConnectionManager", [
function () {
var serviceFactory = {};
Expand Down
Loading
0