mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-05-31 04:05:33 -04:00
Fix/category link (#1087)
* fix and refactor chip links * fix missing UI components for data management * fix button text
This commit is contained in:
parent
ba325c12f7
commit
0f82523cdd
@ -35,7 +35,7 @@
|
|||||||
<RecipeFavoriteBadge v-if="loggedIn" :slug="slug" show-always />
|
<RecipeFavoriteBadge v-if="loggedIn" :slug="slug" show-always />
|
||||||
<RecipeRating :value="rating" :name="name" :slug="slug" :small="true" />
|
<RecipeRating :value="rating" :name="name" :slug="slug" :small="true" />
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
<RecipeChips :truncate="true" :items="tags" :title="false" :limit="2" :small="true" :is-category="false" />
|
<RecipeChips :truncate="true" :items="tags" :title="false" :limit="2" :small="true" url-prefix="tags" />
|
||||||
<RecipeContextMenu
|
<RecipeContextMenu
|
||||||
:slug="slug"
|
:slug="slug"
|
||||||
:name="name"
|
:name="name"
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
color="accent"
|
color="accent"
|
||||||
:small="small"
|
:small="small"
|
||||||
dark
|
dark
|
||||||
:to="`/recipes/${urlParam}/${category.slug}`"
|
:to="`/recipes/${urlPrefix}/${category.slug}`"
|
||||||
>
|
>
|
||||||
{{ truncateText(category.name) }}
|
{{ truncateText(category.name) }}
|
||||||
</v-chip>
|
</v-chip>
|
||||||
@ -17,7 +17,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {computed, defineComponent} from "@nuxtjs/composition-api";
|
import { defineComponent } from "@nuxtjs/composition-api";
|
||||||
|
import { RecipeCategory, RecipeTag, RecipeTool } from "~/types/api-types/user";
|
||||||
|
|
||||||
|
export type UrlPrefixParam = "tags" | "categories" | "tools";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
@ -26,16 +29,16 @@ export default defineComponent({
|
|||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
items: {
|
items: {
|
||||||
type: Array,
|
type: Array as () => RecipeCategory[] | RecipeTag[] | RecipeTool[],
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
isCategory: {
|
urlPrefix: {
|
||||||
type: Boolean,
|
type: String as () => UrlPrefixParam,
|
||||||
default: true,
|
default: "categories",
|
||||||
},
|
},
|
||||||
limit: {
|
limit: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@ -51,8 +54,6 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
const urlParam = computed(() => props.isCategory ? "categories" : "tags");
|
|
||||||
|
|
||||||
function truncateText(text: string, length = 20, clamp = "...") {
|
function truncateText(text: string, length = 20, clamp = "...") {
|
||||||
if (!props.truncate) return text;
|
if (!props.truncate) return text;
|
||||||
const node = document.createElement("div");
|
const node = document.createElement("div");
|
||||||
@ -62,9 +63,8 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
urlParam,
|
|
||||||
truncateText,
|
truncateText,
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -18,13 +18,13 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</template>
|
</template>
|
||||||
<template #item.tags="{ item }">
|
<template #item.tags="{ item }">
|
||||||
<RecipeChip small :items="item.tags" />
|
<RecipeChip small :items="item.tags" :is-category="false" url-prefix="tags" />
|
||||||
</template>
|
</template>
|
||||||
<template #item.recipeCategory="{ item }">
|
<template #item.recipeCategory="{ item }">
|
||||||
<RecipeChip small :items="item.recipeCategory" />
|
<RecipeChip small :items="item.recipeCategory" />
|
||||||
</template>
|
</template>
|
||||||
<template #item.tools="{ item }">
|
<template #item.tools="{ item }">
|
||||||
<RecipeChip small :items="item.tools" />
|
<RecipeChip small :items="item.tools" url-prefix="tools" />
|
||||||
</template>
|
</template>
|
||||||
<template #item.userId="{ item }">
|
<template #item.userId="{ item }">
|
||||||
<v-list-item class="justify-start">
|
<v-list-item class="justify-start">
|
||||||
|
@ -14,6 +14,11 @@
|
|||||||
mode="link"
|
mode="link"
|
||||||
rounded
|
rounded
|
||||||
:items="[
|
:items="[
|
||||||
|
{
|
||||||
|
text: 'Recipes',
|
||||||
|
value: 'new',
|
||||||
|
to: '/group/data/recipes',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: 'Foods',
|
text: 'Foods',
|
||||||
value: 'url',
|
value: 'url',
|
||||||
@ -55,6 +60,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
const buttonLookup: { [key: string]: string } = {
|
const buttonLookup: { [key: string]: string } = {
|
||||||
|
recipes: "Recipes",
|
||||||
foods: "Foods",
|
foods: "Foods",
|
||||||
units: "Units",
|
units: "Units",
|
||||||
labels: "Labels",
|
labels: "Labels",
|
||||||
|
@ -56,16 +56,9 @@
|
|||||||
</v-card>
|
</v-card>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
</BaseDialog>
|
</BaseDialog>
|
||||||
<BasePageTitle divider>
|
|
||||||
<template #header>
|
|
||||||
<v-img max-height="125" max-width="125" :src="require('~/static/svgs/manage-recipes.svg')"></v-img>
|
|
||||||
</template>
|
|
||||||
<template #title> Data Management </template>
|
|
||||||
</BasePageTitle>
|
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<!-- Recipe Data Table -->
|
<!-- Recipe Data Table -->
|
||||||
<BaseCardSectionTitle :icon="$globals.icons.primary" section title="Recipe Data">
|
<BaseCardSectionTitle :icon="$globals.icons.primary" title="Recipe Data">
|
||||||
Use this section to manage the data associated with your recipes. You can perform several bulk actions on your
|
Use this section to manage the data associated with your recipes. You can perform several bulk actions on your
|
||||||
recipes including exporting, deleting, tagging, and assigning categories.
|
recipes including exporting, deleting, tagging, and assigning categories.
|
||||||
</BaseCardSectionTitle>
|
</BaseCardSectionTitle>
|
||||||
@ -86,7 +79,7 @@
|
|||||||
<v-divider class="mx-2"></v-divider>
|
<v-divider class="mx-2"></v-divider>
|
||||||
<v-card-text class="mt-n5">
|
<v-card-text class="mt-n5">
|
||||||
<v-checkbox
|
<v-checkbox
|
||||||
v-for="(itemValue, key) in headers"
|
v-for="(_, key) in headers"
|
||||||
:key="key"
|
:key="key"
|
||||||
v-model="headers[key]"
|
v-model="headers[key]"
|
||||||
dense
|
dense
|
||||||
|
@ -63,12 +63,12 @@
|
|||||||
<template v-if="!editState[rule.id]">
|
<template v-if="!editState[rule.id]">
|
||||||
<div v-if="rule.categories">
|
<div v-if="rule.categories">
|
||||||
<h4 class="py-1">{{ $t("category.categories") }}:</h4>
|
<h4 class="py-1">{{ $t("category.categories") }}:</h4>
|
||||||
<RecipeChips :items="rule.categories" is-category small />
|
<RecipeChips :items="rule.categories" small />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="rule.tags">
|
<div v-if="rule.tags">
|
||||||
<h4 class="py-1">{{ $t("tag.tags") }}:</h4>
|
<h4 class="py-1">{{ $t("tag.tags") }}:</h4>
|
||||||
<RecipeChips :items="rule.tags" :is-category="false" small />
|
<RecipeChips :items="rule.tags" url-prefix="tags" small />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
|
@ -267,7 +267,7 @@
|
|||||||
:tag-selector="true"
|
:tag-selector="true"
|
||||||
:show-label="false"
|
:show-label="false"
|
||||||
/>
|
/>
|
||||||
<RecipeChips v-else :items="recipe.tags" :is-category="false" />
|
<RecipeChips v-else :items="recipe.tags" url-prefix="tags" />
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
</v-card>
|
</v-card>
|
||||||
|
|
||||||
@ -355,7 +355,7 @@
|
|||||||
:tag-selector="true"
|
:tag-selector="true"
|
||||||
:show-label="false"
|
:show-label="false"
|
||||||
/>
|
/>
|
||||||
<RecipeChips v-else :items="recipe.tags" :is-category="false" />
|
<RecipeChips v-else :items="recipe.tags" url-prefix="tags"/>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
</v-card>
|
</v-card>
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@
|
|||||||
</v-card-title>
|
</v-card-title>
|
||||||
<v-divider class="mx-2"></v-divider>
|
<v-divider class="mx-2"></v-divider>
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<RecipeChips :items="recipe.tags" :is-category="false" />
|
<RecipeChips :items="recipe.tags" url-prefix="tags" />
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
</v-card>
|
</v-card>
|
||||||
|
|
||||||
@ -219,7 +219,7 @@
|
|||||||
</v-card-title>
|
</v-card-title>
|
||||||
<v-divider class="mx-2"></v-divider>
|
<v-divider class="mx-2"></v-divider>
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<RecipeChips :items="recipe.tags" :is-category="false" />
|
<RecipeChips :items="recipe.tags" url-prefix="tags" />
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
</v-card>
|
</v-card>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user