Skip to content

Commit

Permalink
Merge pull request #3764 from camptocamp/fix-mobile-theme
Browse files Browse the repository at this point in the history
Fix the mobile theme
  • Loading branch information
sbrunner committed May 23, 2018
2 parents c44126e + a01ba11 commit ac51a21
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 62 deletions.
13 changes: 7 additions & 6 deletions geoportal/c2cgeoportal_geoportal/scaffolds/create/vars.yaml_tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -265,17 +265,18 @@ vars:
# url: {web_protocol}://{host}/child/wsgi

update_paths:
- shortener
- fulltextsearch
- admin_interface
- authorized_referers
- authtkt
- admin_interface
- checker.fulltextsearch
- checker.print
- check_collector.disabled
- check_collector.hosts
- checker.fulltextsearch
- checker.print
- fulltextsearch
- interfaces_theme
- shortener

no_interpreted:
- shortener.email_body
- reset_password.email_body
- shortener.email_body
- welcome_email.email_body
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');

const INTERFACE_THEME = ${__import__('json').dumps(interfaces_theme)};

const plugins = [];
const entry = {};

Expand All @@ -12,21 +14,19 @@ const nodeEnv = process.env['NODE_ENV'] || 'development';
const dev = nodeEnv == 'development'
process.traceDeprecation = true;

for (const filename of ls(path.resolve(
__dirname, 'geoportal/{{package}}_geoportal/static-ngeo/js/apps/*.html.ejs'
))) {
const name = filename.file.split('.')[0];
entry[name] = path.resolve(__dirname, 'geoportal/{{package}}_geoportal/static-ngeo/js/apps/Controller' + name + '.js');
plugins.push(
new HtmlWebpackPlugin({
inject: false,
template: filename.full,
chunksSortMode: 'manual',
filename: name + '.html',
chunks: ['commons', name],
})
);
}
const name = process.env.INTERFACE;
process.env.THEME = INTERFACE_THEME[name];

entry[name] = path.resolve(__dirname, 'geoportal/${package}_geoportal/static-ngeo/js/apps/Controller' + name + '.js');
plugins.push(
new HtmlWebpackPlugin({
inject: false,
template: '/src/geoportal/${package}_geoportal/static-ngeo/js/apps/' + name + '.html.ejs',
chunksSortMode: 'manual',
filename: name + '.html',
chunks: [name],
})
);

const babelPresets = [['env',{
"targets": {
Expand Down Expand Up @@ -59,12 +59,6 @@ module.exports = {
publicPath: dev ? '/${instance}/dev/' : '${entry_point}static-ngeo/UNUSED_CACHE_VERSION/build/'
},
entry: entry,
/* optimization: {
splitChunks: {
chunks: 'all',
name: 'commons',
}
},*/
module: {
rules
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const webpackMerge = require('webpack-merge');
const apps = require('./webpack.apps.js');
const commons = require('ngeo/buildtools/webpack.commons');

let config = commons.config;
Expand All @@ -16,6 +17,6 @@ switch (nodeEnv) {
process.exit(2);
}

config = webpackMerge(config, require('./webpack.apps.js'));
config = webpackMerge(config, apps);

module.exports = config;
Original file line number Diff line number Diff line change
Expand Up @@ -269,17 +269,18 @@ vars:
code_destination: /var/www/c2cgeoportal_mapfish/private/c2cgeoportal

update_paths:
- shortener
- fulltextsearch
- admin_interface
- authorized_referers
- authtkt
- admin_interface
- checker.fulltextsearch
- checker.print
- check_collector.disabled
- check_collector.hosts
- checker.fulltextsearch
- checker.print
- fulltextsearch
- interfaces_theme
- shortener

no_interpreted:
- shortener.email_body
- reset_password.email_body
- shortener.email_body
- welcome_email.email_body
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');

const INTERFACE_THEME = ${__import__('json').dumps(interfaces_theme)};

const plugins = [];
const entry = {};

Expand All @@ -12,21 +14,19 @@ const nodeEnv = process.env['NODE_ENV'] || 'development';
const dev = nodeEnv == 'development'
process.traceDeprecation = true;

for (const filename of ls(path.resolve(
__dirname, 'geoportal/{{package}}_geoportal/static-ngeo/js/apps/*.html.ejs'
))) {
const name = filename.file.split('.')[0];
entry[name] = path.resolve(__dirname, 'geoportal/{{package}}_geoportal/static-ngeo/js/apps/Controller' + name + '.js');
plugins.push(
new HtmlWebpackPlugin({
inject: false,
template: filename.full,
chunksSortMode: 'manual',
filename: name + '.html',
chunks: ['commons', name],
})
);
}
const name = process.env.INTERFACE;
process.env.THEME = INTERFACE_THEME[name];

entry[name] = path.resolve(__dirname, 'geoportal/${package}_geoportal/static-ngeo/js/apps/Controller' + name + '.js');
plugins.push(
new HtmlWebpackPlugin({
inject: false,
template: '/src/geoportal/${package}_geoportal/static-ngeo/js/apps/' + name + '.html.ejs',
chunksSortMode: 'manual',
filename: name + '.html',
chunks: [name],
})
);

const babelPresets = [['env',{
"targets": {
Expand Down Expand Up @@ -59,12 +59,6 @@ module.exports = {
publicPath: dev ? '/${instanceid}/dev/' : '/${instanceid}/wsgi/static-ngeo/UNUSED_CACHE_VERSION/build/'
},
entry: entry,
/* optimization: {
splitChunks: {
chunks: 'all',
name: 'commons',
}
},*/
module: {
rules
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,17 +567,22 @@ $(APP_OUTPUT_DIR)/images/: /usr/lib/node_modules/jquery-ui/themes/base/images
mkdir --parent $@
cp -r $</* $@


.PRECIOUS: /build/apps.timestamp
/build/apps.timestamp: $(OL_JS_FILES) $(NGEO_JS_FILES) $(APP_JS_FILES) \
$(APP_HTML_FILES) webpack.apps.js webpack.config.js \
$(LESS_FILES) \
$(NGEO_FONTS) \
$(APP_OUTPUT_DIR)/images/
/build/apps.timestamp: webpack.apps.js $(addprefix /build/apps., $(addsuffix .timestamp, $(NGEO_INTERFACES)))
touch $@

.PRECIOUS: /build/apps.%.timestamp
/build/apps.%.timestamp: $(OL_JS_FILES) $(NGEO_JS_FILES) $(APP_JS_FILES) \
$(APP_HTML_FILES) webpack.config.js \
$(LESS_FILES) \
$(NGEO_FONTS) \
$(APP_OUTPUT_DIR)/images/
$(PRERULE_CMD)
# Workaround to make Webpack working for ol/index.js
if [ -e node_modules ]; then mv node_modules node_modules_bak; fi
if [ -e node_modules ]; then rm --force node_modules_bak; mv node_modules node_modules_bak; fi
ln --symbolic /usr/lib/node_modules/ .
THEME=desktop webpack $(WEBPACK_ARGS)
INTERFACE=$* webpack $(WEBPACK_ARGS)
rm node_modules
if [ -e node_modules_bak ]; then mv node_modules_bak node_modules; fi
touch $@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ vars:

default_interface: desktop

interfaces_theme:
desktop: desktop

# The dogpile.cache configuration.
#
# Do not touch if unsure.
Expand Down

0 comments on commit ac51a21

Please sign in to comment.