Open-Source-Access-Control-.../app/views/resources/index.html.erb

32 lines
833 B
Plaintext
Raw Normal View History

<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>
<% 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>
<% end %>
2014-02-09 09:08:08 +00:00
</div>
<% end %>
<br />