Sha256: 3ec3cb31276d9f8afe501eea8435bcd856743f42d8ae24bfddc66fe64e3ae822

Contents?: true

Size: 1.15 KB

Versions: 30

Compression:

Stored size: 1.15 KB

Contents

module Tags::WidgetTags
  include TrustyCms::Taggable

  desc "Widget of sharing icons"
  tag "rad_share_widget" do |tag|
    attributes = tag.attr.to_options
    url = attributes[:url].nil? ? request.url : attributes[:url]
    message = attributes[:message].nil? ? "Check out #{tag.locals.page.title}." : attributes[:message]
    email_subject = attributes[:email_subject].nil? ? tag.locals.page.title : attributes[:email_subject]
    email_message = attributes[:email_message].nil? ? "I thought you might be interested in this: #{url}" : "#{attributes[:email_message]} #{url}"
    email_action_url = attributes[:email_action_url].nil? ? "/rad_social/mail" : attributes[:email_action_url]
    request.env["action_controller.instance"].render_to_string :partial => "widget/horizontal_widget",
                             :locals => { :url => url,
                                          :message => message,
                                          :email_subject => email_subject,
                                          :email_message => email_message,
                                          :email_action_url => email_action_url
                             }
  end

end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
trusty-rad-social-extension-2.2.8 lib/tags/widget_tags.rb
trusty-rad-social-extension-2.2.7 lib/tags/widget_tags.rb
trusty-rad-social-extension-3.0.0 lib/tags/widget_tags.rb
trusty-rad-social-extension-2.2.6 lib/tags/widget_tags.rb
trusty-rad-social-extension-2.2.5 lib/tags/widget_tags.rb
trusty-rad-social-extension-2.2.4 lib/tags/widget_tags.rb
trusty-rad-social-extension-2.2.3 lib/tags/widget_tags.rb
trusty-rad-social-extension-2.2.2 lib/tags/widget_tags.rb
trusty-rad-social-extension-2.2.1 lib/tags/widget_tags.rb
trusty-rad-social-extension-2.2.0 lib/tags/widget_tags.rb
trusty-rad-social-extension-2.1.0 lib/tags/widget_tags.rb
trusty-rad-social-extension-2.0.2 lib/tags/widget_tags.rb
trusty-rad-social-extension-2.0.1 lib/tags/widget_tags.rb
trusty-rad-social-extension-2.0.0.pre.beta lib/tags/widget_tags.rb
trusty-rad-social-extension-1.1.4 lib/tags/widget_tags.rb
trusty-rad-social-extension-1.1.3 lib/tags/widget_tags.rb
trusty-rad-social-extension-1.1.2 lib/tags/widget_tags.rb
trusty-rad-social-extension-1.1.1 lib/tags/widget_tags.rb
trusty-rad-social-extension-1.1.0 lib/tags/widget_tags.rb
trusty-rad-social-extension-1.0.10 lib/tags/widget_tags.rb