Skip to content
Open
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
16 changes: 9 additions & 7 deletions app/templates/events/eventList.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ <h1 class="text-center">Events List for {{selectedTerm.description}}</h1>
{% endif %}
{% if user.isCeltsAdmin or user.isProgramManagerFor(event.program)%}
{% set link_class = 'link-secondary' if event.isPastStart else 'link-primary' %}
<td><a href="/event/{{event.id}}/edit" class="{{link_class}}">{{event.name}}</a></td>
<td><a href="/event/{{event.id}}/view" class="{{link_class}}">{{event.name}}</a></td>
{% else %}
<td><a href="/event/{{event.id}}/view" class="link-primary">{{event.name}}</a></td>
{% endif %}
Expand All @@ -128,8 +128,8 @@ <h1 class="text-center">Events List for {{selectedTerm.description}}</h1>
<td nowrap>{{event.timeStart.strftime('%-I:%M %p')}} - {{event.timeEnd.strftime('%-I:%M %p')}}</td>
<td class="text-dark">{{event.location}}</td>
{% endif %}
{% if user.isAdmin %}
<td>
{% if user.isCeltsAdmin or user.isProgramManagerFor(event.program)%}
<td style="white-space: nowrap;">
{% if event.isPastStart %}
{% set isPastStart = "true" %}
{% else %}
Expand All @@ -141,12 +141,14 @@ <h1 class="text-center">Events List for {{selectedTerm.description}}</h1>
<button class="btn {{btn_class}}" onclick="showEmailModal({{event.id}}, 'Unknown', {{ selectedTerm }}, {{ isPastStart }}, '{{defaultTemplate}}')">
<span class="bi bi-envelope-fill"> {{btn_text}}</span>
</button>

<a class="btn btn-primary ms-2"href="/event/{{ event.id }}/edit"><span class="bi bi-pencil-fill"></span> Edit Event </a>
</td>

<a class="btn {{btn_class}} ms-2" href="/event/{{ event.id }}/edit"><span class="bi bi-pencil-fill"></span> Edit Event</a>
</td>
{% else %}
<td>
{% if user.isProgramManagerFor(event.program) %}
{% set btn_class = 'btn-secondary' if event.isPastStart or event.isCanceled else 'btn-primary' %}
<a class="btn {{btn_class}}" href="/event/{{ event.id }}/edit"><span class="bi bi-pencil-fill"></span> Edit Event</a>
{% endif %}
Comment on lines +148 to +151
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the {% else %} branch of {% if user.isCeltsAdmin or user.isProgramManagerFor(event.program) %}, the nested {% if user.isProgramManagerFor(event.program) %} condition can never be true, so this Edit button code is unreachable. Remove the dead conditional/code, or restructure the outer condition if you intended program managers to hit this branch (e.g., show only Edit without Invite).

Suggested change
{% if user.isProgramManagerFor(event.program) %}
{% set btn_class = 'btn-secondary' if event.isPastStart or event.isCanceled else 'btn-primary' %}
<a class="btn {{btn_class}}" href="/event/{{ event.id }}/edit"><span class="bi bi-pencil-fill"></span> Edit Event</a>
{% endif %}

Copilot uses AI. Check for mistakes.
{% if event.id in rsvpedEventsID %}
<button type="button" class="btn btn-danger" onclick="removeRsvpForEvent({{event.id}})">Remove RSVP</button>
{% elif (not event.isPastStart) and (event.isRsvpRequired) and (not event.isCanceled) %}
Expand Down