Mooooore resources

This commit is contained in:
2014-02-09 05:01:52 -07:00
parent a2cbcac798
commit 2c4cd4a020
7 changed files with 63 additions and 11 deletions

View File

@@ -47,7 +47,7 @@
<%= link_to 'People', users_path if can? :read, User %>
</li>
<li class="active">
<%= link_to 'Tools', resources_path if can? :read, Resource %>
<%= link_to 'Tools & Resources', resources_path if can? :read, Resource %>
</li>
<li>
<%= link_to 'Access Cards', cards_path if can? :manage, Card %>

View File

@@ -40,13 +40,11 @@
<%= f.date_select :disposed_at, include_blank: true %>
</p>
<% if can? :assign_user, @resource %>
<p>
<%= f.label :user_id, "Owner" %>
<br />
<%= select(:resource, :user_id, options_from_collection_for_select(@users, :id, :name, @resource.user_id), include_blank: true) %>
</p>
<% end %>
<p>
<%= f.label :donatable %><br />

View File

@@ -5,9 +5,9 @@
<script src="/bootstrap/js/bootstrap.min.js" type="text/javascript" ></script>
<style>
#accordion .thumbnail { height: 150px; position: relative; }
#accordion .thumbnail .ownership,
#accordion .thumbnail .disposed
.thumbnail { height: 150px; position: relative; }
.thumbnail .ownership,
.thumbnail .disposed
{ position: absolute; top: 1px;
text-shadow:
-1px -1px 0 #fff,
@@ -15,8 +15,8 @@
-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; }
.thumbnail .disposed { color: red; }
.thumbnail h4 { position: absolute; bottom: 1px; margin-bottom: 1px; }
</style>

View File

@@ -120,7 +120,54 @@
<% end %>
<% end %>
</p>
<p>
<style>
.row {
margin-left: -15px;
margin-right: -15px;
}
.col-sm-2 {
width: 16.666666666666664%;
float: left;
position: relative;
min-height: 1px;
padding-left: 15px;
padding-right: 15px;
}
.thumbnail {
display: block;
padding: 4px;
margin-bottom: 20px;
line-height: 1.428571429;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 4px;
-webkit-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
.thumbnail a>img {
display: block;
max-width: 100%;
height: auto;
margin-left: auto;
margin-right: auto;
}
.thumbnail a:hover { color: black; }
.thumbnail { height: 150px; position: relative; }
.thumbnail .ownership,
.thumbnail .disposed
{ display: none; }
.thumbnail h4 { position: absolute; bottom: 1px; margin-bottom: 1px; }
.clearfix { clear: both }
</style>
<b>Resources: </b><%= link_to "+ Add", new_resource_path, :class => 'btn' if can? :create, Resource %>
<div class="row"><%= render @user.resources if @user.resources %></div>
<div class="clearfix"></div>
</p>
<p>
<b>Waiver?</b>
<%= @user.waiver.strftime("%B %d %Y") unless @user.waiver.blank? %>