note text saving

This commit is contained in:
vabene1111
2020-06-09 20:27:31 +02:00
parent a743a4e202
commit 2bda5bbbf7
2 changed files with 47 additions and 38 deletions

View File

@ -9,7 +9,7 @@ class MealPlanSerializer(serializers.ModelSerializer):
class Meta:
model = MealPlan
fields = ('id', 'title', 'recipe', 'date', 'meal_type', 'created_by', 'recipe_name', 'meal_type_name')
fields = ('id', 'title', 'recipe', 'note', 'date', 'meal_type', 'created_by', 'recipe_name', 'meal_type_name')
class MealTypeSerializer(serializers.ModelSerializer):

View File

@ -46,7 +46,9 @@
</h3>
<div id="app">
<table class="table table-sm table-striped table-responsive">
<div class="row">
<div class="col-md-12">
<table class="table table-sm table-striped table-responsive-sm">
<thead class="thead-dark">
<tr>
<th v-for="d in days" style="width: 14.2%; text-align: center">[[d]]</th>
@ -67,11 +69,14 @@
<div class="row">
<div class="col-md-12">
<a href="#" v-if="element.title !== ''"
@click="plan_detail = element" data-toggle="modal" data-target="#exampleModal">[[element.title]]</a>
@click="plan_detail = element" data-toggle="modal"
data-target="#exampleModal">[[element.title]]</a>
<a href="#" v-if="element.recipe_name !== ''" @click="plan_detail = element"
data-toggle="modal" data-target="#exampleModal">[[element.recipe_name]]</a>
data-toggle="modal"
data-target="#exampleModal">[[element.recipe_name]]</a>
<a href="#" v-if="element.name !== ''"
@click="plan_detail = element" data-toggle="modal" data-target="#exampleModal">[[element.name]]</a>
@click="plan_detail = element" data-toggle="modal"
data-target="#exampleModal">[[element.name]]</a>
</div>
</div>
</div>
@ -80,6 +85,9 @@
</tr>
</tbody>
</table>
</div>
</div>
<hr/>
<div class="row">
<div class="col-md-6">
@ -151,7 +159,8 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-danger" @click="deleteEntry(plan_detail)">{% trans 'Delete' %}</button>
<button type="button" class="btn btn-danger"
@click="deleteEntry(plan_detail)">{% trans 'Delete' %}</button>
</div>
</div>
</div>
@ -296,7 +305,7 @@
let new_entry = {
id: Math.round(Math.random() * 1000) + 10000,
title: this.new_note_title,
text: this.new_note_text,
note: this.new_note_text,
is_note: true,
}