Sha256: eb5b3916692cdd3082009e468d0ff618535986cbd92fb877e74e0dee8058575c

Contents?: true

Size: 863 Bytes

Versions: 2

Compression:

Stored size: 863 Bytes

Contents

module C80NewsTz
  module ApplicationHelper

    include LocalTimeHelper

    def render_news_block(is_news_page=false,page=1)


      if is_news_page
        per_page = C80NewsTz::Prop.first.per_page
        news = Fact.paginate(:page => page,:per_page => per_page)
      else
        per_widget = C80NewsTz::Prop.first.per_widget
        news = Fact.limit(per_widget)
      end

      render :partial => "shared/news_block",
             :locals => {
                 :news_list => news,
                 :is_news_page => is_news_page
             }
    end

    def render_one_fact(fact)
      render :partial => "shared/fact",
             :locals => {
                 fact: fact
             }
    end

    def url_for_fact(fact)
      "news/#{fact.slug}"
    end

    def apph_url_for_rubric(rubric_slug)
      "rubrics/#{rubric_slug}"
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
c80_news_tz-0.1.1.1 app/helpers/c80_news_tz/application_helper.rb
c80_news_tz-0.1.1.0 app/helpers/c80_news_tz/application_helper.rb