removed use_plural space attribute and left over settings

This commit is contained in:
vabene1111 2024-01-28 08:42:42 +01:00
parent fb8ca52280
commit 6b4b2a8f87
9 changed files with 21 additions and 20 deletions

View File

@ -450,7 +450,7 @@ class SpacePreferenceForm(forms.ModelForm):
class Meta: class Meta:
model = Space model = Space
fields = ('food_inherit', 'reset_food_inherit', 'use_plural') fields = ('food_inherit', 'reset_food_inherit',)
help_texts = { help_texts = {
'food_inherit': _('Fields on food that should be inherited by default.'), 'food_inherit': _('Fields on food that should be inherited by default.'),

View File

@ -0,0 +1,17 @@
# Generated by Django 4.2.7 on 2024-01-28 07:42
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0208_space_app_name_userpreference_max_owned_spaces'),
]
operations = [
migrations.RemoveField(
model_name='space',
name='use_plural',
),
]

View File

@ -303,7 +303,6 @@ class Space(ExportModelOperationsMixin('space'), models.Model):
max_recipes = models.IntegerField(default=0) max_recipes = models.IntegerField(default=0)
max_file_storage_mb = models.IntegerField(default=0, help_text=_('Maximum file storage for space in MB. 0 for unlimited, -1 to disable file upload.')) max_file_storage_mb = models.IntegerField(default=0, help_text=_('Maximum file storage for space in MB. 0 for unlimited, -1 to disable file upload.'))
max_users = models.IntegerField(default=0) max_users = models.IntegerField(default=0)
use_plural = models.BooleanField(default=True)
allow_sharing = models.BooleanField(default=True) allow_sharing = models.BooleanField(default=True)
no_sharing_limit = models.BooleanField(default=False) no_sharing_limit = models.BooleanField(default=False)
demo = models.BooleanField(default=False) demo = models.BooleanField(default=False)

View File

@ -20,7 +20,7 @@
<cookbook-toc :recipes="recipes" v-if="current_page === 1" v-on:switchRecipe="switchRecipe($event)"></cookbook-toc> <cookbook-toc :recipes="recipes" v-if="current_page === 1" v-on:switchRecipe="switchRecipe($event)"></cookbook-toc>
</transition> </transition>
<transition name="flip" mode="out-in"> <transition name="flip" mode="out-in">
<recipe-card :recipe="display_recipes[1].recipe_content" v-if="current_page > 1 && display_recipes.length === 2" :key="display_recipes[1].recipe" :use_plural="use_plural"></recipe-card> <recipe-card :recipe="display_recipes[1].recipe_content" v-if="current_page > 1 && display_recipes.length === 2" :key="display_recipes[1].recipe" ></recipe-card>
</transition> </transition>
</div> </div>
<div class="col-md-1" @click="swipeLeft" style="cursor: pointer"></div> <div class="col-md-1" @click="swipeLeft" style="cursor: pointer"></div>
@ -57,10 +57,7 @@ export default {
} }
}, },
mounted(){ mounted(){
let apiClient = new ApiApiFactory()
apiClient.retrieveSpace(window.ACTIVE_SPACE_ID).then(r => {
this.use_plural = r.data.use_plural
})
}, },
data() { data() {
return { return {
@ -69,7 +66,6 @@ export default {
bounce_left: false, bounce_left: false,
bounce_right: false, bounce_right: false,
cookbook_editing: false, cookbook_editing: false,
use_plural: false,
} }
}, },
methods: { methods: {

View File

@ -77,7 +77,6 @@
<generic-horizontal-card v-for="child in item[children]" <generic-horizontal-card v-for="child in item[children]"
v-bind:key="child.id" v-bind:key="child.id"
:item="child" :model="model" :item="child" :model="model"
:use_plural="use_plural"
@item-action="$emit('item-action', $event)"></generic-horizontal-card> @item-action="$emit('item-action', $event)"></generic-horizontal-card>
</div> </div>
</div> </div>
@ -160,7 +159,6 @@ export default {
recipe_count: { type: String, default: "numrecipe" }, recipe_count: { type: String, default: "numrecipe" },
recipes: { type: String, default: "recipes" }, recipes: { type: String, default: "recipes" },
show_context_menu: { type: Boolean, default: true }, show_context_menu: { type: Boolean, default: true },
use_plural: { type: Boolean, default: false},
}, },
data() { data() {
return { return {

View File

@ -24,7 +24,6 @@
<ingredient-component <ingredient-component
:ingredient="i" :ingredient="i"
:ingredient_factor="ingredient_factor" :ingredient_factor="ingredient_factor"
:use_plural="use_plural"
:key="i.id" :key="i.id"
:detailed="detailed" :detailed="detailed"
@checked-state-changed="$emit('checked-state-changed', $event)" @checked-state-changed="$emit('checked-state-changed', $event)"
@ -64,7 +63,6 @@ export default {
recipe: {type: Number}, recipe: {type: Number},
ingredient_factor: {type: Number, default: 1}, ingredient_factor: {type: Number, default: 1},
servings: {type: Number, default: 1}, servings: {type: Number, default: 1},
use_plural: {type: Boolean, default: false},
detailed: {type: Boolean, default: true}, detailed: {type: Boolean, default: true},
header: {type: Boolean, default: false}, header: {type: Boolean, default: false},
recipe_list: {type: Number, default: undefined}, recipe_list: {type: Number, default: undefined},

View File

@ -34,7 +34,6 @@
<div v-for="i in r.steps.flatMap((s) => s.ingredients)" v-bind:key="i.id"> <div v-for="i in r.steps.flatMap((s) => s.ingredients)" v-bind:key="i.id">
<table class="table table-sm mb-0"> <table class="table table-sm mb-0">
<ingredient-component <ingredient-component
:use_plural="true"
:key="i.id" :key="i.id"
:detailed="true" :detailed="true"
:ingredient="i" :ingredient="i"

View File

@ -145,7 +145,6 @@ export default {
props: { props: {
recipe: Object, recipe: Object,
meal_plan: Object, meal_plan: Object,
use_plural: { type: Boolean, default: false },
footer_text: String, footer_text: String,
footer_icon: String, footer_icon: String,
detailed: { type: Boolean, default: true }, detailed: { type: Boolean, default: true },

View File

@ -90,7 +90,6 @@
:index="index" :index="index"
:start_time="start_time" :start_time="start_time"
:force_ingredients="true" :force_ingredients="true"
:use_plural="use_plural"
></step-component> ></step-component>
</div> </div>
</div> </div>
@ -147,10 +146,6 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
use_plural: {
type: Boolean,
default: false,
},
}, },
computed: { computed: {
step_time: function() { step_time: function() {