72 lines
3.2 KiB
HTML
72 lines
3.2 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Редактирование события — Morozovka Portal{% endblock %}
|
|
{% block main_class %}container container-narrow{% endblock %}
|
|
|
|
{% block head %}
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/themes/dark.css">
|
|
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/flatpickr/dist/l10n/ru.js"></script>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<a href="/admin/schedule" style="display:inline-block;margin-bottom:20px;color:#8b949e;text-decoration:none;">← Назад к расписанию</a>
|
|
<h2 class="page-title">Редактирование события</h2>
|
|
|
|
<div class="card">
|
|
<form method="POST">
|
|
<div class="form-group">
|
|
<label>Название</label>
|
|
<input type="text" name="title" value="{{ event.title }}" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Тип</label>
|
|
<select name="event_type">
|
|
<option value="lecture" {% if event.event_type == 'lecture' %}selected{% endif %}>Лекция</option>
|
|
<option value="workshop" {% if event.event_type == 'workshop' %}selected{% endif %}>Мастер-класс</option>
|
|
<option value="meeting" {% if event.event_type == 'meeting' %}selected{% endif %}>Встреча</option>
|
|
<option value="personal" {% if event.event_type == 'personal' %}selected{% endif %}>Личное</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Место</label>
|
|
<input type="text" name="location" value="{{ event.location or '' }}">
|
|
</div>
|
|
<div class="form-row">
|
|
<div class="form-group">
|
|
<label>Начало</label>
|
|
<input type="text" class="flatpickr" name="start_time" required value="{{ event.start_time|msk_strftime('%Y-%m-%d %H:%M') }}">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Конец</label>
|
|
<input type="text" class="flatpickr" name="end_time" required value="{{ event.end_time|msk_strftime('%Y-%m-%d %H:%M') }}">
|
|
</div>
|
|
</div>
|
|
<div class="form-group" style="flex-direction: row; gap: 10px; align-items: center;">
|
|
<input type="checkbox" name="is_public" id="is_public" {% if event.is_public %}checked{% endif %}>
|
|
<label for="is_public" style="margin: 0; cursor: pointer;">Публичное событие</label>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Описание</label>
|
|
<textarea name="description">{{ event.description or '' }}</textarea>
|
|
</div>
|
|
<div class="form-actions">
|
|
<button type="submit" class="btn btn-primary">Сохранить изменения</button>
|
|
<a href="/admin/schedule" class="btn btn-default">Отмена</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script>
|
|
flatpickr(".flatpickr", {
|
|
enableTime: true,
|
|
dateFormat: "Y-m-d H:i",
|
|
time_24hr: true,
|
|
locale: "ru",
|
|
minuteIncrement: 15
|
|
});
|
|
</script>
|
|
{% endblock %}
|