-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(add meals): add meals to nutrition plan
- add endpoint for creating a meal - create a single form for adding meal items - redirect to the page for adding meal items immediately after creating a meal. [Finishes #166185773]
- Loading branch information
Showing
8 changed files
with
157 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{% extends "base.html" %} | ||
{% load i18n %} | ||
{% load staticfiles %} | ||
{% load wger_extras %} | ||
|
||
|
||
{% block title %}{% trans "Add a meal" %}{% endblock %} | ||
|
||
|
||
{% block header %} | ||
<script type="text/javascript"> | ||
$(document).ready(function() { | ||
// Init the autocompleter | ||
wgerInitIngredientAutocompleter(); | ||
}); | ||
</script> | ||
{% endblock %} | ||
|
||
|
||
- | ||
- | ||
{% block content %} | ||
<form action="{{ form_action }}" | ||
method="post" | ||
class="form-horizontal"> | ||
{% csrf_token %} | ||
{% render_form_errors form %} | ||
<div class="form-group"> | ||
{% comment %} <label for="time-field">Time (approx) - Optional</label> {% endcomment %} | ||
|
||
<div class="col-md-3"><label for="time-field">Time (approx) - Optional</label></div> | ||
<div class="col-md-9" > | ||
<input type="time" id="time-field" name="time-field" | ||
min="9:00" max="18:00" | ||
class="form-control"> | ||
</div> | ||
</div> | ||
<div style="display: None;">{{form.ingredient}}</div> | ||
<div class="form-group {% if field.errors %}has-error{% endif %}" id="form-id_ingredient_searchfield"> | ||
<label for="id_ingredient_searchfield" class="col-md-3 control-label"> | ||
{% trans "Ingredient name" %} | ||
</label> | ||
|
||
<div class="col-md-9"> | ||
<input type="text" | ||
id="id_ingredient_searchfield" | ||
name="ingredient_searchfield" | ||
value="{{ingredient_searchfield}}" | ||
class="form-control"> | ||
<div id="exercise_name"></div> | ||
</div> | ||
</div> | ||
{% render_form_field form.amount %} | ||
{% render_form_field form.weight_unit %} | ||
{% render_form_submit submit_text %} | ||
</form> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,8 @@ | |
{% endblock %} | ||
|
||
|
||
|
||
|
||
- | ||
- | ||
{% block content %} | ||
<form action="{{ form_action }}" | ||
method="post" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters