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 model = Recipe
fields = ( fields = (
'id', 'name', 'description', 'image', 'keywords', 'steps', 'working_time', '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', 'internal', 'nutrition', 'servings', 'file_path', 'servings_text', 'rating', 'last_cooked',
) )
read_only_fields = ['image', 'created_by', 'created_at'] read_only_fields = ['image', 'created_by', 'created_at']

View File

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

View File

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

View File

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