Add week planner entry editing popups
This commit is contained in:
@@ -213,10 +213,61 @@
|
||||
{% if slot.entries %}
|
||||
<div class="week-entry-stack">
|
||||
{% for entry in slot.entries %}
|
||||
<article class="plan-chip draggable-plan-entry" draggable="{{ 'true' if entry.can_edit else 'false' }}" data-entry-id="{{ entry.id }}" data-move-url="{{ url_for('main.planner_move', entry_id=entry.id) }}">
|
||||
<article
|
||||
class="plan-chip draggable-plan-entry{% if entry.can_edit %} is-editable{% endif %}"
|
||||
draggable="{{ 'true' if entry.can_edit else 'false' }}"
|
||||
data-entry-id="{{ entry.id }}"
|
||||
data-move-url="{{ url_for('main.planner_move', entry_id=entry.id) }}"
|
||||
{% if entry.can_edit %}
|
||||
data-week-entry-open
|
||||
data-week-entry-dialog-id="week-entry-dialog-{{ entry.id }}"
|
||||
tabindex="0"
|
||||
role="button"
|
||||
aria-label="{{ entry.item_name }} bearbeiten"
|
||||
{% endif %}
|
||||
>
|
||||
<strong>{{ entry.item_name }}</strong>
|
||||
<small>{{ entry.visibility_label }} · {{ entry.for_label }}</small>
|
||||
</article>
|
||||
{% if entry.can_edit %}
|
||||
<dialog class="week-entry-dialog" id="week-entry-dialog-{{ entry.id }}">
|
||||
<div class="week-entry-dialog-card">
|
||||
<div class="week-entry-dialog-head">
|
||||
<div>
|
||||
<h3>{{ entry.item_name }}</h3>
|
||||
<p>{{ slot.daypart.name }} · {{ weekday_name(card.date) }}, {{ card.date.strftime('%d.%m.%Y') }}</p>
|
||||
</div>
|
||||
<button class="ghost-button" type="button" data-week-entry-close>Schließen</button>
|
||||
</div>
|
||||
<form method="post" action="{{ url_for('main.planner_update', entry_id=entry.id) }}" class="planner-entry-inline-form js-week-entry-submit">
|
||||
{{ csrf_input() }}
|
||||
<input type="hidden" name="plan_date" value="{{ card.date.isoformat() }}">
|
||||
<input type="hidden" name="return_week" value="{{ week_start.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>
|
||||
<div class="week-entry-dialog-actions">
|
||||
<button type="submit">Speichern</button>
|
||||
</div>
|
||||
</form>
|
||||
<form method="post" action="{{ url_for('main.planner_remove', entry_id=entry.id) }}" class="week-entry-remove-form js-week-entry-submit">
|
||||
{{ csrf_input() }}
|
||||
<input type="hidden" name="plan_date" value="{{ card.date.isoformat() }}">
|
||||
<input type="hidden" name="return_week" value="{{ week_start.isoformat() }}">
|
||||
<button class="ghost-button" type="submit">Eintrag entfernen</button>
|
||||
</form>
|
||||
</div>
|
||||
</dialog>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="week-slot-actions">
|
||||
|
||||
Reference in New Issue
Block a user