improved source url field rendering

This commit is contained in:
vabene1111
2022-04-22 21:13:00 +02:00
parent 4ecf77f431
commit 6953f763d2
4 changed files with 60 additions and 8 deletions

View File

@ -645,7 +645,7 @@ class RecipeSerializer(RecipeBaseSerializer):
model = Recipe
fields = (
'id', 'name', 'description', 'image', 'keywords', 'steps', 'working_time',
'waiting_time', 'created_by', 'created_at', 'updated_at',
'waiting_time', 'created_by', 'created_at', 'updated_at','source_url',
'internal', 'nutrition', 'servings', 'file_path', 'servings_text', 'rating', 'last_cooked',
)
read_only_fields = ['image', 'created_by', 'created_at']

View File

@ -139,8 +139,10 @@
></step-component>
</div>
<h5 class="d-print-none"><i class="fas fa-file-import"></i> {{ $t("Imported_From") }}</h5>
<span class="text-muted mt-1"><a :href="recipe.source_url">{{ recipe.source_url }}</a></span>
<div v-if="recipe.source_url !== null">
<h6 class="d-print-none"><i class="fas fa-file-import"></i> {{ $t("Imported_From") }}</h6>
<span class="text-muted mt-1"><a :href="recipe.source_url">{{ recipe.source_url }}</a></span>
</div>
</div>
<add-recipe-to-book :recipe="recipe"></add-recipe-to-book>

View File

@ -359,6 +359,7 @@
"last_viewed": "Last Viewed",
"created_on": "Created On",
"updatedon": "Updated On",
"Imported_From": "Imported from",
"advanced_search_settings": "Advanced Search Settings",
"nothing_planned_today": "You have nothing planned for today!",
"no_pinned_recipes": "You have no pinned recipes!",

View File

@ -130,6 +130,37 @@ export interface BookmarkletImport {
*/
created_at?: string;
}
/**
*
* @export
* @interface BookmarkletImportList
*/
export interface BookmarkletImportList {
/**
*
* @type {number}
* @memberof BookmarkletImportList
*/
id?: number;
/**
*
* @type {string}
* @memberof BookmarkletImportList
*/
url?: string | null;
/**
*
* @type {string}
* @memberof BookmarkletImportList
*/
created_by?: string;
/**
*
* @type {string}
* @memberof BookmarkletImportList
*/
created_at?: string;
}
/**
*
* @export
@ -472,7 +503,7 @@ export interface FoodRecipe {
* @type {string}
* @memberof FoodRecipe
*/
name?: string;
name: string;
/**
*
* @type {string}
@ -537,7 +568,7 @@ export interface FoodSubstitute {
* @type {string}
* @memberof FoodSubstitute
*/
name?: string;
name: string;
}
/**
*
@ -752,6 +783,12 @@ export interface Ingredient {
* @memberof Ingredient
*/
original_text?: string | null;
/**
*
* @type {string}
* @memberof Ingredient
*/
used_in_recipes?: string;
}
/**
*
@ -1653,6 +1690,12 @@ export interface Recipe {
* @memberof Recipe
*/
updated_at?: string;
/**
*
* @type {string}
* @memberof Recipe
*/
source_url?: string | null;
/**
*
* @type {boolean}
@ -1923,6 +1966,12 @@ export interface RecipeIngredients {
* @memberof RecipeIngredients
*/
original_text?: string | null;
/**
*
* @type {string}
* @memberof RecipeIngredients
*/
used_in_recipes?: string;
}
/**
*
@ -2191,7 +2240,7 @@ export interface RecipeSimple {
* @type {string}
* @memberof RecipeSimple
*/
name?: string;
name: string;
/**
*
* @type {string}
@ -10374,7 +10423,7 @@ export const ApiApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listBookmarkletImports(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<BookmarkletImport>>> {
async listBookmarkletImports(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<BookmarkletImportList>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listBookmarkletImports(options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
@ -12206,7 +12255,7 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?:
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listBookmarkletImports(options?: any): AxiosPromise<Array<BookmarkletImport>> {
listBookmarkletImports(options?: any): AxiosPromise<Array<BookmarkletImportList>> {
return localVarFp.listBookmarkletImports(options).then((request) => request(axios, basePath));
},
/**