feat: admin bar at top of event page + Quill editor for event description
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
- Admin action bar (edit + payments) moved to top of event detail page - Quill WYSIWYG editor replaces raw textarea in event create/edit form - Back-to-event link in edit form - Removed duplicate admin buttons from bottom of event page Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b451e041bb
commit
a04c37c72a
@ -3,12 +3,17 @@
|
|||||||
{% block title %}Nowe wydarzenie - Norda Biznes Partner{% endblock %}
|
{% block title %}Nowe wydarzenie - Norda Biznes Partner{% endblock %}
|
||||||
|
|
||||||
{% block extra_css %}
|
{% block extra_css %}
|
||||||
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/quill.snow.css') }}">
|
||||||
<style>
|
<style>
|
||||||
.form-container {
|
.form-container {
|
||||||
max-width: 700px;
|
max-width: 700px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.quill-container .ql-toolbar { border-radius: var(--radius) var(--radius) 0 0; border-color: var(--border); }
|
||||||
|
.quill-container .ql-container { border-radius: 0 0 var(--radius) var(--radius); border-color: var(--border); min-height: 150px; font-size: var(--font-size-base); }
|
||||||
|
.quill-container .ql-editor { min-height: 150px; }
|
||||||
|
|
||||||
.form-header {
|
.form-header {
|
||||||
margin-bottom: var(--spacing-xl);
|
margin-bottom: var(--spacing-xl);
|
||||||
}
|
}
|
||||||
@ -90,12 +95,22 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="form-container">
|
<div class="form-container">
|
||||||
<a href="{{ url_for('admin.admin_calendar') }}" class="back-link">
|
<div style="display: flex; gap: var(--spacing-md); flex-wrap: wrap;">
|
||||||
<svg width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
|
{% if event %}
|
||||||
<path d="M19 12H5M12 19l-7-7 7-7"/>
|
<a href="{{ url_for('calendar.calendar_event', event_id=event.id) }}" class="back-link">
|
||||||
</svg>
|
<svg width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
|
||||||
Powrot do listy wydarzen
|
<path d="M19 12H5M12 19l-7-7 7-7"/>
|
||||||
</a>
|
</svg>
|
||||||
|
Powrót do wydarzenia
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
<a href="{{ url_for('admin.admin_calendar') }}" class="back-link">
|
||||||
|
<svg width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
|
||||||
|
<path d="M19 12H5M12 19l-7-7 7-7"/>
|
||||||
|
</svg>
|
||||||
|
Powrot do listy wydarzen
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-header">
|
<div class="form-header">
|
||||||
<h1>{{ 'Edytuj wydarzenie' if event else 'Nowe wydarzenie' }}</h1>
|
<h1>{{ 'Edytuj wydarzenie' if event else 'Nowe wydarzenie' }}</h1>
|
||||||
@ -133,8 +148,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="description">Opis</label>
|
<label>Opis</label>
|
||||||
<textarea id="description" name="description" rows="4" placeholder="Opisz co bedzie sie dzialo na wydarzeniu...">{{ event.description or '' if event else '' }}</textarea>
|
<div class="quill-container">
|
||||||
|
<div id="quill-editor"></div>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" id="description" name="description" value="">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
@ -268,4 +286,31 @@
|
|||||||
paidCb.addEventListener('change', togglePaid);
|
paidCb.addEventListener('change', togglePaid);
|
||||||
togglePaid();
|
togglePaid();
|
||||||
})();
|
})();
|
||||||
|
</script>
|
||||||
|
<script src="{{ url_for('static', filename='js/vendor/quill.js') }}"></script>
|
||||||
|
<script>
|
||||||
|
(function() {
|
||||||
|
var quill = new Quill('#quill-editor', {
|
||||||
|
theme: 'snow',
|
||||||
|
placeholder: 'Opisz co będzie się działo na wydarzeniu...',
|
||||||
|
modules: {
|
||||||
|
toolbar: [
|
||||||
|
['bold', 'italic', 'underline'],
|
||||||
|
[{'header': 3}],
|
||||||
|
[{'list': 'ordered'}, {'list': 'bullet'}],
|
||||||
|
['link'],
|
||||||
|
['clean']
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
{% if event and event.description %}
|
||||||
|
quill.root.innerHTML = {{ event.description|tojson }};
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
// Sync Quill content to hidden input on form submit
|
||||||
|
quill.root.closest('form').addEventListener('submit', function() {
|
||||||
|
document.getElementById('description').value = quill.root.innerHTML;
|
||||||
|
});
|
||||||
|
})();
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -399,6 +399,26 @@
|
|||||||
Powrót do kalendarza
|
Powrót do kalendarza
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
{% if current_user.is_authenticated and current_user.can_access_admin_panel() %}
|
||||||
|
<div class="admin-event-bar" style="display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 16px; background: #f0f4ff; border: 1px solid #c7d2fe; border-radius: var(--radius-lg); margin-bottom: var(--spacing-lg);">
|
||||||
|
<a href="{{ url_for('admin.admin_calendar_edit', event_id=event.id) }}" class="btn btn-primary" style="font-size: 0.85em;">
|
||||||
|
<svg width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" style="vertical-align: -2px; margin-right: 4px;">
|
||||||
|
<path d="M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"/>
|
||||||
|
<path d="M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"/>
|
||||||
|
</svg>
|
||||||
|
Edytuj wydarzenie
|
||||||
|
</a>
|
||||||
|
{% if event.is_paid %}
|
||||||
|
<a href="{{ url_for('admin.admin_event_payments', event_id=event.id) }}" class="btn btn-outline" style="font-size: 0.85em; background: white;">
|
||||||
|
<svg width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" style="vertical-align: -2px; margin-right: 4px;">
|
||||||
|
<path d="M12 1v22M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6"/>
|
||||||
|
</svg>
|
||||||
|
Zarządzaj płatnościami
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="event-header">
|
<div class="event-header">
|
||||||
{% if event.is_external %}
|
{% if event.is_external %}
|
||||||
<div style="display: flex; align-items: center; gap: var(--spacing-sm); padding: var(--spacing-sm) var(--spacing-md); background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: var(--radius); margin-bottom: var(--spacing-md); font-size: var(--font-size-sm); color: #475569;">
|
<div style="display: flex; align-items: center; gap: var(--spacing-sm); padding: var(--spacing-sm) var(--spacing-md); background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: var(--radius); margin-bottom: var(--spacing-md); font-size: var(--font-size-sm); color: #475569;">
|
||||||
@ -689,25 +709,6 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if current_user.is_authenticated and current_user.can_access_admin_panel() %}
|
|
||||||
<div style="margin-top: var(--spacing-md); display: flex; gap: 8px; flex-wrap: wrap;">
|
|
||||||
<a href="{{ url_for('admin.admin_calendar_edit', event_id=event.id) }}" class="btn btn-outline" style="font-size: 0.9em;">
|
|
||||||
<svg width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" style="vertical-align: -3px; margin-right: 4px;">
|
|
||||||
<path d="M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"/>
|
|
||||||
<path d="M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"/>
|
|
||||||
</svg>
|
|
||||||
Edytuj wydarzenie
|
|
||||||
</a>
|
|
||||||
{% if event.is_paid %}
|
|
||||||
<a href="{{ url_for('admin.admin_event_payments', event_id=event.id) }}" class="btn btn-outline" style="font-size: 0.9em;">
|
|
||||||
<svg width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" style="vertical-align: -3px; margin-right: 4px;">
|
|
||||||
<path d="M12 1v22M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6"/>
|
|
||||||
</svg>
|
|
||||||
Zarządzaj płatnościami
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if (event.attendees or event.guests) and event.can_user_see_attendees(current_user) %}
|
{% if (event.attendees or event.guests) and event.can_user_see_attendees(current_user) %}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user