removed icons

This commit is contained in:
vabene1111 2023-08-29 15:58:57 +02:00
parent 7f62ec28e3
commit 4ffc9cc72f
10 changed files with 16954 additions and 12169 deletions

View File

@ -342,7 +342,7 @@ class MealTypeSerializer(SpacedModelSerializer, WritableNestedModelSerializer):
class Meta:
list_serializer_class = SpaceFilterSerializer
model = MealType
fields = ('id', 'name', 'order', 'icon', 'color', 'default', 'created_by')
fields = ('id', 'name', 'order', 'color', 'default', 'created_by')
read_only_fields = ('created_by',)
@ -449,7 +449,7 @@ class KeywordSerializer(UniqueFieldsMixin, ExtendedRecipeMixin):
class Meta:
model = Keyword
fields = (
'id', 'name', 'icon', 'label', 'description', 'image', 'parent', 'numchild', 'numrecipe', 'created_at',
'id', 'name', 'label', 'description', 'image', 'parent', 'numchild', 'numrecipe', 'created_at',
'updated_at', 'full_name')
read_only_fields = ('id', 'label', 'numchild', 'parent', 'image')
@ -528,7 +528,7 @@ class PropertyTypeSerializer(OpenDataModelMixin, WritableNestedModelSerializer,
class Meta:
model = PropertyType
fields = ('id', 'name', 'icon', 'unit', 'description', 'order', 'open_data_slug')
fields = ('id', 'name', 'unit', 'description', 'order', 'open_data_slug')
class PropertySerializer(UniqueFieldsMixin, WritableNestedModelSerializer):
@ -939,7 +939,7 @@ class RecipeBookSerializer(SpacedModelSerializer, WritableNestedModelSerializer)
class Meta:
model = RecipeBook
fields = ('id', 'name', 'description', 'icon', 'shared', 'created_by', 'filter')
fields = ('id', 'name', 'description', 'shared', 'created_by', 'filter')
read_only_fields = ('created_by',)
@ -1309,7 +1309,7 @@ class AccessTokenSerializer(serializers.ModelSerializer):
class KeywordExportSerializer(KeywordSerializer):
class Meta:
model = Keyword
fields = ('name', 'icon', 'description', 'created_at', 'updated_at')
fields = ('name', 'description', 'created_at', 'updated_at')
class NutritionInformationExportSerializer(NutritionInformationSerializer):

View File

@ -9,7 +9,6 @@
},
"dependencies": {
"@babel/eslint-parser": "^7.21.3",
"@emoji-mart/data": "^1.1.1",
"@popperjs/core": "^2.11.7",
"@riophae/vue-treeselect": "^0.4.0",
"@vue/cli": "^5.0.8",
@ -20,8 +19,6 @@
"babel-loader": "^9.1.0",
"bootstrap-vue": "^2.23.1",
"core-js": "^3.29.1",
"emoji-mart": "^5.4.0",
"emoji-mart-vue-fast": "^12.0.1",
"html2pdf.js": "^0.10.1",
"lodash": "^4.17.21",
"mavon-editor": "^2.10.4",
@ -40,7 +37,7 @@
"vue-multiselect": "^2.1.6",
"vue-property-decorator": "^9.1.2",
"vue-sanitize": "^0.2.2",
"vue-simple-calendar": "TandoorRecipes/vue-simple-calendar#lastvue2",
"vue-simple-calendar": "5.0.1",
"vue-template-compiler": "2.7.14",
"vue2-touch-events": "^3.2.2",
"vuedraggable": "^2.24.3",

View File

@ -24,9 +24,6 @@
<div class="col-md-12">
<b-card class="d-flex flex-column" v-hover v-on:click="openBook(book.id)">
<b-row no-gutters style="height: inherit">
<b-col no-gutters md="2" style="height: inherit">
<h3>{{ book.icon }}</h3>
</b-col>
<b-col no-gutters md="10" style="height: inherit">
<b-card-body class="m-0 py-0" style="height: inherit">
<b-card-text class="h-100 my-0 d-flex flex-column" style="text-overflow: ellipsis">
@ -142,7 +139,7 @@ export default {
let apiClient = new ApiApiFactory()
apiClient
.createRecipeBook({ name: this.$t("New_Cookbook"), description: "", icon: "", shared: [] })
.createRecipeBook({ name: this.$t("New_Cookbook"), description: "", shared: [] })
.then((result) => {
let new_book = result.data
this.refreshData()

View File

@ -139,9 +139,7 @@
</div>
<div class="col-10">
<h5 class="mt-1 mb-1">
{{ meal_type.icon }} {{
meal_type.name
}}<span class="float-right text-primary" style="cursor: pointer"
{{ meal_type.name }}<span class="float-right text-primary" style="cursor: pointer"
><i class="fa"
v-bind:class="{ 'fa-pen': !meal_type.editing, 'fa-save': meal_type.editing }"
@click="editOrSaveMealType(index)" aria-hidden="true"></i
@ -156,10 +154,6 @@
<input class="form-control" :placeholder="$t('Name')"
v-model="meal_type.name"/>
</div>
<div class="form-group">
<emoji-input :field="'icon'" :label="$t('Icon')"
:value="meal_type.icon"></emoji-input>
</div>
<div class="form-group">
<label>{{ $t("Color") }}</label>
<input class="form-control" type="color" name="Name"
@ -294,7 +288,6 @@ import ContextMenuItem from "@/components/ContextMenu/ContextMenuItem"
import MealPlanCard from "@/components/MealPlanCard"
import MealPlanEditModal from "@/components/MealPlanEditModal"
import MealPlanCalenderHeader from "@/components/MealPlanCalenderHeader"
import EmojiInput from "@/components/Modals/EmojiInput"
import moment from "moment"
import draggable from "vuedraggable"
@ -326,7 +319,6 @@ export default {
ContextMenu,
ContextMenuItem,
MealPlanCalenderHeader,
EmojiInput,
draggable,
BottomNavigationBar,
},
@ -432,7 +424,6 @@ export default {
this.settings = Object.assign({}, this.settings, this.$cookies.get(SETTINGS_COOKIE_NAME))
}
})
this.$root.$on("change", this.updateEmoji)
this.$i18n.locale = window.CUSTOM_LOCALE
moment.locale(window.CUSTOM_LOCALE)
},
@ -525,13 +516,6 @@ export default {
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_DELETE, err)
})
},
updateEmoji: function (field, value) {
this.meal_types.forEach((meal_type) => {
if (meal_type.editing) {
meal_type.icon = value
}
})
},
datePickerChanged(ctx) {
this.setShowDate(ctx.selectedDate)
},

