From af02b6b1b059c16a5327898f20eb456d2350559b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gayoso=20Gonz=C3=A1lez?= Date: Fri, 19 May 2023 16:18:52 +0200 Subject: [PATCH] Fix course detail title buttons * Create BaseButton to create a consistent button across all code * Create BaseIcon to restrict the icons used across all code * Create BaseMenu as starting point for menu component consistent across all code * Fix not loaded header logo of chamilo, importing in the component make the url resolution correctly * Fix colors of tailwind according to figma * Disable vuetify due to a crash with tailwind styles --- .editorconfig | 6 + .../components/basecomponents/BaseButton.vue | 114 ++++++++++++++++++ .../components/basecomponents/BaseIcon.vue | 26 ++++ .../components/basecomponents/BaseMenu.vue | 45 +++++++ .../components/basecomponents/ChamiloIcons.js | 55 +++++++++ .../vue/components/layout/TopbarLoggedIn.vue | 6 +- .../components/layout/TopbarNotLoggedIn.vue | 5 +- assets/vue/main.js | 2 +- assets/vue/views/course/Home.vue | 56 +++++---- tailwind.config.js | 6 +- webpack.config.js | 2 +- 11 files changed, 292 insertions(+), 31 deletions(-) create mode 100644 assets/vue/components/basecomponents/BaseButton.vue create mode 100644 assets/vue/components/basecomponents/BaseIcon.vue create mode 100644 assets/vue/components/basecomponents/BaseMenu.vue create mode 100644 assets/vue/components/basecomponents/ChamiloIcons.js diff --git a/.editorconfig b/.editorconfig index eb7b371932..7e59e0418c 100755 --- a/.editorconfig +++ b/.editorconfig @@ -14,5 +14,11 @@ indent_size = 4 max_line_length = 120 ij_php_space_after_type_cast = true +[*.vue] +indent_size = 2 + +[*.js] +indent_size = 2 + [*.vue] indent_size = 2 \ No newline at end of file diff --git a/assets/vue/components/basecomponents/BaseButton.vue b/assets/vue/components/basecomponents/BaseButton.vue new file mode 100644 index 0000000000..94d5d5e3e3 --- /dev/null +++ b/assets/vue/components/basecomponents/BaseButton.vue @@ -0,0 +1,114 @@ + + + diff --git a/assets/vue/components/basecomponents/BaseIcon.vue b/assets/vue/components/basecomponents/BaseIcon.vue new file mode 100644 index 0000000000..267939445b --- /dev/null +++ b/assets/vue/components/basecomponents/BaseIcon.vue @@ -0,0 +1,26 @@ + + + diff --git a/assets/vue/components/basecomponents/BaseMenu.vue b/assets/vue/components/basecomponents/BaseMenu.vue new file mode 100644 index 0000000000..5cf0f9ee87 --- /dev/null +++ b/assets/vue/components/basecomponents/BaseMenu.vue @@ -0,0 +1,45 @@ + + + diff --git a/assets/vue/components/basecomponents/ChamiloIcons.js b/assets/vue/components/basecomponents/ChamiloIcons.js new file mode 100644 index 0000000000..104f79b1f9 --- /dev/null +++ b/assets/vue/components/basecomponents/ChamiloIcons.js @@ -0,0 +1,55 @@ +/** + * Use it like chamiloIconToClass['eye'] to get the correct class for an icon + * + * Transform name of icons according to https://github.com/chamilo/chamilo-lms/wiki/Graphical-design-guide#default-icons-terminology + * to the classes needed for represent every icon +*/ +export const chamiloIconToClass = { + "pencil": "mdi mdi-pencil", + "delete": "", + "hammer-wrench": "", + "download": "", + "download-box": "", + "upload": "", + "arrow-left-bold-box": "", + "account-multiple-plus": "", + "cursor-move": "", + "chevron-left": "", + "chevron-right": "", + "arrow-up-bold": "", + "arrow-down-bold": "", + "arrow-right-bold": "", + "magnify-plus-outline": "", + "archive-arrow-up": "", + "folder-multiple-plus": "", + "folder-plus": "", + "alert": "", + "checkbox-marked": "", + "pencil-off": "", + "eye": "mdi mdi-eye", + "eye-off": "", + "checkbox-multiple-blank": "", + "checkbox-multiple-blank-outline": "", + "sync": "", + "sync-circle": "", + "fullscreen": "", + "fullscreen-exit": "", + "overscan": "", + "play-box-outline": "", + "fit-to-screen": "", + "bug-check": "", + "bug-outline": "", + "package": "", + "text-box-plus": "", + "rocket-launch": "", + "file-pdf-box": "", + "content-save": "", + "send": "", + "file-plus": "", + "cloud-upload": "", + "dots-vertical": "", + "information": "", + "account-key": "", + "cog": "mdi mdi-cog", + "plus": "mdi mdi-plus", +}; diff --git a/assets/vue/components/layout/TopbarLoggedIn.vue b/assets/vue/components/layout/TopbarLoggedIn.vue index 1a5e5ec53b..7793e4583f 100644 --- a/assets/vue/components/layout/TopbarLoggedIn.vue +++ b/assets/vue/components/layout/TopbarLoggedIn.vue @@ -3,7 +3,7 @@ @@ -52,6 +52,8 @@ import Avatar from "primevue/avatar"; import Menu from "primevue/menu"; import { usePlatformConfig } from "../../store/platformConfig"; +import headerLogoPath from "../../../../assets/css/themes/chamilo/images/header-logo.svg"; + // eslint-disable-next-line no-undef const props = defineProps({ currentUser: { @@ -113,4 +115,6 @@ const userSubmenuItems = [ function toogleUserMenu(event) { elUserSubmenu.value.toggle(event); } + +const headerLogo = headerLogoPath; diff --git a/assets/vue/components/layout/TopbarNotLoggedIn.vue b/assets/vue/components/layout/TopbarNotLoggedIn.vue index 3884d9d20d..ceaf6f72c9 100644 --- a/assets/vue/components/layout/TopbarNotLoggedIn.vue +++ b/assets/vue/components/layout/TopbarNotLoggedIn.vue @@ -6,7 +6,7 @@ @@ -16,6 +16,7 @@ diff --git a/assets/vue/main.js b/assets/vue/main.js index 7c014eb09a..9bc696b3c7 100644 --- a/assets/vue/main.js +++ b/assets/vue/main.js @@ -285,7 +285,7 @@ app .use(Quasar, quasarUserOptions) .use(VueFlatPickr) //.use(VuelidatePlugin) - .use(vuetify) + // .use(vuetify) .use(router) .use(store) .use(pinia) diff --git a/assets/vue/views/course/Home.vue b/assets/vue/views/course/Home.vue index df0eee356b..878ab9946d 100644 --- a/assets/vue/views/course/Home.vue +++ b/assets/vue/views/course/Home.vue @@ -82,29 +82,34 @@ -