note text saving
This commit is contained in:
@ -9,7 +9,7 @@ class MealPlanSerializer(serializers.ModelSerializer):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = MealPlan
|
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):
|
class MealTypeSerializer(serializers.ModelSerializer):
|
||||||
|
@ -46,7 +46,9 @@
|
|||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<div id="app">
|
<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">
|
<thead class="thead-dark">
|
||||||
<tr>
|
<tr>
|
||||||
<th v-for="d in days" style="width: 14.2%; text-align: center">[[d]]</th>
|
<th v-for="d in days" style="width: 14.2%; text-align: center">[[d]]</th>
|
||||||
@ -67,11 +69,14 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<a href="#" v-if="element.title !== ''"
|
<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"
|
<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 !== ''"
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -80,6 +85,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@ -141,7 +149,7 @@
|
|||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" >[[ plan_detail.title ]] [[ plan_detail.recipe_name ]]</h5>
|
<h5 class="modal-title">[[ plan_detail.title ]] [[ plan_detail.recipe_name ]]</h5>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
@ -151,7 +159,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -296,7 +305,7 @@
|
|||||||
let new_entry = {
|
let new_entry = {
|
||||||
id: Math.round(Math.random() * 1000) + 10000,
|
id: Math.round(Math.random() * 1000) + 10000,
|
||||||
title: this.new_note_title,
|
title: this.new_note_title,
|
||||||
text: this.new_note_text,
|
note: this.new_note_text,
|
||||||
is_note: true,
|
is_note: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user