Sha256: 03b687abde79a5c5cbddb92d7ecfda776549e8cef7fb991639d02a3de6873f07

Contents?: true

Size: 888 Bytes

Versions: 14

Compression:

Stored size: 888 Bytes

Contents

module Proclaim
	module ApplicationHelper
		def comments_tree_for(comments)
			comments.map do |comment, nested_comments|
				commentHtml = render(partial: "proclaim/comments/comment",
				                     formats: [:html],
				                     locals: {
				                     	comment: comment,
				                     	target: "#comment_#{comment.id}_replies"
				                     })

				nestedComments = ""
				if nested_comments.size > 0
					nestedComments = comments_tree_for(nested_comments)
				end

				repliesHtml = content_tag(:div, nestedComments,
				                          id: "comment_#{comment.id}_replies",
				                          class: "replies")

				content_tag(:div, commentHtml + repliesHtml, class: "discussion")
			end.join.html_safe
		end

		def proclaim_title(page_title)
			content_for :proclaim_title, page_title.to_s
		end
	end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
proclaim-0.6.6 app/helpers/proclaim/application_helper.rb
proclaim-0.6.5 app/helpers/proclaim/application_helper.rb
proclaim-0.6.4 app/helpers/proclaim/application_helper.rb
proclaim-0.6.3 app/helpers/proclaim/application_helper.rb
proclaim-0.6.2 app/helpers/proclaim/application_helper.rb
proclaim-0.6.1 app/helpers/proclaim/application_helper.rb
proclaim-0.6.0 app/helpers/proclaim/application_helper.rb
proclaim-0.5.6 app/helpers/proclaim/application_helper.rb
proclaim-0.5.5 app/helpers/proclaim/application_helper.rb
proclaim-0.5.3 app/helpers/proclaim/application_helper.rb
proclaim-0.5.2 app/helpers/proclaim/application_helper.rb
proclaim-0.5.1 app/helpers/proclaim/application_helper.rb
proclaim-0.5.0 app/helpers/proclaim/application_helper.rb
proclaim-0.4.0 app/helpers/proclaim/application_helper.rb