Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indicate Event in progress #1231

Merged
merged 17 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/controllers/admin/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ def renewEvent(eventId):
@admin_bp.route('/event/<eventId>/edit', methods=['GET','POST'])
def eventDisplay(eventId):
pageViewsCount = EventView.select().where(EventView.event == eventId).count()
current_time = datetime.now().time()
current_date = datetime.now().date()
AravDe marked this conversation as resolved.
Show resolved Hide resolved
if request.method == 'GET' and request.path == f'/event/{eventId}/view':
viewer = g.current_user
event = Event.get_by_id(eventId)
Expand Down Expand Up @@ -277,6 +279,8 @@ def eventDisplay(eventId):
# Event Edit
if 'edit' in rule.rule:
return render_template("admin/createEvent.html",
current_time = current_time,
current_date = current_date,
AravDe marked this conversation as resolved.
Show resolved Hide resolved
eventData = eventData,
futureTerms=futureTerms,
event = event,
Expand Down
16 changes: 12 additions & 4 deletions app/templates/eventNav.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,23 @@
{% if g.current_user.isAdmin %}
{{ eventheader(page_title, event, 'large', isNewEvent) }}
{% endif %}
{% set alertClass = "alert-danger" if isPastEnd else "alert-warning"%}
{% set display = "" if isPastEnd or event.isCanceled else "d-none"%}
indicate_Event_In_Prog
{% set isCurrentDate = current_date == event.startDate %}
{% set isCurrentTime = current_time < event.timeEnd and current_time > event.timeStart %}
{% set display = "" if eventPast or event.isCanceled or isCurrentDate or isCurrentTime else "d-none"%}
{% set alertClass = ("alert-success" if isCurrentTime else ( "alert-danger" if eventPast else "alert-warning")) %}
<div class = "{{alertClass}} {{display}} mb-2 pb-2 pt-2" role="alert">
{% if isPastEnd and event.isCanceled %}
This is a past event and it was canceled.
{% elif isPastEnd %}
This is a past event.
indicate_Event_In_Prog
{% elif isCurrentDate and isCurrentTime %}
This event is happening right now
AravDe marked this conversation as resolved.
Show resolved Hide resolved
{% elif eventPast %}
This is a past event and ended on {{ event.endDate }} at {{ event.timeEnd }}
{% elif event.isCanceled %}
This event has been canceled.
{% elif not eventPast %}
Event is in future
{% endif %}
</div>
</div>
Expand Down
Loading