side nav in recipe edit
This commit is contained in:
parent
dbdb35e2f3
commit
8f28e4766d
@ -99,7 +99,7 @@ class RecipeSerializer(WritableNestedModelSerializer):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Recipe
|
model = Recipe
|
||||||
fields = ['name', 'image', 'keywords', 'steps', 'working_time', 'waiting_time', 'created_by', 'created_at', 'updated_at', 'internal']
|
fields = ['id', 'name', 'image', 'keywords', 'steps', 'working_time', 'waiting_time', 'created_by', 'created_at', 'updated_at', 'internal']
|
||||||
read_only_fields = ['image', 'created_by', 'created_at']
|
read_only_fields = ['image', 'created_by', 'created_at']
|
||||||
|
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@
|
|||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid" id="id_base_container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xl-2 d-none d-xl-block">
|
<div class="col-xl-2 d-none d-xl-block">
|
||||||
{% block content_xl_left %}
|
{% block content_xl_left %}
|
||||||
|
@ -23,11 +23,6 @@
|
|||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.break-column {
|
|
||||||
flex-basis: 100%;
|
|
||||||
width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@ -50,7 +45,8 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<img src="{{ recipe.image.url }}" id="id_image" class="img img-fluid img-responsive"
|
<img src="{% if recipe.image %}{{ recipe.image.url }}{% endif %}" id="id_image"
|
||||||
|
class="img img-fluid img-responsive"
|
||||||
style="max-height: 20vh">
|
style="max-height: 20vh">
|
||||||
<input type="file" @change="imageChanged">
|
<input type="file" @change="imageChanged">
|
||||||
</div>
|
</div>
|
||||||
@ -184,16 +180,39 @@
|
|||||||
<br/>
|
<br/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="button" @click="updateRecipe(true)" class="btn btn-success">{% trans 'Save & View' %}</button>
|
<button type="button" @click="updateRecipe(true)" class="btn btn-success shadow-none">{% trans 'Save & View' %}</button>
|
||||||
<button type="button" @click="updateRecipe(false)" class="btn btn-info">{% trans 'Save' %}</button>
|
<button type="button" @click="updateRecipe(false)" class="btn btn-info shadow-none">{% trans 'Save' %}</button>
|
||||||
<button type="button" @click="addStep()" class="btn btn-primary">{% trans 'Add Step' %}</button>
|
<button type="button" @click="addStep()" class="btn btn-primary shadow-none">{% trans 'Add Step' %}</button>
|
||||||
<a href="{% url 'view_recipe' recipe.pk %}" @click="addStep()"
|
<a href="{% url 'view_recipe' recipe.pk %}" @click="addStep()"
|
||||||
class="btn btn-secondary">{% trans 'View Recipe' %}</a>
|
class="btn btn-secondary shadow-none">{% trans 'View Recipe' %}</a>
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content_xl_right %}
|
||||||
|
<div class="sticky-top" style="top: 2vh">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-8">
|
||||||
|
<button type="button" @click="updateRecipe(true)"
|
||||||
|
class="btn btn-success btn-block shadow-none">{% trans 'Save & View' %}</button>
|
||||||
|
|
||||||
|
<button type="button" @click="updateRecipe(false)"
|
||||||
|
class="btn btn-info btn-block shadow-none">{% trans 'Save' %}</button>
|
||||||
|
|
||||||
|
<button type="button" @click="addStep()"
|
||||||
|
class="btn btn-primary btn-block shadow-none">{% trans 'Add Step' %}</button>
|
||||||
|
|
||||||
|
<a href="{% url 'view_recipe' recipe.pk %}" @click="addStep()"
|
||||||
|
class="btn btn-secondary btn-block shadow-none">{% trans 'View Recipe' %}</a> <br/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block script %}
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
let csrftoken = Cookies.get('csrftoken');
|
let csrftoken = Cookies.get('csrftoken');
|
||||||
Vue.http.headers.common['X-CSRFToken'] = csrftoken;
|
Vue.http.headers.common['X-CSRFToken'] = csrftoken;
|
||||||
@ -205,7 +224,7 @@
|
|||||||
Multiselect: window.VueMultiselect.default
|
Multiselect: window.VueMultiselect.default
|
||||||
},
|
},
|
||||||
delimiters: ['[[', ']]'],
|
delimiters: ['[[', ']]'],
|
||||||
el: '#app',
|
el: '#id_base_container',
|
||||||
data: {
|
data: {
|
||||||
recipe: undefined,
|
recipe: undefined,
|
||||||
keywords: [],
|
keywords: [],
|
||||||
@ -330,6 +349,4 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Reference in New Issue
Block a user