Skip to content
Snippets Groups Projects
agenda.erb 3.73 KiB
<form style="float: right; width: 320px;">
    <div class="offset-field-group">
        <label for="date">Go to another date:</label>
        <div class="date-time-select">
            <span class="wdn-icon-calendar"></span>
            <input style="width: 90%;" id="date" name="date" title="Reservation Date" type="text" class="datepicker" value="<%= date.strftime('%m/%d/%Y') %>" />
        </div>
    </div>
</form>

<div id="pagetitle">
	<h3>Today's Agenda<span class="dcf-subhead"><%= date.strftime('%B %d, %Y') %></h3>
</div>


<h4>
Today's Hours
</h4>
<% unless space_hour.nil? %>
    <%= space_hour.hours.map do |record|
        start_time = date + record[:start].minutes
        end_time = date + record[:end].minutes
        "#{record[:status].capitalize_all}: #{start_time.in_time_zone.strftime('%l:%M %P')} - #{end_time.in_time_zone.strftime('%l:%M %P')}"
    end.join(', ') %>
<% else %>
    The space is open all day.
<% end %>

<h4>
Today's Reservations
</h4>
<% if reservations.empty? %>
No reservations today. Hopefully someone will still come in to use the space!<br>
<% else %>
<table>
    <thead>
        <tr>
            <th>Name</th>
            <th>Resource</th>
            <th>Time</th>
            <th>Actions</th>
        </tr>
    </thead>
    <tbody>
    <% reservations.each do |reservation| %>
        <tr>
            <td>
                <% if reservation.user %>
                <%= reservation.user.full_name %>
                <% elsif !reservation.event.nil? %>
                    <strong>Event:</strong> <%= reservation.event.title %>
                <% end %>
                <% unless reservation.title.nil? || reservation.title.empty? %>
                    <br><small><%= reservation.title %></small>
                <% end %>
            </td>
            <td>
                <%= reservation.resource.name %>
            </td>
            <td>
            	<%= reservation.start_time.in_time_zone.strftime('%l:%M %P') %><br>
            	<%= reservation.length %> minutes
            </td>
            <td>
                <form class="delete-form" method="POST" action="/<%= @space.url_name %>/admin/agenda/reservations/<%= reservation.id %>/remove/">
                <button class="dcf-btn dcf-btn-primary" type="submit">Remove</button>
                </form>
            </td>
        </tr>
    <% end %>