Skip to content

Commit 4e09894

Browse files
committed
fix: fix styles and bug with DOCUMENT_ROOT
1 parent 3c76c0d commit 4e09894

34 files changed

+52
-42
lines changed

controllers/admin/AdminVuefrontAjaxController.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ public function ajaxProcessVfTurnOn() {
4343

4444
$catalog_path = $catalog_url_info['path'];
4545

46+
$document_path = $catalog_path;
47+
if(!empty($_SERVER['DOCUMENT_ROOT'])) {
48+
$document_path = str_replace(realpath($_SERVER['DOCUMENT_ROOT']), '', realpath(_PS_ROOT_DIR_)) . '/';
49+
}
50+
4651
if (strpos($_SERVER["SERVER_SOFTWARE"], "Apache") !== false) {
4752

4853
if(!file_exists(_PS_ROOT_DIR_ . '/.htaccess')) {
@@ -93,28 +98,28 @@ public function ajaxProcessVfTurnOn() {
9398
# VueFront home page
9499
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout|jpg)
95100
RewriteCond %{QUERY_STRING} !.*(rest_route)
96-
RewriteCond %{DOCUMENT_ROOT}".$catalog_path."vuefront/index.html -f
101+
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/index.html -f
97102
RewriteRule ^$ vuefront/index.html [L]
98103
99104
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout|jpg)
100105
RewriteCond %{QUERY_STRING} !.*(rest_route)
101-
RewriteCond %{DOCUMENT_ROOT}".$catalog_path."vuefront/index.html !-f
106+
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/index.html !-f
102107
RewriteRule ^$ vuefront/200.html [L]
103108
104109
# VueFront page if exists html file
105110
RewriteCond %{REQUEST_FILENAME} !-f
106111
RewriteCond %{REQUEST_FILENAME} !-d
107112
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout|jpg)
108113
RewriteCond %{QUERY_STRING} !.*(rest_route)
109-
RewriteCond %{DOCUMENT_ROOT}".$catalog_path."vuefront/$1.html -f
114+
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/$1.html -f
110115
RewriteRule ^([^?]*) vuefront/$1.html [L,QSA]
111116
112117
# VueFront page if not exists html file
113118
RewriteCond %{REQUEST_FILENAME} !-f
114119
RewriteCond %{REQUEST_FILENAME} !-d
115120
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout|jpg)
116121
RewriteCond %{QUERY_STRING} !.*(rest_route)
117-
RewriteCond %{DOCUMENT_ROOT}".$catalog_path."vuefront/$1.html !-f
122+
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/$1.html !-f
118123
RewriteRule ^([^?]*) vuefront/200.html [L,QSA]";
119124

120125
$content = file_get_contents(_PS_ROOT_DIR_ . '/.htaccess');

views/js/d_pax/components/header/Account.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
2-
<div class="header-account">
2+
<div
3+
id="vf-header-account"
4+
class="header-account"
5+
>
36
<b-nav-item-dropdown
47
toggle-class="text-decoration-none text-1 m-0 font-weight-semibold"
58
no-caret
@@ -84,7 +87,7 @@ export default {
8487
}
8588
</script>
8689
<style lang="scss">
87-
.header-account {
90+
#vf-header-account.header-account {
8891
display: flex;
8992
align-items: center;
9093
height: 52px;
@@ -93,7 +96,7 @@ export default {
9396
background-color: $white;
9497
padding: 13px 17px;
9598
96-
&__separator {
99+
.header-account__separator {
97100
border-top: 1px solid $white-eight;
98101
margin-top: 0;
99102
margin: 15px 0;
@@ -159,12 +162,12 @@ export default {
159162
box-shadow: none;
160163
}
161164
162-
&__icon {
165+
.header-account__icon {
163166
font-size: 24px;
164167
color: #1a1a1a;
165168
}
166169
167-
&__full_name {
170+
.header-account__full_name {
168171
margin-right: 5px;
169172
font-size: 18px;
170173
font-weight: 600;
@@ -177,7 +180,7 @@ export default {
177180
}
178181
}
179182
180-
&__image {
183+
.header-account__image {
181184
border-radius: 50%;
182185
margin-right: 10px;
183186
width: 24px;

views/js/d_pax/webpack.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ module.exports = (env, argv) => {
140140
let newBuffer = new Buffer.from(body)
141141

142142
const gzipRes = isZipped ? zlib.gzipSync(newBuffer) : newBuffer
143-
res.setHeader('content-length', gzipRes.length);
143+
if(isZipped) {
144+
res.setHeader('content-length', gzipRes.length);
145+
}
144146
_write.call(res, gzipRes)
145147
} catch (e) {
146148
_write.call(res, buffer)

views/js/d_vuefront/0.678c1d7af77eb7b5c0b6.bundle.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

views/js/d_vuefront/0.adca5abcd215dbda4f91.bundle.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/js/d_vuefront/0.678c1d7af77eb7b5c0b6.css renamed to views/js/d_vuefront/0.adca5abcd215dbda4f91.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)