diff --git a/README.md b/README.md index a2df341..7b23ff5 100644 --- a/README.md +++ b/README.md @@ -49,27 +49,12 @@ my-theme └─login |_ theme.properties └─ resources - ├─ theme.json ├─ js | └─ config.js └─ img └─ logo.png ``` -#### theme.json - -The `theme.json` file allows you to provide extra informations that can be used by the various fragments. - -By default the `theme.json` provides version informations for the theme as well as for the parent KDK theme: - -```json -{ - "version": { - "theme": "latest", - "kdkTheme": "latest" - } -} -``` > [!NOTE] > These informations are used by the default `footer.ftl` fragment which displays the different version in a tooltip. @@ -87,6 +72,13 @@ locales=fr,en meta=viewport==width=device-width,initial-scale=1 ``` +In addition, this theme provides 2 additional variables: +* `version`: which allows you to define the version of your theme. +* `kdkVersion`: which allows you to define the version of the KDK theme. + +> [!TIP] +> These variables can be useful to customize your CI process. + #### config.js The `config.js` file allows you to configure **Quasar** by defining a [Quasar Config Object](https://quasar.dev/start/umd/#quasar-config-object). diff --git a/themes/kdk/login/fragments/footer.ftl b/themes/kdk/login/fragments/footer.ftl index 1d48eba..dab081d 100644 --- a/themes/kdk/login/fragments/footer.ftl +++ b/themes/kdk/login/fragments/footer.ftl @@ -2,8 +2,8 @@
-
${msg('themeVersion')}: {{ getVersion()?.theme }}
-
${msg('kdkThemeVersion')}: {{ getVersion()?.kdkTheme }}
+
${msg('themeVersion')}: {{ version().theme }}
+
${msg('kdkThemeVersion')}: {{ version().kdk }}
|
diff --git a/themes/kdk/login/resources/js/quasar.js b/themes/kdk/login/resources/js/quasar.js index 154240f..9fc7df8 100644 --- a/themes/kdk/login/resources/js/quasar.js +++ b/themes/kdk/login/resources/js/quasar.js @@ -10,14 +10,11 @@ const app = Vue.createApp({ const environment = JSON.parse(String(document.querySelector('#environment').textContent)) let informations = null // functions - function getInformations () { - if (!informations) { - informations = JSON.parse(String(document.querySelector('#informations').textContent)) + function version () { + return { + theme: themeVersion, + kdk: kdkVersion } - return informations - } - function getVersion () { - return getInformations().version } async function popup (title, file) { // compute the localized file @@ -56,8 +53,7 @@ const app = Vue.createApp({ showPasswordNew: Vue.ref(false), showPasswordConfirm: Vue.ref(false), submitAction: Vue.ref(''), - getInformations, - getVersion, + version, popup } } diff --git a/themes/kdk/login/resources/theme.json b/themes/kdk/login/resources/theme.json deleted file mode 100644 index 887b135..0000000 --- a/themes/kdk/login/resources/theme.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": { - "theme": "latest", - "kdkTheme": "latest" - } -} \ No newline at end of file diff --git a/themes/kdk/login/template.ftl b/themes/kdk/login/template.ftl index 00a8125..b6ee005 100644 --- a/themes/kdk/login/template.ftl +++ b/themes/kdk/login/template.ftl @@ -31,7 +31,25 @@ <#list properties.scripts?split(' ') as script> - + + <#if properties.version?has_content> + + <#else> + + + <#if properties.kdkVersion?has_content> + + <#else> + + @@ -93,21 +111,6 @@ } } - - -