Skip to content

Commit

Permalink
Bugfix: proper skin setting to ejs template
Browse files Browse the repository at this point in the history
  • Loading branch information
Neloop committed Jan 16, 2018
1 parent 9c59570 commit b1eef25
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .env-sample
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PORT=443
# REDUX_DEV_SERVER_PORT=8082

TITLE=ReCodEx
SKING=skin-green
SKIN=skin-green
ALLOW_NORMAL_REGISTRATION=true
ALLOW_LDAP_REGISTRATION=false
ALLOW_CAS_REGISTRATION=true
Expand Down
1 change: 1 addition & 0 deletions bin/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ app.get('*', (req, res) => {
link: ''
},
reduxState: undefined,
skin: process.env.SKIN,
style: `http://localhost:${WEBPACK_DEV_SERVER_PORT}/style.css`,
bundle: `http://localhost:${WEBPACK_DEV_SERVER_PORT}/bundle.js`
});
Expand Down
2 changes: 1 addition & 1 deletion config/webpack.config-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const GitRevisionPlugin = require('git-revision-webpack-plugin');
// load variables from .env
require('dotenv').config();

// fix Widnows 10 Ubuntu issues with less loader:
// fix Windows 10 and Ubuntu issues with less loader:
try {
require('os').networkInterfaces();
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const GitRevisionPlugin = require('git-revision-webpack-plugin');
// load variables from .env
require('dotenv').config();

// fix Widnows 10 Ubuntu issues with less loader:
// fix Windows 10 and Ubuntu issues with less loader:
try {
require('os').networkInterfaces();
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"private": true,
"scripts": {
"clean": "rm -f public/bundle* && rm -f public/style* && rm -f bin/server.js",
"clean": "rm -f public/bundle* && rm -f public/style* && rm -f bin/server.js && rm -f bin/style*",
"build:server": "webpack -p --config config/webpack.server.js",
"build:client": "webpack -p --config config/webpack.config.js",
"build:server:test": "webpack --config config/webpack.server.js",
Expand Down
2 changes: 2 additions & 0 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const renderWithoutSSR = (res, renderProps) => {
html: '',
head,
reduxState: 'undefined',
skin: process.env.SKIN,
bundle,
style
});
Expand All @@ -90,6 +91,7 @@ const renderPage = (res, store, renderProps) => {
html,
head,
reduxState,
skin: process.env.SKIN,
bundle,
style
});
Expand Down
2 changes: 1 addition & 1 deletion views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

<script>
document.getElementById('loading-screen').remove();
document.body.className = "<%= process.env.SKIN ? process.env.SKIN : 'skin-green' %> fixed";
document.body.className = "<%- skin ? skin : 'skin-green' %> fixed";
</script>

Expand Down

0 comments on commit b1eef25

Please sign in to comment.