Sha256: ed760fe56f2668203ad4fd7a7156d867ecae470baaf98b08b5d5891cfed37f40

Contents?: true

Size: 1008 Bytes

Versions: 14

Compression:

Stored size: 1008 Bytes

Contents

module Roroacms  
  module CommentsHelper

    # returns the html for the error display for the comments form
    # Params:
    # +content+:: is the Comment ActiveRecord object with the errors

    def comments_error_display(content = nil)

      html = ''

      if content.errors.any?
        html = "<div id='error-explanation'>
  			<h2>Invalid:</h2><ul>"
        content.errors.full_messages.each do |msg|
          html += "<li>#{msg}</li>"
        end
        html += "</ul>
  			</div>"
      end

      html
    end


    # returns a success message if the comment has been saved successfully

    def comments_success_message
      html = '<div class="success">' + I18n.t("helpers.comments_helper.comments_success_message") + '</div>'.html_safe
    end


    # returns true or false as to wether the admin has comments turned on

    def comments_on
      Setting.get('article_comments') == 'Y' && Setting.get('article_comment_type') == 'R'
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
roroacms-0.0.6.9 app/helpers/roroacms/comments_helper.rb
roroacms-0.0.6.8 app/helpers/roroacms/comments_helper.rb
roroacms-0.0.6.7 app/helpers/roroacms/comments_helper.rb
roroacms-0.0.6.6 app/helpers/roroacms/comments_helper.rb
roroacms-0.0.6.5 app/helpers/roroacms/comments_helper.rb
roroacms-0.0.6.4 app/helpers/roroacms/comments_helper.rb
roroacms-0.0.6.2 app/helpers/roroacms/comments_helper.rb
roroacms-0.0.6.1 app/helpers/roroacms/comments_helper.rb
roroacms-0.0.6 app/helpers/roroacms/comments_helper.rb
roroacms-0.0.5 app/helpers/roroacms/comments_helper.rb
roroacms-0.0.4 app/helpers/roroacms/comments_helper.rb
roroacms-0.0.3 app/helpers/roroacms/comments_helper.rb
roroacms-0.0.2 app/helpers/roroacms/comments_helper.rb
roroacms-0.0.1 app/helpers/roroacms/comments_helper.rb