mirror of
https://github.com/lucaspalomodevelop/eventcally.git
synced 2026-03-13 00:07:22 +00:00
Add attendance mode to event lists #167
This commit is contained in:
parent
301e610694
commit
39546edb1c
@ -180,6 +180,7 @@ class EventSearchItemSchema(EventRefSchema):
|
||||
organizer = fields.Nested(OrganizerRefSchema)
|
||||
organization = fields.Nested(OrganizationRefSchema, attribute="admin_unit")
|
||||
categories = fields.List(fields.Nested(EventCategoryRefSchema))
|
||||
attendance_mode = EnumField(EventAttendanceMode)
|
||||
|
||||
|
||||
class EventListRequestSchema(PaginationRequestSchema):
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -259,8 +259,14 @@
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro render_attendance_mode_pill(event) %}
|
||||
{% if event.attendance_mode and event.attendance_mode.value != 1 %}
|
||||
<span class="badge badge-pill badge-info">{{ event.attendance_mode | loc_enum }}</span>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro render_event_warning_pills(event) %}
|
||||
{{ render_event_status_pill(event) }} {{ render_booked_up_pill(event) }}
|
||||
{{ render_event_status_pill(event) }} {{ render_booked_up_pill(event) }} {{ render_attendance_mode_pill(event) }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro render_event_review_status_pill(event) %}
|
||||
|
||||
@ -80,6 +80,19 @@
|
||||
return '';
|
||||
}
|
||||
|
||||
function render_attendance_mode_pill(event) {
|
||||
if (event.attendance_mode != null) {
|
||||
if (event.attendance_mode == "online") {
|
||||
return '<span class="badge badge-pill badge-info">{{ _('EventAttendanceMode.online') }}</span>';
|
||||
}
|
||||
if (event.attendance_mode == "mixed") {
|
||||
return '<span class="badge badge-pill badge-info">{{ _('EventAttendanceMode.mixed') }}</span>';
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
function render_booked_up_pill(event) {
|
||||
if (event.booked_up) {
|
||||
return '<span class="badge badge-pill badge-warning">{{ _('Booked up') }}</span>';
|
||||
@ -89,7 +102,7 @@
|
||||
}
|
||||
|
||||
function render_event_warning_pills(event) {
|
||||
return render_event_status_pill(event) + ' ' + render_booked_up_pill(event);
|
||||
return render_event_status_pill(event) + ' ' + render_booked_up_pill(event) + ' ' + render_attendance_mode_pill(event);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@ -26,6 +26,7 @@ def event_suggestion_review(event_suggestion_id):
|
||||
@app.route(
|
||||
"/event_suggestion/<int:event_suggestion_id>/reject", methods=("GET", "POST")
|
||||
)
|
||||
@auth_required()
|
||||
def event_suggestion_reject(event_suggestion_id):
|
||||
event_suggestion = EventSuggestion.query.get_or_404(event_suggestion_id)
|
||||
access_or_401(event_suggestion.admin_unit, "event:verify")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user