More resource tweaks
This commit is contained in:
@@ -34,7 +34,13 @@
|
||||
<br/>
|
||||
<%= f.text_field :status %>
|
||||
</p>
|
||||
<% if can? :assign_user, @resource %>
|
||||
|
||||
<p>
|
||||
<%= f.label :disposed_at, "Disposed?" %><br />
|
||||
<%= f.date_select :disposed_at, include_blank: true %>
|
||||
</p>
|
||||
|
||||
<% if can? :assign_user, @resource %>
|
||||
<p>
|
||||
<%= f.label :user_id, "Owner" %>
|
||||
<br />
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
<% if resource.user %>
|
||||
<span class="ownership">Owned by:<br/><%= resource.user.name %></span>
|
||||
<% end %>
|
||||
<% if resource.disposed_at %>
|
||||
<span class="disposed">Disposed:<br/><%= resource.disposed_at.to_date %></span>
|
||||
<% end %>
|
||||
<%= link_to(resource) do %>
|
||||
<%= image_tag(resource.picture.url(:thumb)) if resource.picture? %>
|
||||
<h4><%=h resource.name %></h4>
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
<h1>Lab Resources
|
||||
<%= link_to 'Add Resource', new_resource_path, :class => "btn btn-success" if can? :create, Resource %>
|
||||
</h1>
|
||||
|
||||
|
||||
<link href="/bootstrap/css/bootstrap-theme.min.css" type="text/css" />
|
||||
@@ -9,10 +6,28 @@
|
||||
|
||||
<style>
|
||||
#accordion .thumbnail { height: 150px; position: relative; }
|
||||
#accordion .thumbnail .ownership { position: absolute; top: 1px; text-shadow: 0.1em 0.1em 0.2em white; font-weight: bold; left: 10px; }
|
||||
#accordion .thumbnail .ownership,
|
||||
#accordion .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; }
|
||||
#accordion .thumbnail .disposed { color: red; }
|
||||
#accordion .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| %>
|
||||
@@ -31,6 +46,7 @@
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
|
||||
@@ -3,9 +3,13 @@
|
||||
<h2><%=h @resource.name %>
|
||||
<%= link_to 'Back', resources_path, class: "btn btn-default" %>
|
||||
<%= link_to 'Edit', edit_resource_path(@resource), class: "btn btn-primary" %>
|
||||
<%= link_to 'Delete', resource_path(@resource), {:confirm => 'Are you sure you want to delete this forever?', :method => :delete, :class => "btn btn-danger"} if can? :destroy, @resource %>
|
||||
</h2>
|
||||
|
||||
<% if @resource.user || @resource.owner %>
|
||||
<p>
|
||||
<b>Owner:</b>
|
||||
<%=h (@resource.user || @resource.owner).name %>
|
||||
</p>
|
||||
<% end %>
|
||||
<p>
|
||||
<b>Category:</b>
|
||||
<%=h @resource.category.name if !@resource.category.blank? %>
|
||||
@@ -24,6 +28,11 @@
|
||||
<p>
|
||||
<b>Status/Location:</b>
|
||||
<%=h @resource.status %>
|
||||
|
||||
<% if @resource.disposed_at %>
|
||||
<b>Disposed:</b>
|
||||
<%=h @resource.disposed_at.to_date %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -43,3 +52,4 @@
|
||||
|
||||
|
||||
|
||||
<%= link_to 'Delete', resource_path(@resource), {:confirm => 'Are you sure you want to delete this forever?', :method => :delete, :class => "btn btn-danger"} if can? :destroy, @resource %>
|
||||
|
||||
Reference in New Issue
Block a user