Open-Source-Access-Control-.../app/views/resources/index.html.erb
2014-02-09 05:01:52 -07:00

53 lines
1.5 KiB
Plaintext
Executable File

<link href="/bootstrap/css/bootstrap-theme.min.css" type="text/css" />
<link href="/bootstrap/css/bootstrap.min.css" type="text/css" />
<script src="/bootstrap/js/bootstrap.min.js" type="text/javascript" ></script>
<style>
.thumbnail { height: 150px; position: relative; }
.thumbnail .ownership,
.thumbnail .disposed
{ position: absolute; top: 1px;
text-shadow:
-1px -1px 0 #fff,
1px -1px 0 #fff,
-1px 1px 0 #fff,
1px 1px 0 #fff;
font-weight: bold; left: 10px; }
.thumbnail .disposed { color: red; }
.thumbnail h4 { position: absolute; bottom: 1px; margin-bottom: 1px; }
</style>
<h1 class="col-sm-4">Lab Resources
<%= link_to 'Add Resource', new_resource_path, :class => "btn btn-success" if can? :create, Resource %>
</h1>
<h3 class="col-sm-2">Featured item:</h3>
<%= render @featured_resource %>
<div class="row">
<% unless @resources.blank? %>
<div class="panel-group col-sm-8" 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" data-toggle="collapse" data-parent="#accordion" href="#collapse_cat_<%= category.id %>">
<h4 class="panel-title">
<%= category.name %>
</h4>
</div>
<div id="collapse_cat_<%= category.id %>" class="panel-collapse collapse">
<div class="panel-body">
<%= render resources %>
</div>
</div>
</div>
<% end %>
</div>
<% end %>
</div>
<br />