Module: Knitkit::Extensions::Railties::ActionView::Helpers::BlogHelper
- Defined in:
- lib/knitkit/extensions/railties/action_view/helpers/blog_helper.rb
Instance Method Summary collapse
- #blog_add_comment_form ⇒ Object
- #blog_pagination(css_class, params) ⇒ Object
- #blog_recent_approved_comments ⇒ Object
- #blog_rss_links(link_title = 'RSS Feed') ⇒ Object
- #blog_topics(css_class = 'tag_link') ⇒ Object
Instance Method Details
#blog_add_comment_form ⇒ Object
8 9 10 |
# File 'lib/knitkit/extensions/railties/action_view/helpers/blog_helper.rb', line 8 def blog_add_comment_form render :partial => 'add_comment' if current_user end |
#blog_pagination(css_class, params) ⇒ Object
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/knitkit/extensions/railties/action_view/helpers/blog_helper.rb', line 46 def blog_pagination(css_class, params) return will_paginate @contents, :class => css_class, :params => { :section_id => params[:section_id], :per_page => params[:per_page], :format => params[:format], :only_path => true, :use_route => params[:use_route], :scope => main_app } end |
#blog_recent_approved_comments ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/knitkit/extensions/railties/action_view/helpers/blog_helper.rb', line 32 def blog_recent_approved_comments if @published_content.content.comments.recent.approved.empty? return 'No Comments' else html = '' @published_content.content.comments.recent.approved.each do |comment| html += render :partial => 'comment', :locals => {:comment => comment} end return raw html end end |
#blog_rss_links(link_title = 'RSS Feed') ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/knitkit/extensions/railties/action_view/helpers/blog_helper.rb', line 24 def blog_rss_links(link_title='RSS Feed') if params[:action] == 'tag' return link_to link_title, main_app.blog_tag_url(params[:section_id], params[:tag_id], :rss), :target => '_blank' else return link_to link_title, main_app.blogs_url(params[:section_id], :rss), :target => '_blank' end end |
#blog_topics(css_class = 'tag_link') ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/knitkit/extensions/railties/action_view/helpers/blog_helper.rb', line 12 def blog_topics(css_class='tag_link') html = '' @website_section.get_topics.each do |tag| html += '<div class="'+css_class+'">' html += link_to(tag.name, main_app.blog_tag_path(@website_section.id, tag.id)) html += '</div>' end raw html end |