import app view refactor

This commit is contained in:
Kaibu
2022-04-23 03:02:46 +02:00
parent 71a60a46be
commit 161ae9879a
4 changed files with 173 additions and 35 deletions

View File

@@ -1,7 +1,7 @@
// containing all data and functions regarding the different integrations
export const INTEGRATIONS = [
{id: 'DEFAULT', name: "Tandoor", import: true, export: true, help_url: 'https://docs.tandoor.dev/features/import_export/#default'},
{id: 'DEFAULT', name: "Tandoor", import: true, export: true, help_url: 'https://docs.tandoor.dev/features/import_export/#default', img_src: 'https://raw.githubusercontent.com/TandoorRecipes/recipes/develop/docs/logo_color.svg'},
{id: 'CHEFTAP', name: "Cheftap", import: true, export: false, help_url: 'https://docs.tandoor.dev/features/import_export/#cheftap'},
{id: 'CHOWDOWN', name: "Chowdown", import: true, export: false, help_url: 'https://docs.tandoor.dev/features/import_export/#chowdown'},
{id: 'COOKBOOKAPP', name: "CookBookApp", import: true, export: false, help_url: 'https://docs.tandoor.dev/features/import_export/#cookbookapp'},

View File

@@ -147,6 +147,45 @@ export class StandardToasts {
}
}
/*
* Utility function to get random food icon from fontawesome
* */
export const RandomIconMixin = {
name: "RandomIconMixin",
methods: {
getRandomFoodIcon: function () {
return getRandomFoodIcon()
},
},
}
export function getRandomFoodIcon() {
let icons = [
'fas fa-hamburger',
'fas fa-utensils',
'fas fa-apple-alt',
'fas fa-bacon',
'fas fa-bread-slice',
'fas fa-candy-cane',
'fas fa-carrot',
'fas fa-cheese',
'fas fa-cookie',
'fas fa-drumstick-bite',
'fas fa-egg',
'fas fa-fish',
'fas fa-hotdog',
'fas fa-ice-cream',
'fas fa-lemon',
'fas fa-pepper-hot',
'fas fa-pizza-slice',
'fas fa-cookie-bite'
]
return icons[Math.floor(Math.random() * icons.length)];
}
/*
* Utility functions to use djangos gettext
* */