From 0bd7be4858f3aed69aa6b08edbc72a134fe596bd Mon Sep 17 00:00:00 2001 From: hay-kot Date: Sat, 22 May 2021 23:14:56 -0700 Subject: [PATCH] set global icons --- frontend/src/components/Fallbacks/The404.vue | 4 +-- frontend/src/components/Login/LoginForm.vue | 2 +- frontend/src/components/Login/SignUpForm.vue | 4 +-- .../src/components/MealPlan/MealPlanCard.vue | 10 +++---- frontend/src/components/Recipe/CardImage.vue | 2 +- .../src/components/Recipe/ContextMenu.vue | 4 +-- .../src/components/Recipe/EditorButtonRow.vue | 6 ++-- .../components/Recipe/MobileRecipeCard.vue | 2 +- .../src/components/Recipe/Parts/Assets.vue | 4 +-- .../Recipe/Parts/Helpers/ExtrasEditor.vue | 2 +- .../components/Recipe/Parts/Ingredients.vue | 4 +-- .../components/Recipe/Parts/Instructions.vue | 2 +- .../src/components/Recipe/Parts/Notes.vue | 4 +-- .../components/Recipe/RecipeEditor/index.vue | 2 +- frontend/src/components/UI/CardSection.vue | 2 +- .../components/UI/Dialogs/BackupDialog.vue | 3 +- .../src/components/UI/Dialogs/BaseDialog.vue | 2 +- .../UI/Dialogs/NewCategoryTagDialog.vue | 4 +-- frontend/src/components/UI/TheAppBar.vue | 2 +- frontend/src/components/UI/TheRecipeFab.vue | 4 +-- frontend/src/components/UI/TheSidebar.vue | 8 ++--- frontend/src/components/UI/TheSiteMenu.vue | 4 +-- frontend/src/main.js | 3 ++ frontend/src/pages/Admin/About/index.vue | 4 +-- .../pages/Admin/Dashboard/BackupViewer.vue | 4 +-- .../src/pages/Admin/Dashboard/EventViewer.vue | 6 ++-- frontend/src/pages/Admin/Dashboard/index.vue | 24 ++++++++------- .../src/pages/Admin/ManageUsers/GroupCard.vue | 4 +-- .../Admin/ManageUsers/GroupDashboard.vue | 2 +- .../Admin/ManageUsers/TheSignUpTable.vue | 4 +-- .../pages/Admin/ManageUsers/TheUserTable.vue | 4 +-- .../src/pages/Admin/ManageUsers/index.vue | 4 +-- .../src/pages/Admin/Profile/APITokenCard.vue | 18 ++++++----- .../pages/Admin/Profile/ProfileGroupCard.vue | 16 +++++----- .../pages/Admin/Profile/ProfileThemeCard.vue | 4 +-- frontend/src/pages/Admin/Profile/UserCard.vue | 4 +-- .../pages/Admin/Settings/HomePageSettings.vue | 8 ++--- .../ToolBox/CategoryTagEditor/BulkAssign.vue | 2 +- .../CategoryTagEditor/RemoveUnused.vue | 2 +- .../Admin/ToolBox/CategoryTagEditor/index.vue | 2 +- .../pages/Admin/ToolBox/EventNotification.vue | 4 +-- .../pages/Admin/ToolBox/RecipeOrganizer.vue | 4 +-- frontend/src/pages/Admin/ToolBox/index.vue | 8 ++--- frontend/src/pages/Recipes/CustomPage.vue | 4 +-- frontend/src/pages/ShoppingList/index.vue | 12 ++++---- frontend/src/utils/globals.js | 30 +++++++++++++++++++ 46 files changed, 147 insertions(+), 111 deletions(-) create mode 100644 frontend/src/utils/globals.js diff --git a/frontend/src/components/Fallbacks/The404.vue b/frontend/src/components/Fallbacks/The404.vue index 01e57e372..cf88a33c1 100644 --- a/frontend/src/components/Fallbacks/The404.vue +++ b/frontend/src/components/Fallbacks/The404.vue @@ -9,7 +9,7 @@

4

- mdi-silverware-variant + {{ $globals.icons.primary }}

4

