Sha256: da6f48639fab1da61b2d7eef88ecb1a47182bd020e4df94fe73a99ee27bcaf52

Contents?: true

Size: 715 Bytes

Versions: 23

Compression:

Stored size: 715 Bytes

Contents

module MyForum
  module PrivateMessagesHelper

    def new_pm_button
      return unless current_user
      content_tag :div, class: 'new_pm_button' do
        link_to t('my_forum.create_new_pm'), new_private_message_path, class: 'btn btn-primary'
      end
    end

    def reply_pm_button(pm)
      return unless current_user
      content_tag :div, class: 'reply_pm_button' do
        link_to t('my_forum.reply_for_pm'), new_private_message_path(reply: true, reply_for_id: pm.id), class: 'btn btn-primary'
      end
    end

    def new_private_messages_count_bage
      return unless current_user
      return if (count = new_pm_count).eql?(0)
      content_tag(:span, count, class: 'badge')
    end

  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
my_forum-0.0.1.beta4 app/helpers/my_forum/private_messages_helper.rb
my_forum-0.0.1.beta3 app/helpers/my_forum/private_messages_helper.rb
my_forum-0.0.1.beta2 app/helpers/my_forum/private_messages_helper.rb