osbridge/openconferenceware

View on GitHub
app/views/open_conference_ware/schedule_items/index.html.erb

Summary

Maintainability
Test Coverage
<% page_title "Schedule Items" %>

<table>
  <thead>
    <th>Title</th>
    <th>Start Time</th>
    <th>Duration</th>
    <% if admin? %><th>Controls</th><% end -%>
  </thead>
  <tbody>
<% for schedule_item in @schedule_items %>
  <tr>
    <td><%= link_to h(schedule_item.title), schedule_item_path(schedule_item) %></td>
    <td><%= schedule_item.start_time.localtime.to_s(:db) %></td>
    <td><%= schedule_item.duration %></td>

  <% if admin? %>
    <td class='record-controls'>
    <%= link_to 'Edit', edit_schedule_item_path(schedule_item), :class => "editable" %>
    <%= link_to 'Destroy', schedule_item_path(schedule_item), :data => { :confirm => %{Destroy schedule item "#{schedule_item.title}"?} }, :method => :delete, :class => "deletable" %>
    </td>
  <% end %>
  </tr>
<% end %>
  </tbody>
</table>

<div>
<%= link_to 'New schedule item', new_schedule_item_path, :class => "addable" if admin? %>
<%= link_to 'Back to proposals', event_proposals_path(@event), :class => "cancelable" %>
</div>