Skip to content
Snippets Groups Projects
Commit 7c73bd16 authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello
Browse files

Merge branch 'master' of gitlab.c3sl.ufpr.br:portalmec/portalmec

parents c1f2394d 1d10f187
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? || learning_object.thumbnail == "thumbnai" # TODO: remove "thumbnai" when possible
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
......
......@@ -20,7 +20,7 @@ class OrientDb::Base
end
def all_from_offset_to_limit(offset, limit)
objects_hash = connection.query "SELECT FROM #{odb_class} SKIP #{offset}", :limit => limit
objects_hash = connection.query "SELECT FROM #{odb_class} LIMIT #{limit} SKIP #{offset}", :limit => limit
objects = build_objects(objects_hash) || []
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>
......
......@@ -15,7 +15,7 @@ namespace :thumbnail do
begin
# Get items from dspace (from offset to offset+limit)
items = learning_object_repository.all_from_offset_to_limit(limit,offset)
items = learning_object_repository.all_from_offset_to_limit(offset,limit)
rescue
# Sleeps for a while to wait database's recovery
sleep(30.seconds)
......
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