2014-02-09 07:54:03 +00:00
|
|
|
<h1>Resources</h1>
|
|
|
|
|
2014-02-09 09:08:08 +00:00
|
|
|
<%= link_to 'Add Equipment', new_resource_path, :class => "btn" if can? :create, Resource %>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.collapsible .thumbnail { height: 150px; }
|
|
|
|
</style>
|
2014-02-09 07:54:03 +00:00
|
|
|
|
|
|
|
<% unless @resources.blank? %>
|
2014-02-09 09:08:08 +00:00
|
|
|
<div class="panel-group" id="accordion">
|
|
|
|
<% @resources.sort_by{|r| [r.category_name,r.name] }.group_by(&:category).each do |category,resources| %>
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h4 class="panel-title">
|
|
|
|
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
|
|
|
|
<%= category.name %>
|
|
|
|
</a>
|
|
|
|
</h4>
|
|
|
|
</div>
|
|
|
|
<div id="collapseOne" class="panel-collapse collapse in">
|
|
|
|
<div class="panel-body">
|
|
|
|
<%= render resources %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2014-02-09 07:54:03 +00:00
|
|
|
<% end %>
|
2014-02-09 09:08:08 +00:00
|
|
|
</div>
|
2014-02-09 07:54:03 +00:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|