Better use of Rails' tag helpers. Added list view.
This commit is contained in:
parent
869b87bc7b
commit
e3e1871a8f
4 changed files with 63 additions and 24 deletions
|
|
@ -1,32 +0,0 @@
|
|||
<% # Show search results %>
|
||||
|
||||
<% if @packages.length>0 %>
|
||||
<% @packages.each do |package| %>
|
||||
<div class="col-md-3 col-sm-4">
|
||||
<div class="thumbnail">
|
||||
<% if package.screenshots.length>0 %>
|
||||
<% screenshot = package.screenshots.first %>
|
||||
<div style="text-align: center; height: 120px">
|
||||
<%= link_to image_tag(screenshot.image_url('small')),
|
||||
screenshot.image_url('large'),
|
||||
:class => 'fancybox thumbnail',
|
||||
:title => (
|
||||
"#{package.description}" +
|
||||
(screenshot.description.blank? ? '' : " (#{screenshot.description})")
|
||||
)
|
||||
%>
|
||||
</div>
|
||||
<h3><%= package.name %></h3>
|
||||
<p><%= package.description %></p>
|
||||
<% else %>
|
||||
<div style="text-align: center; height: 120px">
|
||||
<%= link_to image_tag("/thumbnail-404.png"),
|
||||
"/path/to/upload/package" %>
|
||||
</div>
|
||||
<h3><%= package.name %></h3>
|
||||
<p><%= package.description %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
Loading…
Add table
Add a link
Reference in a new issue