This commit is contained in:
wengtad 2021-06-18 11:45:22 +08:00 committed by GitHub
parent cdfb3543dc
commit 71a5de3432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

1
.gitignore vendored
View File

@ -55,6 +55,7 @@ eggs/
lib/ lib/
lib64/ lib64/
parts/ parts/
!frontend/src/components/Recipe/Parts/
sdist/ sdist/
var/ var/
wheels/ wheels/

View File

@ -25,9 +25,9 @@
</v-card-title> </v-card-title>
<v-card-text class="mt-n5"> <v-card-text class="mt-n5">
<div> <div>
<v-text-field :label="$t('general.url')" class="pt-5" clearable v-model="url"> <v-text-field :label="$t('general.url')" class="pt-5" clearable v-model="url" :messages="getMessages()">
<template v-slot:append-outer> <template v-slot:append-outer>
<v-btn class="ml-2" color="primary" @click="getImageFromURL" :loading="loading" :disabled="slug"> <v-btn class="ml-2" color="primary" @click="getImageFromURL" :loading="loading" :disabled="!slug">
{{ $t("general.get") }} {{ $t("general.get") }}
</v-btn> </v-btn>
</template> </template>
@ -66,6 +66,9 @@ export default {
} }
this.loading = false; this.loading = false;
}, },
getMessages() {
return this.slug ? [""] : [this.$i18n.t("recipe.save-recipe-before-use")];
},
}, },
}; };
</script> </script>

View File

@ -260,6 +260,7 @@
"recipe-updated": "Recipe updated", "recipe-updated": "Recipe updated",
"remove-from-favorites": "Remove from Favorites", "remove-from-favorites": "Remove from Favorites",
"remove-section": "Remove Section", "remove-section": "Remove Section",
"save-recipe-before-use": "Save recipe before use",
"section-title": "Section Title", "section-title": "Section Title",
"servings": "Servings", "servings": "Servings",
"share-recipe-message": "I wanted to share my {0} recipe with you.", "share-recipe-message": "I wanted to share my {0} recipe with you.",