publisher_helper.rb 966 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
#   Copyright (c) 2010-2011, Diaspora Inc.  This file is
#   licensed under the Affero General Public License version 3 or later.  See
#   the COPYRIGHT file.

module PublisherHelper
  def remote?
    params[:controller] != "tags"
  end

10 11 12
  def all_aspects_selected?(selected_aspects)
    @all_aspects_selected ||= all_aspects.size == selected_aspects.size
  end
Steffen van Bergerem's avatar
Steffen van Bergerem committed
13 14 15

  def service_button(service)
    content_tag :div,
16 17 18 19 20 21 22
                class:   "btn btn-link service_icon dim",
                title:   "#{service.provider.titleize} (#{service.nickname})",
                id:      "#{service.provider}",
                maxchar: "#{service.class::MAX_CHARACTERS}",
                data:    {toggle: "tooltip", placement: "bottom"} do
      if service.provider == "wordpress"
        content_tag(:span, "", class: "social_media_logos-wordpress-16x16")
Steffen van Bergerem's avatar
Steffen van Bergerem committed
23
      else
24
        content_tag(:i, "", class: "entypo-social-#{ service.provider } small")
Steffen van Bergerem's avatar
Steffen van Bergerem committed
25 26 27
      end
    end
  end
28
end