Sha256: 1ee11951f12f0b14403f4304169a9a596380c60ccdd951a2d00fcd4fee931c72

Contents?: true

Size: 1.37 KB

Versions: 29

Compression:

Stored size: 1.37 KB

Contents

module SocialStream
  module Views
    module Settings
      module Base
        def settings_items
          SocialStream::Views::Settings::ItemList.new.tap do |items|
            if current_subject  == current_user
              items << {
                :key  => 'user.edit',
                :html => render(:partial => "devise/registrations/edit_user",
                                :locals => {
                                             :resource => current_user,
                                             :resource_name => :user
                                           })
              }
            end

            items << {
              :key  => 'notifications',
              :html => render(:partial => "notifications")
            }

            if current_subject.respond_to? :authentication_token
              items << {
                :key  => 'api_key',
                :html => render(:partial => "api_key")
              }
            end

            items << {
              :key  => 'destroy',
              :html => 
                current_subject == current_user ?
                  render(:partial => "devise/registrations/delete_account",
                                     :locals => { :resource => current_user, :resource_name => :user }) :
                  render(:partial => 'destroy')
            }
          end
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
social_stream-0.16.1 base/lib/social_stream/views/settings/base.rb
social_stream-base-0.11.0 lib/social_stream/views/settings/base.rb
social_stream-0.15.8 base/lib/social_stream/views/settings/base.rb
social_stream-base-0.10.11 lib/social_stream/views/settings/base.rb
social_stream-0.15.7 base/lib/social_stream/views/settings/base.rb
social_stream-base-0.10.10 lib/social_stream/views/settings/base.rb
social_stream-0.15.6 base/lib/social_stream/views/settings/base.rb
social_stream-base-0.10.9 lib/social_stream/views/settings/base.rb
social_stream-0.15.5 base/lib/social_stream/views/settings/base.rb
social_stream-base-0.10.8 lib/social_stream/views/settings/base.rb
social_stream-0.15.4 base/lib/social_stream/views/settings/base.rb
social_stream-base-0.10.7 lib/social_stream/views/settings/base.rb
social_stream-0.15.1 base/lib/social_stream/views/settings/base.rb
social_stream-0.15.0 base/lib/social_stream/views/settings/base.rb
social_stream-base-0.10.6 lib/social_stream/views/settings/base.rb
social_stream-0.14.1 base/lib/social_stream/views/settings/base.rb
social_stream-base-0.10.5 lib/social_stream/views/settings/base.rb
social_stream-0.14.0 base/lib/social_stream/views/settings/base.rb
social_stream-base-0.10.4 lib/social_stream/views/settings/base.rb
social_stream-0.13.3 base/lib/social_stream/views/settings/base.rb