Welcome to mirror list, hosted at ThFree Co, Russian Federation.

publisher_helper.rb « helpers « app - github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4afe09c4abc981274b022a857d27aa2f02a82b68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#   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

  def all_aspects_selected?(selected_aspects)
    @all_aspects_selected ||= all_aspects.size == selected_aspects.size
  end

  def service_button(service)
    content_tag :div,
                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")
      else
        content_tag(:i, "", class: "entypo-social-#{ service.provider } small")
      end
    end
  end
end