diff --git a/backend/build.gradle.kts b/backend/build.gradle.kts index 94379502b352271b47a1855b98a9c00811ad868f..824cba29bb9fb6bc56b154366fc6f3b9e3deac69 100644 --- a/backend/build.gradle.kts +++ b/backend/build.gradle.kts @@ -51,7 +51,7 @@ tasks { // replace the script.js and style.css file names referenced in main.html // by their actual name, containing the content hash filesMatching("**/layout/main.html") { - val webAssetsDir = project(":web").file("build/dist/assets/"); + val webAssetsDir = project(":web").file("build/dist/resources/"); val scriptFileName = webAssetsDir.list().first { it.startsWith("script") && it.endsWith(".js") } val styleFileName = webAssetsDir.list().first { it.startsWith("style") && it.endsWith(".css") } diff --git a/backend/src/main/resources/static/assets/images/favicon.ico b/backend/src/main/resources/static/resources/images/favicon.ico similarity index 100% rename from backend/src/main/resources/static/assets/images/favicon.ico rename to backend/src/main/resources/static/resources/images/favicon.ico diff --git a/backend/src/main/resources/static/assets/images/logo.png b/backend/src/main/resources/static/resources/images/logo.png similarity index 100% rename from backend/src/main/resources/static/assets/images/logo.png rename to backend/src/main/resources/static/resources/images/logo.png diff --git a/backend/src/main/resources/static/assets/images/marker-icon-blue.png b/backend/src/main/resources/static/resources/images/marker-icon-blue.png similarity index 100% rename from backend/src/main/resources/static/assets/images/marker-icon-blue.png rename to backend/src/main/resources/static/resources/images/marker-icon-blue.png diff --git a/backend/src/main/resources/static/assets/images/marker-icon-green.png b/backend/src/main/resources/static/resources/images/marker-icon-green.png similarity index 100% rename from backend/src/main/resources/static/assets/images/marker-icon-green.png rename to backend/src/main/resources/static/resources/images/marker-icon-green.png diff --git a/backend/src/main/resources/static/assets/images/marker-icon-purple.png b/backend/src/main/resources/static/resources/images/marker-icon-purple.png similarity index 100% rename from backend/src/main/resources/static/assets/images/marker-icon-purple.png rename to backend/src/main/resources/static/resources/images/marker-icon-purple.png diff --git a/backend/src/main/resources/static/assets/images/marker-icon-red.png b/backend/src/main/resources/static/resources/images/marker-icon-red.png similarity index 100% rename from backend/src/main/resources/static/assets/images/marker-icon-red.png rename to backend/src/main/resources/static/resources/images/marker-icon-red.png diff --git a/backend/src/main/resources/templates/fragments/map.html b/backend/src/main/resources/templates/fragments/map.html index cad10ae8e4027e704be8bdc78e8308b82aa9cc59..aa51b67ebc0b3fc023bf3d4062aad0b2b1e704f3 100644 --- a/backend/src/main/resources/templates/fragments/map.html +++ b/backend/src/main/resources/templates/fragments/map.html @@ -10,13 +10,13 @@ to display <div th:fragment="map" id="map-container" class="d-none"> <div id="map" class="border rounded"></div> <div class="map-legend mt-1 small"> - <img th:src="@{/assets/images/marker-icon-red.png}" id="red" /> + <img th:src="@{/resources/images/marker-icon-red.png}" id="red" /> <label for="red" class="me-2">Origin site</label> - <img th:src="@{/assets/images/marker-icon-blue.png}" id="blue" /> + <img th:src="@{/resources/images/marker-icon-blue.png}" id="blue" /> <label for="blue" class="me-2">Collecting site</label> - <img th:src="@{/assets/images/marker-icon-green.png}" id="green" /> + <img th:src="@{/resources/images/marker-icon-green.png}" id="green" /> <label for="green" class="me-2">Evaluation site</label> - <img th:src="@{/assets/images/marker-icon-purple.png}" id="purple" /> + <img th:src="@{/resources/images/marker-icon-purple.png}" id="purple" /> <label for="purple">Multi-purpose site</label> </div> </div> diff --git a/backend/src/main/resources/templates/layout/main.html b/backend/src/main/resources/templates/layout/main.html index 0ceb3ebf650b4ce83e8fc1371d175841769ee0da..7b1bb775d55f36e7445153370ed12a73ca14b209 100644 --- a/backend/src/main/resources/templates/layout/main.html +++ b/backend/src/main/resources/templates/layout/main.html @@ -10,11 +10,11 @@ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta content="width=device-width, initial-scale=1" name="viewport" /> - <link th:href="@{/assets/style.css}" rel="stylesheet" /> + <link th:href="@{/resources/style.css}" rel="stylesheet" /> <link rel="shortcut icon" - th:href="@{/assets/images/favicon.ico}" + th:href="@{/resources/images/favicon.ico}" type="image/x-icon" /> </head> @@ -26,7 +26,7 @@ class="navbar-brand py-0" href="https://urgi.versailles.inrae.fr/faidare" > - <img th:src="@{/assets/images/logo.png}" style="height: 40px" /> + <img th:src="@{/resources/images/logo.png}" style="height: 40px" /> </a> <button class="navbar-toggler" @@ -86,7 +86,7 @@ <p>Layout content</p> </div> </div> - <script type="text/javascript" th:src="@{/assets/script.js}"></script> + <script type="text/javascript" th:src="@{/resources/script.js}"></script> <script type="text/javascript" th:replace="${script}"></script> </body> </html> diff --git a/web/src/map/map.ts b/web/src/map/map.ts index a61002a445bc900a1aa60a97125df9a67c98c676..37cf126de97c3655f243e2a832b0ba0f7ba38544 100644 --- a/web/src/map/map.ts +++ b/web/src/map/map.ts @@ -27,7 +27,7 @@ function markerColor(location: MapLocation) { } function markerIconUrl(contextPath: string, location: MapLocation) { - return `${contextPath}/assets/images/marker-icon-${markerColor(location)}.png`; + return `${contextPath}/resources/images/marker-icon-${markerColor(location)}.png`; } export function initializeMap(options: MapOptions) { diff --git a/web/webpack.config.js b/web/webpack.config.js index a8ffae0a633e83b0de4095643e2e4ece795023c5..2606ec0d1bbe919808215eb1ed51b2b6320da35b 100644 --- a/web/webpack.config.js +++ b/web/webpack.config.js @@ -58,8 +58,8 @@ module.exports = (env, argv) => ({ extensions: ['.ts', '.js'], }, output: { - // the output is stored in build/dist/assets - path: path.resolve(__dirname, 'build/dist/assets'), + // the output is stored in build/dist/resources + path: path.resolve(__dirname, 'build/dist/resources'), filename: argv.mode === 'production' ? '[name].[contenthash].js' : '[name].js' }, optimization: {