Module Admin::PollsHelper
In: app/helpers/admin/polls_helper.rb

Methods

Public Instance methods

[Source]

    # File app/helpers/admin/polls_helper.rb, line 17
17:   def add_poll_option_link(name)
18:     next_pos = @poll.options.blank? ? 1 : @poll.options.map {|opt| opt.position.to_i}.sort.last+1
19:     link = link_to_function name do |page|
20:       page.insert_html :bottom, :poll_options_div, :partial => 'option_form' , :object => @poll.options.build(:description => '')
21:     end
22:         
23:     link
24:   end

Devuelve un texto con información relacinada con el estado de la pregunta.

[Source]

    # File app/helpers/admin/polls_helper.rb, line 4
 4:   def poll_state_info(poll)
 5:     txt = []
 6:     txt.push( content_tag(:span, t('admin.polls.Esta_pregunta_es_borrador'), :class => 'draft_notice')) if @poll.draft?
 7:     
 8:     txt.push(content_tag(:span, t('sadmin.news.se_publicara_en', :fecha => I18n.localize(@poll.published_at, :format => :short)), :class => 'unpublished_notice')) if !@poll.draft? && !@poll.published? && @poll.published_at
 9: 
10:     txt.push(content_tag(:span, t('admin.polls.Publicada'), :class => "published_notice")) if poll.published?
11:     
12:     txt.push(content_tag(:span, t('polls.Caducada'), :class => "outdated_notice")) if poll.outdated?
13:     
14:     txt.join('<br />')    
15:   end

[Validate]