Forked from
Digital Experience Group / UNL Resource Scheduler
64 commits behind the upstream repository.
-
Jeff Sturek authoredJeff Sturek authored
events.erb 5.37 KiB
<section class="dcf-grid dcf-col-gap-vw">
<div class="dcf-col-100% dcf-col-75%-start@sm">
<div id="pagetitle">
<h3>Events</h3>
</div>
<ul class="wdn_tabs">
<li class="<%='selected' if tab == 'upcoming' %>"><a href="?tab=upcoming">Upcoming</a></li>
<li class="<%='selected' if tab == 'past' %>"><a href="?tab=past">Past</a></li>
</ul>
<div class="wdn_tabs_content">
<div class="event-page">
<table class="event-list">
<thead>
<tr>
<th>Title</th>
<th>Date/Location</th>
<th>Signups</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<% events.each do |event| %>
<tr>
<td class="small-hidden">
<a href="<%= @space.admin_events_href %><%= event.id %>/edit/"><%= event.title %></a>
</td>
<td>
<ul>
<li>
<%= event.start_time.in_time_zone.strftime('%m/%d/%Y @ %l:%M %P') %><br>
<%= event.location.name %>
</li>
</ul>
</td>
<td>
<a href="<%= @space.admin_events_href %><%= event.id %>/signup_list/"><%= event.signups.count %> signed up</a>
<% unless event.max_signups.nil? %>
<br><%= event.max_signups %> total slots
<% end %>
</td>
<td>
<form class="delete-event delete-form" action="<%= @space.admin_events_href %><%=event.id%>/delete/" method="POST">
<button type="submit" class="dcf-btn">Delete</button>
</form>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% if total_pages > 1 %>
<% append_script_declaration("WDN.loadCSS('/wdn/templates_4.1/css/modules/pagination.css');") %>
<div style="text-align: center;">
<div style="display: inline-block;">
<ul id="pending-pagination" class="wdn_pagination" data-tab="pending" style="padding-left: 0;">
<% if page != 1 %>
<li class="arrow prev"><a href="?tab=<%= tab %>&page=<%= page-1 %>" title="Go to the previous page">← prev</a></li>
<% end %>
<% before_ellipsis_shown = false; after_ellipsis_shown = false %>
<% (1..total_pages).each do |i| %>
<% if i == page %>
<li class="selected"><span><%= i %></span></li>
<% elsif (i <= 3 || i >= total_pages - 2 || i == page - 1 ||
i == page - 2 || i == page + 1 || $i == page + 2) %>
<li><a href="?tab=<%= tab %>&page=<%= i %>" title="Go to page <%= i %>"><%= i %></a></li>
<% elsif (i < page && !before_ellipsis_shown) %>
<li><span class="ellipsis">...</span></li>
<% before_ellipsis_shown = true %>
<% elsif (i > page && !after_ellipsis_shown) %>
<li><span class="ellipsis">...</span></li>