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

Fix User Profile Events #1328

Merged
merged 4 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion app/logic/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def getUpcomingEventsForUser(user, asOf=datetime.now(), program=None):
if program:
events = events.where(Event.program == program)

events = events.order_by(Event.startDate, Event.name)
events = events.order_by(Event.startDate, Event.timeStart)

events_list = []
shown_recurring_event_list = []
Expand Down
6 changes: 5 additions & 1 deletion app/static/css/userProfile.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
vertical-align: middle;
}

.ongoing-event{
.past-event{
opacity:0.6;
}

.ongoing-event{
background-color: #cdebaa;
}

dt {
font-weight: normal;
padding: 5px;
Expand Down
15 changes: 13 additions & 2 deletions app/templates/main/userProfile.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,26 @@ <h3 class="accordion-header" id="headingOne">
<th scope="col">Event Name</th>
<th scope="col">Event Date</th>
<th nowrap scope="col">Start Time</th>
<th nowrap scope="col">End Time</th>
<th scope="col">Location</th>
<th scope="col">RSVP Status</th>
</thead>
{% for event in upcomingEvents %}
<tr class="{% if event.startDate == currentDateTime.date() and event.timeStart < currentDateTime.time() %} ongoing-event {% endif %}{% if event.startDate == currentDateTime.date() and not event.timeStart < currentDateTime.time() %} bg-info {% endif %}">

{% set eventStatus = 'future-event' %}
{% if event.isPastStart %}
{% set eventStatus = 'ongoing-event' %}
{% endif %}
{% if event.isPastEnd %}
{% set eventStatus = 'past-event' %}
{% endif %}

<tr class="{{ eventStatus }}">
<td>{{event.program.programName if event.program else '--'}}</td>
<td><a href= '/event/{{event.id}}/view' class="link-primary">{{event.name}}</a></td>
<td nowrap>{{event.startDate.strftime('%m/%d/%Y')}}</td>
<td nowrap>{{ '<i>In Progress</i>' | safe if eventStatus == 'ongoing-event' else event.startDate.strftime('%m/%d/%Y') }}</td>
<td nowrap>{{event.timeStart.strftime('%-I:%M %p')}}</td>
<td nowrap>{{event.timeEnd.strftime('%-I:%M %p')}}</td>
<td>{{event.location}}</td>
{% if (event.isRsvpRequired) and (event.id in rsvpedEvents) %}
<td>You have RSVP'd for this event.</td>
Expand Down
Loading