feature/recipe-patch-improvements (#382)

* automated docs update

* recipe rating component

* recipe partial updates - closes #25

* use Vue.delete to update store

* format

* arrow functions

* fix tests

* format

* initial context menu

* localize

* add confirmation dialog

* context menu

* fix bare exception

* update line length

* format all file with prettier

* update changelog

* download as json

* update python dependencies

* update javascript dependencies

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden
2021-05-01 20:46:02 -08:00
committed by GitHub
parent c196445e61
commit be378cb20c
121 changed files with 18942 additions and 4765 deletions

View File

@@ -2,7 +2,7 @@
<div>
<v-card class="mt-3">
<v-card-title class="headline">
{{$t('about.about-mealie')}}
{{ $t("about.about-mealie") }}
</v-card-title>
<v-divider></v-divider>
<v-card-text>
@@ -22,14 +22,8 @@
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<TheDownloadBtn
:button-text="$t('about.download-recipe-json')"
download-url="/api/debug/last-recipe-json"
/>
<TheDownloadBtn
:button-text="$t('about.download-log')"
download-url="/api/debug/log"
/>
<TheDownloadBtn :button-text="$t('about.download-recipe-json')" download-url="/api/debug/last-recipe-json" />
<TheDownloadBtn :button-text="$t('about.download-log')" download-url="/api/debug/log" />
</v-card-actions>
<v-divider></v-divider>
</v-card>
@@ -55,42 +49,42 @@ export default {
this.prettyInfo = [
{
name: this.$t('about.version'),
name: this.$t("about.version"),
icon: "mdi-information",
value: debugInfo.version,
},
{
name: this.$t('about.application-mode'),
name: this.$t("about.application-mode"),
icon: "mdi-dev-to",
value: debugInfo.production ? this.$t('about.production') : this.$t('about.development'),
value: debugInfo.production ? this.$t("about.production") : this.$t("about.development"),
},
{
name: this.$t('about.demo-status'),
name: this.$t("about.demo-status"),
icon: "mdi-test-tube",
value: debugInfo.demoStatus ? this.$t('about.demo') : this.$t('about.not-demo'),
value: debugInfo.demoStatus ? this.$t("about.demo") : this.$t("about.not-demo"),
},
{
name: this.$t('about.api-port'),
name: this.$t("about.api-port"),
icon: "mdi-api",
value: debugInfo.apiPort,
},
{
name: this.$t('about.api-docs'),
name: this.$t("about.api-docs"),
icon: "mdi-file-document",
value: debugInfo.apiDocs ? this.$t('general.enabled') : this.$t('general.disabled'),
value: debugInfo.apiDocs ? this.$t("general.enabled") : this.$t("general.disabled"),
},
{
name: this.$t('about.database-type'),
name: this.$t("about.database-type"),
icon: "mdi-database",
value: debugInfo.dbType,
},
{
name: this.$t('about.sqlite-file'),
name: this.$t("about.sqlite-file"),
icon: "mdi-file-cabinet",
value: debugInfo.sqliteFile,
},
{
name: this.$t('about.default-group'),
name: this.$t("about.default-group"),
icon: "mdi-account-group",
value: debugInfo.defaultGroup,
},
@@ -100,5 +94,4 @@ export default {
};
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>

View File

@@ -8,15 +8,7 @@
@delete="deleteBackup"
/>
<v-row>
<v-col
:cols="12"
:sm="6"
:md="6"
:lg="4"
:xl="4"
v-for="backup in backups"
:key="backup.name"
>
<v-col :cols="12" :sm="6" :md="6" :lg="4" :xl="4" v-for="backup in backups" :key="backup.name">
<v-card hover outlined @click="openDialog(backup)">
<v-card-text>
<v-row align="center">
@@ -63,13 +55,12 @@ export default {
async importBackup(data) {
this.$emit("loading");
const response = await api.backups.import(data.name, data);
if(response) {
if (response) {
let importData = response.data;
this.$emit("finished", importData);
} else {
this.$emit("finished");
}
},
async deleteBackup(data) {
this.$emit("loading");
@@ -85,5 +76,4 @@ export default {
};
</script>
<style>
</style>
<style></style>

View File

@@ -1,10 +1,6 @@
<template>
<div class="text-center">
<v-dialog
v-model="dialog"
width="500"
:fullscreen="$vuetify.breakpoint.xsOnly"
>
<v-dialog v-model="dialog" width="500" :fullscreen="$vuetify.breakpoint.xsOnly">
<v-card>
<v-toolbar dark color="primary" v-show="$vuetify.breakpoint.xsOnly">
<v-btn icon dark @click="dialog = false">
@@ -42,12 +38,7 @@
<v-btn color="error" text @click="raiseEvent('delete')">
{{ $t("general.delete") }}
</v-btn>
<v-btn
color="success"
outlined
@click="raiseEvent('import')"
v-show="$vuetify.breakpoint.smAndUp"
>
<v-btn color="success" outlined @click="raiseEvent('import')" v-show="$vuetify.breakpoint.smAndUp">
{{ $t("general.import") }}
</v-btn>
</v-card-actions>
@@ -56,7 +47,6 @@
</div>
</template>
<script>
import ImportOptions from "./ImportOptions";
import TheDownloadBtn from "@/components/UI/Buttons/TheDownloadBtn.vue";
@@ -119,5 +109,4 @@ export default {
};
</script>
<style>
</style>
<style></style>

View File

@@ -63,5 +63,4 @@ export default {
};
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>

View File

@@ -2,11 +2,7 @@
<v-card :loading="loading">
<v-card-title> {{ $t("settings.backup.create-heading") }} </v-card-title>
<v-card-text class="mt-n3">
<v-text-field
dense
:label="$t('settings.backup.backup-tag')"
v-model="tag"
></v-text-field>
<v-text-field dense :label="$t('settings.backup.backup-tag')" v-model="tag"></v-text-field>
</v-card-text>
<v-card-actions class="mt-n9 flex-wrap">
<v-switch v-model="fullBackup" :label="switchLabel"></v-switch>
@@ -101,7 +97,6 @@ export default {
this.$emit("created");
}
this.loading = false;
},
appendTemplate(templateName) {
if (this.selectedTemplates.includes(templateName)) {
@@ -115,5 +110,4 @@ export default {
};
</script>
<style>
</style>
<style></style>

View File

@@ -20,19 +20,11 @@
<v-card-title class="mt-n6">
{{ $t("settings.available-backups") }}
<span>
<TheUploadBtn
class="mt-1"
url="/api/backups/upload"
@uploaded="getAvailableBackups"
/>
<TheUploadBtn class="mt-1" url="/api/backups/upload" @uploaded="getAvailableBackups" />
</span>
<v-spacer></v-spacer>
</v-card-title>
<AvailableBackupCard
@loading="backupLoading = true"
@finished="processFinished"
:backups="availableBackups"
/>
<AvailableBackupCard @loading="backupLoading = true" @finished="processFinished" :backups="availableBackups" />
<ImportSummaryDialog ref="report" :import-data="importData" />
</v-card-text>
@@ -80,5 +72,4 @@ export default {
};
</script>
<style>
</style>
<style></style>

View File

@@ -17,9 +17,7 @@
<v-list dense>
<v-card-title class="py-1">{{ group.name }}</v-card-title>
<v-divider></v-divider>
<v-subheader>{{
$t("group.group-id-with-value", { groupID: group.id })
}}</v-subheader>
<v-subheader>{{ $t("group.group-id-with-value", { groupID: group.id }) }}</v-subheader>
<v-list-item-group color="primary">
<v-list-item v-for="property in groupProps" :key="property.text">
<v-list-item-icon>
@@ -36,12 +34,7 @@
</v-list>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
small
color="error"
@click="confirmDelete"
:disabled="ableToDelete"
>
<v-btn small color="error" @click="confirmDelete" :disabled="ableToDelete">
{{ $t("general.delete") }}
</v-btn>
<!-- Coming Soon! -->
@@ -113,9 +106,7 @@ export default {
{
text: this.$t("user.webhooks-enabled"),
icon: "mdi-webhook",
value: this.group.webhookEnable
? this.$t("general.yes")
: this.$t("general.no"),
value: this.group.webhookEnable ? this.$t("general.yes") : this.$t("general.no"),
},
{
text: this.$t("user.webhook-time"),
@@ -128,5 +119,4 @@ export default {
};
</script>
<style scoped>
</style>
<style scoped></style>

View File

@@ -16,14 +16,7 @@
</div>
<v-dialog v-model="groupDialog" max-width="400">
<template v-slot:activator="{ on, attrs }">
<v-btn
class="mx-2"
small
color="success"
dark
v-bind="attrs"
v-on="on"
>
<v-btn class="mx-2" small color="success" dark v-bind="attrs" v-on="on">
{{ $t("group.create-group") }}
</v-btn>
</template>
@@ -63,18 +56,8 @@
</v-card-actions>
<v-card-text>
<v-row>
<v-col
:sm="6"
:md="6"
:lg="4"
:xl="3"
v-for="group in groups"
:key="group.id"
>
<GroupCard
:group="group"
@update="$store.dispatch('requestAllGroups')"
/>
<v-col :sm="6" :md="6" :lg="4" :xl="3" v-for="group in groups" :key="group.id">
<GroupCard :group="group" @update="$store.dispatch('requestAllGroups')" />
</v-col>
</v-row>
</v-card-text>
@@ -114,5 +97,4 @@ export default {
};
</script>
<style>
</style>
<style></style>

View File

@@ -48,10 +48,7 @@
:rules="[existsRule]"
validate-on-blur
></v-text-field>
<v-checkbox
v-model="editedItem.admin"
:label="$t('user.admin')"
></v-checkbox>
<v-checkbox v-model="editedItem.admin" :label="$t('user.admin')"></v-checkbox>
</v-card-text>
<v-card-actions>
@@ -73,13 +70,7 @@
<v-data-table :headers="headers" :items="links" sort-by="calories">
<template v-slot:item.token="{ item }">
{{ `${baseURL}/sign-up/${item.token}` }}
<v-btn
icon
class="mr-1"
small
color="accent"
@click="updateClipboard(`${baseURL}/sign-up/${item.token}`)"
>
<v-btn icon class="mr-1" small color="accent" @click="updateClipboard(`${baseURL}/sign-up/${item.token}`)">
<v-icon>
mdi-content-copy
</v-icon>
@@ -239,5 +230,4 @@ export default {
};
</script>
<style>
</style>
<style></style>

View File

@@ -84,17 +84,14 @@
></v-text-field>
</v-col>
<v-col cols="12" sm="12" md="3">
<v-switch
v-model="editedItem.admin"
:label="$t('user.admin')"
></v-switch>
<v-switch v-model="editedItem.admin" :label="$t('user.admin')"></v-switch>
</v-col>
</v-row>
</v-card-text>
<v-card-actions>
<v-btn color="info" text @click="resetPassword" v-if="!createMode">
{{$t('user.reset-password')}}
{{ $t("user.reset-password") }}
</v-btn>
<v-spacer></v-spacer>
<v-btn color="grey" text @click="close">
@@ -110,12 +107,7 @@
</v-toolbar>
<v-divider></v-divider>
<v-card-text>
<v-data-table
:headers="headers"
:items="users"
sort-by="calories"
:search="search"
>
<v-data-table :headers="headers" :items="users" sort-by="calories" :search="search">
<template v-slot:item.actions="{ item }">
<v-btn class="mr-1" small color="error" @click="deleteItem(item)">
<v-icon small left>
@@ -192,9 +184,7 @@ export default {
computed: {
formTitle() {
return this.createMode
? this.$t("user.new-user")
: this.$t("user.edit-user");
return this.createMode ? this.$t("user.new-user") : this.$t("user.edit-user");
},
createMode() {
return this.editedIndex === -1 ? true : false;
@@ -274,21 +264,20 @@ export default {
resetPassword() {
api.users.resetPassword(this.editedItem.id);
},
async createUser() {
if(await api.users.create(this.editedItem)) {
if (await api.users.create(this.editedItem)) {
this.close();
}
},
async updateUser() {
if(await api.users.update(this.editedItem)) {
if (await api.users.update(this.editedItem)) {
this.close();
}
}
},
},
};
</script>
<style>
</style>
<style></style>

View File

@@ -1,13 +1,7 @@
<template>
<div>
<v-card flat>
<v-tabs
v-model="tab"
background-color="primary"
centered
dark
icons-and-text
>
<v-tabs v-model="tab" background-color="primary" centered dark icons-and-text>
<v-tabs-slider></v-tabs-slider>
<v-tab>
@@ -58,5 +52,4 @@ export default {
};
</script>
<style>
</style>
<style></style>

View File

@@ -14,11 +14,7 @@
v-model="groupSettings.categories"
:return-object="true"
:show-add="true"
:hint="
$t(
'meal-plan.only-recipes-with-these-categories-will-be-used-in-meal-plans'
)
"
:hint="$t('meal-plan.only-recipes-with-these-categories-will-be-used-in-meal-plans')"
/>
</v-card-text>
<v-divider> </v-divider>
@@ -36,11 +32,7 @@
</p>
<v-row dense class="flex align-center">
<v-switch
class="mx-2"
v-model="groupSettings.webhookEnable"
:label="$t('general.enabled')"
></v-switch>
<v-switch class="mx-2" v-model="groupSettings.webhookEnable" :label="$t('general.enabled')"></v-switch>
<TimePickerDialog @save-time="saveTime" class="ma-2" />
<v-btn class="ma-2" color="info" @click="testWebhooks">
<v-icon left> mdi-webhook </v-icon>
@@ -48,12 +40,7 @@
</v-btn>
</v-row>
<v-row
v-for="(url, index) in groupSettings.webhookUrls"
:key="index"
align=" center"
dense
>
<v-row v-for="(url, index) in groupSettings.webhookUrls" :key="index" align=" center" dense>
<v-col cols="1">
<v-btn icon color="error" @click="removeWebhook(index)">
<v-icon>mdi-minus</v-icon>
@@ -147,5 +134,4 @@ export default {
};
</script>
<style>
</style>
<style></style>

View File

@@ -16,12 +16,7 @@
</v-card-title>
<v-card-text> {{ description }}</v-card-text>
<div v-if="available[0]">
<v-card
outlined
v-for="migration in available"
:key="migration.name"
class="ma-2"
>
<v-card outlined v-for="migration in available" :key="migration.name" class="ma-2">
<v-card-text>
<v-row align="center">
<v-col cols="2">
@@ -42,13 +37,7 @@
<v-btn color="error" text @click="deleteMigration(migration.name)">
{{ $t("general.delete") }}
</v-btn>
<v-btn
color="accent"
text
@click="importMigration(migration.name)"
:loading="loading"
:disabled="loading"
>
<v-btn color="accent" text @click="importMigration(migration.name)" :loading="loading" :disabled="loading">
{{ $t("general.import") }}
</v-btn>
</v-card-actions>
@@ -102,5 +91,4 @@ export default {
};
</script>
<style>
</style>
<style></style>

View File

@@ -1,5 +1,3 @@
<template>
<div class="text-center">
<v-dialog v-model="dialog" width="70%">
@@ -105,5 +103,4 @@ export default {
};
</script>
<style>
</style>
<style></style>

View File

@@ -8,15 +8,7 @@
<v-card-text>
<v-row dense>
<v-col
:cols="12"
:sm="6"
:md="6"
:lg="4"
:xl="3"
v-for="migration in migrations"
:key="migration.title"
>
<v-col :cols="12" :sm="6" :md="6" :lg="4" :xl="3" v-for="migration in migrations" :key="migration.title">
<MigrationCard
:title="migration.title"
:folder="migration.urlVariable"
@@ -32,7 +24,6 @@
</div>
</template>
<script>
import MigrationCard from "./MigrationCard";
import { api } from "@/api";
@@ -88,5 +79,4 @@ export default {
};
</script>
<style>
</style>
<style></style>

View File

@@ -4,14 +4,7 @@
<v-card>
<v-card-title class="headline">
<span>
<v-progress-circular
v-if="loading"
indeterminate
color="primary"
large
class="mr-2"
>
</v-progress-circular>
<v-progress-circular v-if="loading" indeterminate color="primary" large class="mr-2"> </v-progress-circular>
</span>
{{ $t("settings.profile") }}
<v-spacer></v-spacer>
@@ -21,16 +14,8 @@
<v-card-text>
<v-row>
<v-col cols="12" md="3" align="center" justify="center">
<v-avatar
color="accent"
size="120"
class="white--text headline mr-2"
>
<img
:src="userProfileImage"
v-if="!hideImage"
@error="hideImage = true"
/>
<v-avatar color="accent" size="120" class="white--text headline mr-2">
<img :src="userProfileImage" v-if="!hideImage" @error="hideImage = true" />
<div v-else>
{{ initials }}
</div>
@@ -113,10 +98,7 @@
v-model="password.newTwo"
prepend-icon="mdi-lock"
:label="$t('user.confirm-password')"
:rules="[
password.newOne === password.newTwo ||
$t('user.password-must-match'),
]"
:rules="[password.newOne === password.newTwo || $t('user.password-must-match')]"
validate-on-blur
:type="showPassword ? 'text' : 'password'"
@click:append="showPassword.newTwo = !showPassword.newTwo"
@@ -124,11 +106,7 @@
</v-form>
</v-card-text>
<v-card-actions>
<v-btn
icon
@click="showPassword = !showPassword"
:loading="passwordLoading"
>
<v-btn icon @click="showPassword = !showPassword" :loading="passwordLoading">
<v-icon v-if="!showPassword">mdi-eye-off</v-icon>
<v-icon v-else> mdi-eye </v-icon>
</v-btn>
@@ -202,7 +180,7 @@ export default {
async updateUser() {
this.loading = true;
const response = await api.users.update(this.user);
if(response) {
if (response) {
this.$store.commit("setToken", response.data.access_token);
this.refreshProfile();
this.loading = false;
@@ -227,5 +205,4 @@ export default {
};
</script>
<style>
</style>
<style></style>

View File

@@ -14,11 +14,7 @@
</v-app-bar>
<v-form ref="newGroup" @submit.prevent="submitForm">
<v-card-text>
<v-text-field
autofocus
v-model="page.name"
:label="$t('settings.page-name')"
></v-text-field>
<v-text-field autofocus v-model="page.name" :label="$t('settings.page-name')"></v-text-field>
<CategoryTagSelector
v-model="page.categories"
ref="categoryFormSelector"
@@ -88,7 +84,7 @@ export default {
} else {
response = await api.siteSettings.updatePage(this.page);
}
if (response) {
this.pageDialog = false;
this.page.categories = [];
@@ -99,5 +95,4 @@ export default {
};
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>

View File

@@ -3,22 +3,15 @@
<CreatePageDialog ref="createDialog" @refresh-page="getPages" />
<v-card-text>
<h2 class="mt-1 mb-1 ">
{{$t('settings.custom-pages')}}
{{ $t("settings.custom-pages") }}
<span>
<v-btn color="success" @click="newPage" small class="ml-3">
{{$t('general.create')}}
{{ $t("general.create") }}
</v-btn>
</span>
</h2>
<draggable class="row mt-1" v-model="customPages">
<v-col
:sm="6"
:md="6"
:lg="4"
:xl="3"
v-for="(item, index) in customPages"
:key="item + item.id"
>
<v-col :sm="6" :md="6" :lg="4" :xl="3" v-for="(item, index) in customPages" :key="item + item.id">
<v-card>
<v-card-text class="mb-0 pb-0">
<h3>{{ item.name }}</h3>
@@ -41,11 +34,11 @@
<v-card-actions>
<v-btn text small color="error" @click="deletePage(item.id)">
{{$t('general.delete')}}
{{ $t("general.delete") }}
</v-btn>
<v-spacer> </v-spacer>
<v-btn small text color="success" @click="editPage(index)">
{{$t('general.edit')}}
{{ $t("general.edit") }}
</v-btn>
</v-card-actions>
</v-card>
@@ -55,7 +48,7 @@
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="success" @click="savePages">
{{$t('general.save')}}
{{ $t("general.save") }}
</v-btn>
</v-card-actions>
</v-card>
@@ -76,8 +69,8 @@ export default {
customPages: [],
newPageData: {
create: true,
title: this.$t('settings.new-page'),
buttonText: this.$t('general.create'),
title: this.$t("settings.new-page"),
buttonText: this.$t("general.create"),
data: {
name: "",
categories: [],
@@ -86,8 +79,8 @@ export default {
},
editPageData: {
create: false,
title: this.$t('settings.edit-page'),
buttonText: this.$t('general.update'),
title: this.$t("settings.edit-page"),
buttonText: this.$t("general.update"),
data: {},
},
};
@@ -112,7 +105,6 @@ export default {
if (await api.siteSettings.updateAllPages(this.customPages)) {
this.getPages();
}
},
editPage(index) {
this.editPageData.data = this.customPages[index];
@@ -126,5 +118,4 @@ export default {
};
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>

View File

@@ -4,10 +4,7 @@
<h2 class="mt-1 mb-1">{{ $t("settings.homepage.home-page") }}</h2>
<v-row align="center" justify="center" dense class="mb-n7 pb-n5">
<v-col cols="12" sm="3" md="2">
<v-switch
v-model="settings.showRecent"
:label="$t('settings.homepage.show-recent')"
></v-switch>
<v-switch v-model="settings.showRecent" :label="$t('settings.homepage.show-recent')"></v-switch>
</v-col>
<v-col cols="12" sm="5" md="5">
<v-slider
@@ -49,10 +46,7 @@
minHeight: `150px`,
}"
>
<v-list-item
v-for="(item, index) in settings.categories"
:key="`${item.name}-${index}`"
>
<v-list-item v-for="(item, index) in settings.categories" :key="`${item.name}-${index}`">
<v-list-item-icon>
<v-icon>mdi-menu</v-icon>
</v-list-item-icon>
@@ -92,10 +86,7 @@
minHeight: `150px`,
}"
>
<v-list-item
v-for="(item, index) in allCategories"
:key="`${item.name}-${index}`"
>
<v-list-item v-for="(item, index) in allCategories" :key="`${item.name}-${index}`">
<v-list-item-icon>
<v-icon>mdi-menu</v-icon>
</v-list-item-icon>
@@ -103,9 +94,7 @@
<v-list-item-content>
<v-list-item-title v-text="item.name"></v-list-item-title>
</v-list-item-content>
<v-list-item-icon
@click="deleteCategoryfromDatabase(item.slug)"
>
<v-list-item-icon @click="deleteCategoryfromDatabase(item.slug)">
<v-icon>mdi-delete</v-icon>
</v-list-item-icon>
</v-list-item>
@@ -214,7 +203,7 @@ export default {
this.settings.language = val;
},
deleteCategoryfromDatabase(category) {
api.categories.delete(category);
api.categories.delete(category);
},
async getOptions() {
this.settings = await api.siteSettings.get();
@@ -225,11 +214,10 @@ export default {
async saveSettings() {
if (await api.siteSettings.update(this.settings)) {
this.getOptions();
}
}
},
},
};
</script>
<style>
</style>
<style></style>

View File

@@ -31,5 +31,4 @@ export default {
};
</script>
<style>
</style>
<style></style>

View File

@@ -51,8 +51,7 @@ export default {
dialog: false,
themeName: "",
rules: {
required: val =>
!!val || this.$t("settings.theme.theme-name-is-required"),
required: val => !!val || this.$t("settings.theme.theme-name-is-required"),
},
};
},
@@ -87,5 +86,4 @@ export default {
};
</script>
<style>
</style>
<style></style>

View File

@@ -35,9 +35,7 @@
</v-btn>
<v-spacer></v-spacer>
<!-- <v-btn text color="accent" @click="editTheme">Edit</v-btn> -->
<v-btn text color="success" @click="saveThemes">{{
$t("general.apply")
}}</v-btn>
<v-btn text color="success" @click="saveThemes">{{ $t("general.apply") }}</v-btn>
</v-card-actions>
</v-card>
</div>
@@ -87,5 +85,4 @@ export default {
};
</script>
<style>
</style>
<style></style>

View File

@@ -15,12 +15,7 @@
</p>
<v-row dense align="center">
<v-col cols="6">
<v-btn-toggle
v-model="selectedDarkMode"
color="primary "
mandatory
@change="setStoresDarkMode"
>
<v-btn-toggle v-model="selectedDarkMode" color="primary " mandatory @change="setStoresDarkMode">
<v-btn value="system">
<v-icon>mdi-desktop-tower-monitor</v-icon>
<span class="ml-1" v-show="$vuetify.breakpoint.smAndUp">
@@ -58,66 +53,33 @@
<v-row dense align-content="center" v-if="selectedTheme.colors">
<v-col>
<ColorPickerDialog
:button-text="$t('settings.theme.primary')"
v-model="selectedTheme.colors.primary"
/>
<ColorPickerDialog :button-text="$t('settings.theme.primary')" v-model="selectedTheme.colors.primary" />
</v-col>
<v-col>
<ColorPickerDialog
:button-text="$t('settings.theme.secondary')"
v-model="selectedTheme.colors.secondary"
/>
<ColorPickerDialog :button-text="$t('settings.theme.secondary')" v-model="selectedTheme.colors.secondary" />
</v-col>
<v-col>
<ColorPickerDialog
:button-text="$t('settings.theme.accent')"
v-model="selectedTheme.colors.accent"
/>
<ColorPickerDialog :button-text="$t('settings.theme.accent')" v-model="selectedTheme.colors.accent" />
</v-col>
<v-col>
<ColorPickerDialog
:button-text="$t('settings.theme.success')"
v-model="selectedTheme.colors.success"
/>
<ColorPickerDialog :button-text="$t('settings.theme.success')" v-model="selectedTheme.colors.success" />
</v-col>
<v-col>
<ColorPickerDialog
:button-text="$t('settings.theme.info')"
v-model="selectedTheme.colors.info"
/>
<ColorPickerDialog :button-text="$t('settings.theme.info')" v-model="selectedTheme.colors.info" />
</v-col>
<v-col>
<ColorPickerDialog
:button-text="$t('settings.theme.warning')"
v-model="selectedTheme.colors.warning"
/>
<ColorPickerDialog :button-text="$t('settings.theme.warning')" v-model="selectedTheme.colors.warning" />
</v-col>
<v-col>
<ColorPickerDialog
:button-text="$t('settings.theme.error')"
v-model="selectedTheme.colors.error"
/>
<ColorPickerDialog :button-text="$t('settings.theme.error')" v-model="selectedTheme.colors.error" />
</v-col>
</v-row>
</v-card-text>
<v-card-text>
<v-row>
<v-col
cols="12"
sm="12"
md="6"
lg="4"
xl="3"
v-for="theme in availableThemes"
:key="theme.name"
>
<ThemeCard
:theme="theme"
:current="selectedTheme.name == theme.name ? true : false"
@delete="getAllThemes"
/>
<v-col cols="12" sm="12" md="6" lg="4" xl="3" v-for="theme in availableThemes" :key="theme.name">
<ThemeCard :theme="theme" :current="selectedTheme.name == theme.name ? true : false" @delete="getAllThemes" />
</v-col>
</v-row>
</v-card-text>
@@ -184,15 +146,10 @@ export default {
* This will save the current colors and make the selected theme live.
*/
saveThemes() {
api.themes.update(
this.selectedTheme.name,
this.selectedTheme.colors
);
api.themes.update(this.selectedTheme.name, this.selectedTheme.colors);
},
},
};
</script>
<style>
</style>
<style></style>

View File

@@ -10,33 +10,16 @@
:top="true"
>
<v-card-text>
<v-text-field
v-model="search"
autocomplete="off"
:label="$t('general.keyword')"
></v-text-field>
<CategoryTagSelector
:tag-selector="false"
v-model="catsToAssign"
:return-object="false"
/>
<CategoryTagSelector
:tag-selector="true"
v-model="tagsToAssign"
:return-object="false"
/>
<v-text-field v-model="search" autocomplete="off" :label="$t('general.keyword')"></v-text-field>
<CategoryTagSelector :tag-selector="false" v-model="catsToAssign" :return-object="false" />
<CategoryTagSelector :tag-selector="true" v-model="tagsToAssign" :return-object="false" />
</v-card-text>
<template slot="card-actions">
<v-btn text color="grey" @click="closeDialog">
{{ $t("general.cancel") }}
</v-btn>
<v-spacer></v-spacer>
<v-btn
color="success"
@click="assignAll"
:loading="loading"
:disabled="results.length < 1"
>
<v-btn color="success" @click="assignAll" :loading="loading" :disabled="results.length < 1">
{{ $t("settings.toolbox.assign-all") }}
</v-btn>
</template>
@@ -122,9 +105,7 @@ export default {
assignAll() {
this.loading = true;
this.results.forEach(async element => {
element.recipeCategory = element.recipeCategory.concat(
this.catsToAssign
);
element.recipeCategory = element.recipeCategory.concat(this.catsToAssign);
element.tags = element.tags.concat(this.tagsToAssign);
await api.recipes.patch(element);
});
@@ -154,9 +135,7 @@ export default {
return [];
}
return this.allRecipes.filter(x => {
return (
this.checkForKeywords(x.name) || this.checkForKeywords(x.description)
);
return this.checkForKeywords(x.name) || this.checkForKeywords(x.description);
});
},
checkForKeywords(str) {
@@ -167,5 +146,4 @@ export default {
};
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>

View File

@@ -4,11 +4,7 @@
ref="deleteDialog"
title-icon="mdi-tag"
color="error"
:title="
$t('general.delete') +
' ' +
(isTags ? $t('tag.tags') : $t('recipe.categories'))
"
:title="$t('general.delete') + ' ' + (isTags ? $t('tag.tags') : $t('recipe.categories'))"
:loading="loading"
modal-width="400"
>
@@ -27,12 +23,7 @@
{{ $t("general.cancel") }}
</v-btn>
<v-spacer></v-spacer>
<v-btn
color="error"
@click="deleteUnused"
:loading="loading"
:disabled="deleteList.length < 1"
>
<v-btn color="error" @click="deleteUnused" :loading="loading" :disabled="deleteList.length < 1">
{{ $t("general.delete") }}
</v-btn>
</template>
@@ -95,5 +86,4 @@ export default {
};
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>

View File

@@ -43,24 +43,14 @@
<BulkAssign isTags="isTags" class="mr-1 mb-1" />
<v-btn
@click="titleCaseAll"
small
color="success"
class="mr-1 mb-1"
:loading="loadingTitleCase"
>
<v-btn @click="titleCaseAll" small color="success" class="mr-1 mb-1" :loading="loadingTitleCase">
{{ $t("settings.toolbox.title-case-all") }}
</v-btn>
<RemoveUnused :isTags="isTags" class="mb-1" />
<v-spacer v-if="!isMobile"> </v-spacer>
<fuse-search-bar
:raw-data="allItems"
@results="filterItems"
:search="searchString"
>
<fuse-search-bar :raw-data="allItems" @results="filterItems" :search="searchString">
<v-text-field
v-model="searchString"
clearable
@@ -79,24 +69,16 @@
<v-card-text>
<v-row>
<v-col
cols="12"
:sm="12"
:md="6"
:lg="4"
:xl="3"
v-for="item in results"
:key="item.id"
>
<v-col cols="12" :sm="12" :md="6" :lg="4" :xl="3" v-for="item in results" :key="item.id">
<v-card>
<v-card-actions>
<v-card-title class="py-1">{{ item.name }}</v-card-title>
<v-spacer></v-spacer>
<v-btn small text color="info" @click="openEditDialog(item)">
{{$t('general.edit')}}
{{ $t("general.edit") }}
</v-btn>
<v-btn small text color="error" @click="deleteItem(item.slug)">
{{$t('general.delete')}}
{{ $t("general.delete") }}
</v-btn>
</v-card-actions>
</v-card>
@@ -149,9 +131,7 @@ export default {
return this.$vuetify.breakpoint.name === "xs";
},
allItems() {
return this.isTags
? this.$store.getters.getAllTags
: this.$store.getters.getAllCategories;
return this.isTags ? this.$store.getters.getAllTags : this.$store.getters.getAllCategories;
},
results() {
if (this.searchString != null && this.searchString.length >= 1) {
@@ -176,7 +156,7 @@ export default {
}
this.renameTarget = {
title:this.$t('general.rename-object', [item.name]),
title: this.$t("general.rename-object", [item.name]),
name: item.name,
slug: item.slug,
newName: "",
@@ -240,4 +220,4 @@ export default {
height: auto !important;
flex-wrap: wrap;
}
</style>
</style>

View File

@@ -1,13 +1,7 @@
<template>
<div>
<v-card flat>
<v-tabs
v-model="tab"
background-color="primary"
centered
dark
icons-and-text
>
<v-tabs v-model="tab" background-color="primary" centered dark icons-and-text>
<v-tabs-slider></v-tabs-slider>
<v-tab>
@@ -43,5 +37,4 @@ export default {
};
</script>
<style>
</style>
<style></style>

View File

@@ -12,5 +12,4 @@
export default {};
</script>
<style>
</style>
<style></style>