publisher_helper.rb 935 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

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