Module Sadmin::ArticlesHelper
In: app/helpers/sadmin/articles_helper.rb

Methods

Public Instance methods

[Source]

    # File app/helpers/sadmin/articles_helper.rb, line 3
 3:   def add_article_source_link(name)
 4:     next_pos = @article.sources.blank? ? 1 : @article.sources.map {|opt| opt.position.to_i}.sort.last+1
 5:     link = link_to_function name do |page|
 6:       page.insert_html :bottom, :article_sources_div, :partial => 'source_form' , :object => @article.sources.build(:title => '')
 7:     end
 8:         
 9:     link
10:   end

Devuelve un texto que indica el estado del artículo.

[Source]

    # File app/helpers/sadmin/articles_helper.rb, line 13
13:   def article_state_info(article)
14:     txt = []
15:     
16:     if article.published?
17:       txt << content_tag(:span, t('sadmin.articles.publicado_en', :en => published_info(article)), :class => "published_notice")
18:     else
19:       if article.draft?
20:         txt << content_tag(:span, t('sadmin.articles.es_borrador'), :class => "draft_notice")
21:       else
22:         txt << content_tag(:span, t('sadmin.articles.publicara_el', :fecha => I18n.localize(evt.published_at, :format => :short)), :class => "unpublished_notice") unless article.published_at.nil?
23:       end
24:     end
25:     
26:     txt.join("<br />")
27:   end

[Validate]