Refine meal suggestions and planner entry controls
This commit is contained in:
@@ -150,20 +150,34 @@
|
||||
<h3>Passt gut dazu</h3>
|
||||
<div class="quick-add-row compact-quick-row">
|
||||
{% for suggestion in section.recipe_suggestions %}
|
||||
<form method="post" action="{{ url_for('main.planner_generated_meal') }}">
|
||||
{{ csrf_input() }}
|
||||
<input type="hidden" name="plan_date" value="{{ selected_date.isoformat() }}">
|
||||
<input type="hidden" name="daypart_id" value="{{ section.daypart.id }}">
|
||||
<input type="hidden" name="meal_name" value="{{ suggestion.title }}">
|
||||
<input type="hidden" name="visibility" value="shared">
|
||||
{% for component_id in suggestion.component_ids %}
|
||||
<input type="hidden" name="component_ids" value="{{ component_id }}">
|
||||
{% endfor %}
|
||||
<button class="quick-add-button compact-button" type="submit">
|
||||
<span>{{ suggestion.title }}</span>
|
||||
<small>{{ suggestion.reason }}</small>
|
||||
</button>
|
||||
</form>
|
||||
{% if suggestion.existing_item_id %}
|
||||
<form method="post" action="{{ url_for('main.planner_day', date=selected_date.isoformat()) }}">
|
||||
{{ csrf_input() }}
|
||||
<input type="hidden" name="plan_date" value="{{ selected_date.isoformat() }}">
|
||||
<input type="hidden" name="daypart_id" value="{{ section.daypart.id }}">
|
||||
<input type="hidden" name="item_id" value="{{ suggestion.existing_item_id }}">
|
||||
<input type="hidden" name="visibility" value="{{ suggestion.visibility or 'shared' }}">
|
||||
<button class="quick-add-button compact-button" type="submit">
|
||||
<span>{{ suggestion.title }}</span>
|
||||
<small>{{ suggestion.reason }}</small>
|
||||
</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form method="post" action="{{ url_for('main.planner_generated_meal') }}">
|
||||
{{ csrf_input() }}
|
||||
<input type="hidden" name="plan_date" value="{{ selected_date.isoformat() }}">
|
||||
<input type="hidden" name="daypart_id" value="{{ section.daypart.id }}">
|
||||
<input type="hidden" name="meal_name" value="{{ suggestion.title }}">
|
||||
<input type="hidden" name="visibility" value="shared">
|
||||
{% for component_id in suggestion.component_ids %}
|
||||
<input type="hidden" name="component_ids" value="{{ component_id }}">
|
||||
{% endfor %}
|
||||
<button class="quick-add-button compact-button" type="submit">
|
||||
<span>{{ suggestion.title }}</span>
|
||||
<small>{{ suggestion.reason }}</small>
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -220,6 +234,28 @@
|
||||
{% if entry.note %}
|
||||
<p>{{ entry.note }}</p>
|
||||
{% endif %}
|
||||
{% if entry.can_edit %}
|
||||
<details class="planner-entry-edit">
|
||||
<summary class="ghost-button">Anpassen</summary>
|
||||
<form method="post" action="{{ url_for('main.planner_update', entry_id=entry.id) }}" class="planner-entry-inline-form">
|
||||
{{ csrf_input() }}
|
||||
<input type="hidden" name="plan_date" value="{{ selected_date.isoformat() }}">
|
||||
<label>
|
||||
Für wen?
|
||||
<select name="visibility">
|
||||
{% for value, label in visibility_options %}
|
||||
<option value="{{ value }}" {% if entry.visibility == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
<label class="wide">
|
||||
Notiz
|
||||
<input type="text" name="note" value="{{ entry.note or '' }}" placeholder="Optional">
|
||||
</label>
|
||||
<button type="submit">Speichern</button>
|
||||
</form>
|
||||
</details>
|
||||
{% endif %}
|
||||
</article>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user