1
0
Fork 0
MSU-Course-Alerter/app/views/alerts/index.html.erb

47 lines
1.9 KiB
Plaintext

<%- model_class = Alert -%>
<div class="page-header">
<h1><%=t '.title', :default => model_class.model_name.human.pluralize %></h1>
</div>
<table class="table table-striped">
<thead>
<tr>
<th><%= model_class.human_attribute_name(:id) %></th>
<th><%= model_class.human_attribute_name(:user_id) %></th>
<th><%= model_class.human_attribute_name(:department) %></th>
<th><%= model_class.human_attribute_name(:course) %></th>
<th><%= model_class.human_attribute_name(:sections) %></th>
<th><%= model_class.human_attribute_name(:semester) %></th>
<th><%= model_class.human_attribute_name(:alerted) %></th>
<th><%= model_class.human_attribute_name(:created_at) %></th>
<th><%=t '.actions', :default => t("helpers.actions") %></th>
</tr>
</thead>
<tbody>
<% @alerts.each do |alert| %>
<tr>
<td><%= link_to alert.id, alert_path(alert) %></td>
<td><%= alert.user_id %></td>
<td><%= alert.department %></td>
<td><%= alert.course %></td>
<td><%= alert.sections.reject { |v| v.blank? }.join(', ') %></td>
<td><%= alert.semester %></td>
<td><%= alert.alerted %></td>
<td><%=l alert.created_at %></td>
<td>
<%= link_to t('.edit', :default => t("helpers.links.edit")),
edit_alert_path(alert), :class => 'btn btn-mini' %>
<%= link_to t('.destroy', :default => t("helpers.links.destroy")),
alert_path(alert),
:method => :delete,
:data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
:class => 'btn btn-mini btn-danger' %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= link_to t('.new', :default => t("helpers.links.new")),
new_alert_path,
:class => 'btn btn-primary' %>