21 lines
565 B
Ruby
21 lines
565 B
Ruby
class TextMarqueesController < ApplicationController
|
|
def widget
|
|
subpart = OrbitHelper.get_current_widget
|
|
marquee = Marquee.find(OrbitHelper.widget_custom_value)
|
|
texts = marquee.marquee_texts.collect do |mqt|
|
|
{
|
|
"text" => mqt.title,
|
|
"speed" => mqt.speed,
|
|
"url" => (mqt.url || ""),
|
|
"content" => (mqt.url.nil? ? "<a speed='#{mqt.speed}'>#{mqt.title}</a>" : "<a href='#{mqt.url}' target='_blank' speed='#{mqt.speed}'>#{mqt.title}</a>")
|
|
}
|
|
end
|
|
{
|
|
"texts" => texts,
|
|
"extras" => {
|
|
"subpart-id" => subpart.id.to_s
|
|
}
|
|
}
|
|
end
|
|
|
|
end |