Skip to content
Snippets Groups Projects
Commit ffcd8629 authored by Mateus Rambo Strey's avatar Mateus Rambo Strey
Browse files

fix thumbnail helper

parent 2fbfe11c
No related branches found
No related tags found
No related merge requests found
......@@ -4,9 +4,13 @@ module LearningObjectsHelper
categories.to_s
end
def learning_object_thumbnail(learning_object)
if learning_object.thumbnail == "thumbnai"
image_tag('learning-object-preview.png')
def learning_object_thumbnail(learning_object, size = "")
if learning_object.thumbnail.nil?
if size == "large"
image_tag('learning-object-preview-large.png')
else
image_tag('learning-object-preview.png')
end
else
image_tag learning_object.thumbnail, alt: learning_object_title(learning_object)
end
......
......@@ -25,13 +25,7 @@
<div class="row learning-object">
<div class="col-md-7">
<%=
if (@learning_object.thumbnail == "thumbnai")
image_tag 'learning-object-preview-large.png', class: "thumbnail"
else
image_tag @learning_object.thumbnail, class: "thumbnail"
end
%>
<%= learning_object_thumbnail @learning_object, "large" %>
<div class="stats">
<span class="glyphicon glyphicon-eye-open"><%= @learning_object.views %>&nbsp;</span>
<span class="glyphicon glyphicon-star"><%= @learning_object.likes %>&nbsp;</span>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment