39 lines
1.3 KiB
Plaintext
Executable File
39 lines
1.3 KiB
Plaintext
Executable File
<h1 class="col-sm-6">Lab Resources
|
|
<%= link_to 'Add Resource', new_resource_path, :class => "btn btn-success" if can? :create, Resource %>
|
|
<%= link_to 'Categories', resource_categories_path, :class => "btn btn-primary" if can? :read, ResourceCategory %>
|
|
<a class="btn btn-default" onclick="$('#accordion .collapse').collapse('toggle')" />Expand/Collapse All</a>
|
|
</h1>
|
|
|
|
<span class="col-sm-2">
|
|
<h3>Featured item:</h3>
|
|
<%= render @featured_resource %>
|
|
</span>
|
|
|
|
<div class="row">
|
|
<% unless @resources.blank? %>
|
|
<div class="panel-group col-sm-8" id="accordion">
|
|
<% @resources.sort_by{|r| [r.resource_category_name,r.name] }.group_by(&:resource_category).each do |resource_category,resources| %>
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading" data-toggle="collapse" data-parent="#accordion" href="#collapse_cat_<%= resource_category.id %>">
|
|
<h4 class="panel-title">
|
|
<%= resource_category.name %>
|
|
</h4>
|
|
</div>
|
|
<div id="collapse_cat_<%= resource_category.id %>" class="panel-collapse collapse">
|
|
<div class="panel-body">
|
|
<% resources.each do |resource| %>
|
|
<div class="col-sm-2">
|
|
<%= render resource %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<br />
|
|
|