@@ -33,7 +33,7 @@ export default { return { buttons: [ { icon: "mdi-home", to: "/", text: "Home" }, - { icon: "mdi-silverware-variant", to: "/recipes/all", text: "All Recipes" }, + { icon: this.$globals.icons.primary, to: "/recipes/all", text: "All Recipes" }, { icon: "mdi-magnify", to: "/search", text: "Search" }, ], }; diff --git a/frontend/src/components/Login/LoginForm.vue b/frontend/src/components/Login/LoginForm.vue index 18ddc4d56..2499457e6 100644 --- a/frontend/src/components/Login/LoginForm.vue +++ b/frontend/src/components/Login/LoginForm.vue @@ -3,7 +3,7 @@ - mdi-account + {{ $globals.icons.user }} {{ $t("user.login") }} diff --git a/frontend/src/components/Login/SignUpForm.vue b/frontend/src/components/Login/SignUpForm.vue index d3f651774..c8904594a 100644 --- a/frontend/src/components/Login/SignUpForm.vue +++ b/frontend/src/components/Login/SignUpForm.vue @@ -3,7 +3,7 @@ - mdi-account + {{ $globals.icons.user }} @@ -18,7 +18,7 @@ - mdi-square-edit-outline + {{ $globals.icons.edit }} No Recipe @@ -38,14 +38,14 @@ - mdi-square-edit-outline + {{ $globals.icons.edit }} No Recipe - mdi-plus + {{ $globals.icons.create }} Side @@ -65,7 +65,7 @@ - mdi-delete + {{ $globals.icons.delete }} diff --git a/frontend/src/components/Recipe/CardImage.vue b/frontend/src/components/Recipe/CardImage.vue index d37f16619..061d70413 100644 --- a/frontend/src/components/Recipe/CardImage.vue +++ b/frontend/src/components/Recipe/CardImage.vue @@ -14,7 +14,7 @@ - mdi-silverware-variant + {{ $globals.icons.primary }} diff --git a/frontend/src/components/Recipe/ContextMenu.vue b/frontend/src/components/Recipe/ContextMenu.vue index c78b06847..a20dcf61b 100644 --- a/frontend/src/components/Recipe/ContextMenu.vue +++ b/frontend/src/components/Recipe/ContextMenu.vue @@ -75,13 +75,13 @@ export default { return [ { title: this.$t("general.delete"), - icon: "mdi-delete", + icon: this.$globals.icons.delete, color: "error", action: "delete", }, { title: this.$t("general.edit"), - icon: "mdi-square-edit-outline", + icon: "{{ $globals.icons.edit }}", color: "accent", action: "edit", }, diff --git a/frontend/src/components/Recipe/EditorButtonRow.vue b/frontend/src/components/Recipe/EditorButtonRow.vue index 6c043d156..54ac4a389 100644 --- a/frontend/src/components/Recipe/EditorButtonRow.vue +++ b/frontend/src/components/Recipe/EditorButtonRow.vue @@ -19,18 +19,18 @@
- mdi-delete + {{ $globals.icons.delete }} - mdi-content-save + {{ $globals.icons.save }} mdi-code-braces
- mdi-square-edit-outline + {{ $globals.icons.edit }} diff --git a/frontend/src/components/Recipe/MobileRecipeCard.vue b/frontend/src/components/Recipe/MobileRecipeCard.vue index a982d3d4e..f1941012c 100644 --- a/frontend/src/components/Recipe/MobileRecipeCard.vue +++ b/frontend/src/components/Recipe/MobileRecipeCard.vue @@ -9,7 +9,7 @@ @error="fallBackImage = true" > - mdi-silverware-variant + {{ $globals.icons.primary }} diff --git a/frontend/src/components/Recipe/Parts/Assets.vue b/frontend/src/components/Recipe/Parts/Assets.vue index 1abada0b0..dc0ec12de 100644 --- a/frontend/src/components/Recipe/Parts/Assets.vue +++ b/frontend/src/components/Recipe/Parts/Assets.vue @@ -19,7 +19,7 @@
- mdi-delete + {{ $globals.icons.delete }} mdi-content-copy @@ -34,7 +34,7 @@ diff --git a/frontend/src/components/Recipe/Parts/Helpers/ExtrasEditor.vue b/frontend/src/components/Recipe/Parts/Helpers/ExtrasEditor.vue index c0351e51d..2327ab304 100644 --- a/frontend/src/components/Recipe/Parts/Helpers/ExtrasEditor.vue +++ b/frontend/src/components/Recipe/Parts/Helpers/ExtrasEditor.vue @@ -12,7 +12,7 @@ - mdi-delete + {{ $globals.icons.delete }} diff --git a/frontend/src/components/Recipe/Parts/Ingredients.vue b/frontend/src/components/Recipe/Parts/Ingredients.vue index 463450242..9df5d5d68 100644 --- a/frontend/src/components/Recipe/Parts/Ingredients.vue +++ b/frontend/src/components/Recipe/Parts/Ingredients.vue @@ -20,7 +20,7 @@ mdi-arrow-up-down - mdi-delete + {{ $globals.icons.delete }} @@ -31,7 +31,7 @@
- mdi-plus + {{ $globals.icons.create }}
diff --git a/frontend/src/components/Recipe/Parts/Instructions.vue b/frontend/src/components/Recipe/Parts/Instructions.vue index ae6319617..0242bf13e 100644 --- a/frontend/src/components/Recipe/Parts/Instructions.vue +++ b/frontend/src/components/Recipe/Parts/Instructions.vue @@ -37,7 +37,7 @@ elevation="0" @click="removeByIndex(value, index)" > - mdi-delete + {{ $globals.icons.delete }} {{ $t("recipe.step-index", { step: index + 1 }) }} diff --git a/frontend/src/components/Recipe/Parts/Notes.vue b/frontend/src/components/Recipe/Parts/Notes.vue index 02be7ce3e..0c1eeb269 100644 --- a/frontend/src/components/Recipe/Parts/Notes.vue +++ b/frontend/src/components/Recipe/Parts/Notes.vue @@ -6,7 +6,7 @@ - mdi-delete + {{ $globals.icons.delete }} @@ -27,7 +27,7 @@
- mdi-plus + {{ $globals.icons.create }}
diff --git a/frontend/src/components/Recipe/RecipeEditor/index.vue b/frontend/src/components/Recipe/RecipeEditor/index.vue index bdc153ff8..6629ec742 100644 --- a/frontend/src/components/Recipe/RecipeEditor/index.vue +++ b/frontend/src/components/Recipe/RecipeEditor/index.vue @@ -69,7 +69,7 @@
- mdi-plus + {{ $globals.icons.create }}
diff --git a/frontend/src/components/UI/CardSection.vue b/frontend/src/components/UI/CardSection.vue index da98e3b6b..cf199b05a 100644 --- a/frontend/src/components/UI/CardSection.vue +++ b/frontend/src/components/UI/CardSection.vue @@ -120,7 +120,7 @@ export default { default: false, }, titleIcon: { - default: "mdi-tag-multiple-outline", + default: "{{ $globals.icons.tags }}-multiple-outline", }, title: { default: null, diff --git a/frontend/src/components/UI/Dialogs/BackupDialog.vue b/frontend/src/components/UI/Dialogs/BackupDialog.vue index 3bd3d0416..74aa645b1 100644 --- a/frontend/src/components/UI/Dialogs/BackupDialog.vue +++ b/frontend/src/components/UI/Dialogs/BackupDialog.vue @@ -9,7 +9,7 @@ > @@ -128,7 +128,6 @@ export default { templates: this.selectedTemplates, }; - if (await api.backups.create(data)) { this.$emit("created"); } diff --git a/frontend/src/components/UI/Dialogs/BaseDialog.vue b/frontend/src/components/UI/Dialogs/BaseDialog.vue index 7eae2236c..3d49d4fcc 100644 --- a/frontend/src/components/UI/Dialogs/BaseDialog.vue +++ b/frontend/src/components/UI/Dialogs/BaseDialog.vue @@ -55,7 +55,7 @@ export default { default: "Modal Title", }, titleIcon: { - default: "mdi-account", + default: () => this.$globals.icons.user, }, modalWidth: { default: "500", diff --git a/frontend/src/components/UI/Dialogs/NewCategoryTagDialog.vue b/frontend/src/components/UI/Dialogs/NewCategoryTagDialog.vue index fc64f342f..817991228 100644 --- a/frontend/src/components/UI/Dialogs/NewCategoryTagDialog.vue +++ b/frontend/src/components/UI/Dialogs/NewCategoryTagDialog.vue @@ -2,14 +2,14 @@
- mdi-plus + {{ $globals.icons.create }} - mdi-tag + {{ $globals.icons.tags }} diff --git a/frontend/src/components/UI/TheAppBar.vue b/frontend/src/components/UI/TheAppBar.vue index b3bc0f93a..582a6c23f 100644 --- a/frontend/src/components/UI/TheAppBar.vue +++ b/frontend/src/components/UI/TheAppBar.vue @@ -7,7 +7,7 @@ - mdi-silverware-variant + {{ $globals.icons.primary }} diff --git a/frontend/src/components/UI/TheRecipeFab.vue b/frontend/src/components/UI/TheRecipeFab.vue index e810e1325..2971d1bb4 100644 --- a/frontend/src/components/UI/TheRecipeFab.vue +++ b/frontend/src/components/UI/TheRecipeFab.vue @@ -50,14 +50,14 @@ mdi-link - mdi-square-edit-outline + {{ $globals.icons.edit }}
diff --git a/frontend/src/components/UI/TheSidebar.vue b/frontend/src/components/UI/TheSidebar.vue index 016f02964..efb7a26e0 100644 --- a/frontend/src/components/UI/TheSidebar.vue +++ b/frontend/src/components/UI/TheSidebar.vue @@ -117,14 +117,14 @@ export default { return pages.map(x => ({ title: x.name, to: `/pages/${x.slug}`, - icon: "mdi-tag", + icon: this.$globals.icons.tags, })); } else { const categories = this.$store.getters.getAllCategories; return categories.map(x => ({ title: x.name, to: `/recipes/category/${x.slug}`, - icon: "mdi-tag", + icon: this.$globals.icons.tags, })); } }, @@ -134,7 +134,7 @@ export default { settingsLinks() { return [ { - icon: "mdi-account", + icon: this.$globals.icons.user, to: "/admin/profile", title: this.$t("settings.profile"), }, @@ -158,7 +158,7 @@ export default { title: this.$t("settings.toolbox.toolbox"), }, { - icon: "mdi-account-group", + icon: this.$globals.icons.group, to: "/admin/manage-users", title: this.$t("user.manage-users"), }, diff --git a/frontend/src/components/UI/TheSiteMenu.vue b/frontend/src/components/UI/TheSiteMenu.vue index 1b4d41bc8..f24541f41 100644 --- a/frontend/src/components/UI/TheSiteMenu.vue +++ b/frontend/src/components/UI/TheSiteMenu.vue @@ -4,7 +4,7 @@ @@ -40,7 +40,7 @@ export default { items() { return [ { - icon: "mdi-account", + icon: this.$globals.icons.user, title: this.$t("user.login"), restricted: false, login: true, diff --git a/frontend/src/main.js b/frontend/src/main.js index 874b7ff19..1f53a7238 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -4,6 +4,7 @@ import vuetify from "./plugins/vuetify"; import store from "./store"; import VueRouter from "vue-router"; import { router } from "./routes"; +import { globals } from "@/utils/globals"; import i18n from "./i18n"; import "@mdi/font/css/materialdesignicons.css"; import "typeface-roboto/index.css"; @@ -11,6 +12,8 @@ import "typeface-roboto/index.css"; Vue.config.productionTip = false; Vue.use(VueRouter); +Vue.prototype.$globals = globals; + const vueApp = new Vue({ vuetify, store, diff --git a/frontend/src/pages/Admin/About/index.vue b/frontend/src/pages/Admin/About/index.vue index b410b3bfe..eabfcc7fb 100644 --- a/frontend/src/pages/Admin/About/index.vue +++ b/frontend/src/pages/Admin/About/index.vue @@ -9,7 +9,7 @@ - {{ property.icon || "mdi-account" }} + {{ property.icon || $globals.icons.user }} @@ -92,7 +92,7 @@ export default { }, { name: this.$t("about.default-group"), - icon: "mdi-account-group", + icon: this.$globals.icons.group, value: debugInfo.defaultGroup, }, ]; diff --git a/frontend/src/pages/Admin/Dashboard/BackupViewer.vue b/frontend/src/pages/Admin/Dashboard/BackupViewer.vue index 6ddc63330..63770f0f6 100644 --- a/frontend/src/pages/Admin/Dashboard/BackupViewer.vue +++ b/frontend/src/pages/Admin/Dashboard/BackupViewer.vue @@ -31,7 +31,7 @@ - mdi-plus {{ $t("general.create") }} + {{ $globals.icons.create }} {{ $t("general.create") }}