publisher_helper.rb 1 KB
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

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