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

delete all helper classes

parent 735b71ba
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 194 deletions
module AboutHelper
end
module ApplicationHelper
def bootstrap_class_for flash_type
{success: "alert-success", error: "alert-danger", alert: "alert-warning", notice: "alert-info"}[flash_type] || flash_type.to_s
end
def flash_messages(opts = {})
flash.each do |msg_type, message|
concat(content_tag(:div, message, class: "alert #{bootstrap_class_for(msg_type)} fade in") do
concat content_tag(:button, 'x', class: "close", data: {dismiss: 'alert'})
concat message
end)
end
nil
end
end
module BookmarksHelper
##
# x objetos educacionais
def bookmark_length(user)
count = user.bookmarks.count
if count > 0
"#{count} objetos"
else
'nenhum item'
end
end
end
module CollectionsHelper
##
# x objetos educacionais
def collection_length(collection)
count = collection.learning_objects.count
if count > 0
"#{count} objetos"
else
'coleção vazia'
end
end
def end_of_column_collection(index)
index % 3 == 0
end
def render_collection(orientation, collection)
case (orientation)
when "vertical"
render "collections/collection_vertical", collection: collection
when "horizontal"
render "collections/collection_horizontal", collection: collection
else
render "collections/collection_horizontal", collection: collection
end
end
end
module FeedbackHelper
end
module LearningObjects::BuilderHelper
def get_mime_types learning_object
@learning_object.object_type.mime_types.map(&:extension)
end
end
\ No newline at end of file
module LearningObjectsHelper
def display_object_type(learning_object)
case learning_object.default_attachment.mime_type
when /audio\/*/i then audio_tag(learning_object.cache_link, controls: true)
when /video\/mp4/i then video_tag(learning_object.cache_link.to_s, autobuffer: true, poster: learning_object_thumbnail(learning_object))
when /application\/(x-)?pdf/i then "<iframe src=\"/pdfjs/web/viewer.html?file=#{learning_object.retrieve_link }\" style=\"border: 0 \" width=\"125%\" height=\"280\" frameborder=\"0\" scrolling=\"no\"></iframe>".html_safe
else image_tag learning_object_thumbnail(learning_object, 'large'), alt: learning_object_title(learning_object), class: 'thumbnail'
end
end
def show_categories(categories = [])
categories.to_s
end
def learning_object_thumbnail(learning_object, size = "")
thumbnail = learning_object.default_thumbnail
return thumbnail unless thumbnail.blank?
unless learning_object.object_type.blank?
case learning_object.object_type.name
when 'Vídeo' then return 'video.png'
when 'Imagem' then return 'image.png'
when 'Hipertexto' then return 'text.png'
when 'Animação/simulação' then return 'animation.png'
when 'Software Educacional' then return 'software.png'
when 'Áudio' then return 'audio.png'
when 'Experimento prático' then return 'simulator.png'
end
end
(size == 'large') ? 'learning-object-preview-large.png' : 'learning-object-preview.png'
end
def learning_object_title(learning_object)
learning_object.name
end
def render_learning_object(orientation, learning_object)
case (orientation)
when 'vertical' then render 'learning_objects/learning_object_vertical', learning_object: learning_object
when 'horizontal' then render 'learning_objects/learning_object_horizontal', learning_object: learning_object
else render 'learning_objects/learning_object_horizontal', learning_object: learning_object
end
end
def social_share(learning_object)
set_meta_tags og: {
title: learning_object.name,
type: 'website',
description: learning_object.description,
image: learning_object.default_thumbnail
}
set_meta_tags fb: {
app_id: '745857965514514'
}
end
end
module LinksHelper
end
module Management::CarouselHelper
end
module Management::ObjectTypesHelper
def show_delete_button?(object_type)
object_type.name =~ /outros/i ? false : true
end
def mime_types(mime_types = [])
mime_types.map { |mime_type| mime_type.extension }.reduce { |i, ext| i + ', '+ ext }
end
end
module Management::UsersHelper
def translate_role(name)
nome = case name
when "teacher" then "Professor"
when "admin" then "Administrador"
when "curator" then "Curador"
end
nome
end
end
module Management::WelcomeHelper
end
module Search::SolrHelper
def object_thumbnail(handle)
# return "http://demo.dspace.org/xmlui/bitstream/handle/10673/4/kitty-1257950690.jpg.jpg?sequence=10&isAllowed=y"
return "logo.png"
end
end
module UsersHelper
def current_user_page?(user)
current_user.id == user.id
end
def learning_objects_number(learning_objects)
if learning_objects.count == 0
return 'Nenhum item'
end
pluralize(learning_objects.count, 'item', 'itens')
end
def render_user(orientation, user)
# case (orientation)
# when "vertical"
# render "users/user_vertical", user: user
# when "horizontal"
# render "users/user_horizontal", user: user
# else
# render "users/user_horizontal", user: user
# end
render "users/user_horizontal", user: user
end
end
\ No newline at end of file
module WelcomeHelper
end
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