View File

@ -2,7 +2,7 @@
<b-card no-body v-hover>
<b-card-header class="p-4">
<h5>
{{ book_copy.icon }}&nbsp;{{ book_copy.name }}
{{ book_copy.name }}
<span class="float-right text-primary" @click="editOrSave"><i class="fa" v-bind:class="{ 'fa-pen': !editing, 'fa-save': editing }" aria-hidden="true"></i></span>
</h5>
<b-badge class="font-weight-normal mr-1" v-for="u in book_copy.shared" v-bind:key="u.id" variant="primary" pill>{{ u.display_name }}</b-badge>
@ -12,9 +12,6 @@
<label for="inputName1">{{ $t("Name") }}</label>
<input class="form-control" id="inputName1" placeholder="Name" v-model="book_copy.name" />
</div>
<div class="form-group" v-if="editing">
<emoji-input :field="'icon'" :label="$t('Icon')" :value="book_copy.icon"></emoji-input>
</div>
<div class="form-group" v-if="editing">
<label for="inputDesc1">{{ $t("Description") }}</label>
<textarea class="form-control" id="inputDesc1" rows="3" v-model="book_copy.description"> </textarea>
@ -58,12 +55,11 @@
<script>
import { ApiApiFactory } from "@/utils/openapi/api"
import { ApiMixin, StandardToasts } from "@/utils/utils"
import EmojiInput from "./Modals/EmojiInput"
import GenericMultiselect from "@/components/GenericMultiselect"
export default {
name: "CookbookEditCard",
components: { EmojiInput, GenericMultiselect },
components: { GenericMultiselect },
mixins: [ApiMixin],
props: {
book: Object,
@ -77,7 +73,6 @@ export default {
},
mounted() {
this.book_copy = this.book
this.$root.$on("change", this.updateEmoji)
},
directives: {
hover: {
@ -103,11 +98,6 @@ export default {
this.$emit("reload")
}
},
updateEmoji: function (item, value) {
if (item === "icon") {
this.book_copy.icon = value
}
},
saveData: function () {
let apiClient = new ApiApiFactory()

View File

@ -1,64 +0,0 @@
<template>
<div>
<b-form-group
v-bind:label="field_label"
class="mb-3">
<input class="form-control" v-model="new_value">
<Picker :data="emojiIndex" :ref="'_edit_' + id" :native="true"
@select="setIcon"/>
</b-form-group>
</div>
</template>
<script>
import data from "emoji-mart-vue-fast/data/all.json";
import "emoji-mart-vue-fast/css/emoji-mart.css";
import {Picker, EmojiIndex} from "emoji-mart-vue-fast";
let emojiIndex = new EmojiIndex(data);
export default {
name: 'EmojiInput',
components: {Picker},
props: {
field: {type: String, default: 'You Forgot To Set Field Name'},
label: {type: String, default: ''},
value: {type: String, default: ''},
optional: {type: Boolean, default: false},
},
data() {
return {
new_value: undefined,
id: null,
emojiIndex: emojiIndex,
emojisOutput: ""
}
},
computed: {
field_label: function () {
if (this.optional) {
return this.label
} else {
return this.label + '*'
}
}
},
watch: {
'new_value': function () {
this.$root.$emit('change', this.field, this.new_value ?? null)
},
},
mounted() {
this.id = this._uid
},
methods: {
setIcon: function (icon) {
console.log(icon)
this.new_value = icon.native
},
}
}
</script>

View File

@ -16,7 +16,6 @@
<text-input v-if="visibleCondition(f, 'text')" :label="f.label" :value="f.value" :field="f.field" :placeholder="f.placeholder" :help="showHelp && f.help" :subtitle="f.subtitle" :disabled="f.disabled" :optional="f.optional"/>
<text-area-input v-if="visibleCondition(f, 'textarea')" :label="f.label" :value="f.value" :field="f.field" :placeholder="f.placeholder" :help="showHelp && f.help" :subtitle="f.subtitle" :disabled="f.disabled" :optional="f.optional"/>
<choice-input v-if="visibleCondition(f, 'choice')" :label="f.label" :value="f.value" :field="f.field" :options="f.options" :placeholder="f.placeholder" :optional="f.optional"/>
<emoji-input v-if="visibleCondition(f, 'emoji')" :label="f.label" :value="f.value" :field="f.field" @change="storeValue" :optional="f.optional"/>
<file-input v-if="visibleCondition(f, 'file')" :label="f.label" :value="f.value" :field="f.field" @change="storeValue" :optional="f.optional"/>
<small-text v-if="visibleCondition(f, 'smalltext')" :value="f.value" />
<date-input v-if="visibleCondition(f, 'date')" :label="f.label" :value="f.value" :field="f.field" :help="showHelp && f.help" :subtitle="f.subtitle" :optional="f.optional"/>
@ -52,7 +51,6 @@ import CheckboxInput from "@/components/Modals/CheckboxInput"
import LookupInput from "@/components/Modals/LookupInput"
import TextInput from "@/components/Modals/TextInput"
import DateInput from "@/components/Modals/DateInput"
import EmojiInput from "@/components/Modals/EmojiInput"
import ChoiceInput from "@/components/Modals/ChoiceInput"
import FileInput from "@/components/Modals/FileInput"
import SmallText from "@/components/Modals/SmallText"
@ -67,7 +65,6 @@ export default {
CheckboxInput,
LookupInput,
TextInput,
EmojiInput,
ChoiceInput,
SmallText,
HelpBadge,

View File

@ -33,8 +33,7 @@
<tr v-for="p in property_list" v-bind:key="`id_${p.id}`">
<td>
{{ p.icon }} {{ p.name }}
{{ p.name }}
</td>
<td class="text-right">{{ p.property_amount_per_serving }}</td>
<td class="text-right">{{ p.property_amount_total }}</td>

View File

@ -243,7 +243,7 @@ export class Models {
},
create: {
// if not defined partialUpdate will use the same parameters, prepending 'id'
params: [["name", "description", "icon"]],
params: [["name", "description"]],
form: {
name: {
form_field: true,
@ -260,13 +260,6 @@ export class Models {
placeholder: "",
optional: true,
},
icon: {
form_field: true,
type: "emoji",
field: "icon",
label: "Icon",
optional: true,
},
full_name: {
form_field: true,
type: "smalltext",
@ -382,7 +375,7 @@ export class Models {
name: "Recipe_Book",
apiName: "RecipeBook",
create: {
params: [["name", "description", "icon", "filter"]],
params: [["name", "description", "filter"]],
form: {
name: {
form_field: true,
@ -399,13 +392,7 @@ export class Models {
placeholder: "",
optional: true,
},
icon: {
form_field: true,
type: "emoji",
field: "icon",
label: "Icon",
optional: true,
},
filter: {
form_field: true,
type: "lookup",
@ -710,7 +697,7 @@ export class Models {
},
},
create: {
params: [["name", "icon", "unit", "description", "order"]],
params: [["name", "unit", "description", "order"]],
form: {
show_help: true,
name: {
@ -720,14 +707,7 @@ export class Models {
label: "Name",
placeholder: "",
},
icon: {
form_field: true,
type: "emoji",
field: "icon",
label: "Icon",
placeholder: "",
optional: true,
},
unit: {
form_field: true,
type: "text",

File diff suppressed because it is too large Load Diff