Sha256: 19e32e5cab0bc23e6a802c31c7ba9a08324f7810b7f9dcfcb7543b959f857deb

Contents?: true

Size: 918 Bytes

Versions: 29

Compression:

Stored size: 918 Bytes

Contents

module Softwear
  module Auth
    module Helper
      def profile_picture_of(user = nil, options = {})
        options[:class] ||= ''
        options[:class] += ' media-object img-circle profile-pic'
        options[:alt] ||= "#{user.try(:full_name) || '(Unknown)'}'s Avatar"
        options[:title] ||= user.try(:full_name) || 'Someone'

        image_tag user.try(:profile_picture_url) || 'avatar/masarie.jpg', options
      end

      def auth_server_error_banner
        return unless Softwear::Auth::Model.auth_server_down?

        content_tag :div, class: 'alert alert-danger' do
          content_tag :strong do
            (Softwear::Auth::Model.auth_server_went_down_at || Time.now).strftime(
              "WARNING: The authentication server is unreachable as of %I:%M%p. "\
              "Some site features might not function properly."
            )
          end
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
softwear-lib-1.7.11 lib/softwear/auth/helper.rb
softwear-lib-1.7.10 lib/softwear/auth/helper.rb
softwear-lib-1.7.9 lib/softwear/auth/helper.rb
softwear-lib-1.7.8 lib/softwear/auth/helper.rb
softwear-lib-1.7.7 lib/softwear/auth/helper.rb
softwear-lib-1.7.6 lib/softwear/auth/helper.rb
softwear-lib-1.7.4 lib/softwear/auth/helper.rb
softwear-lib-1.7.3 lib/softwear/auth/helper.rb
softwear-lib-1.7.2 lib/softwear/auth/helper.rb
softwear-lib-1.7.1 lib/softwear/auth/helper.rb
softwear-lib-1.7.0 lib/softwear/auth/helper.rb
softwear-lib-1.6.2 lib/softwear/auth/helper.rb
softwear-lib-1.6.1 lib/softwear/auth/helper.rb
softwear-lib-1.6.0 lib/softwear/auth/helper.rb
softwear-lib-1.5.18 lib/softwear/auth/helper.rb
softwear-lib-1.5.17 lib/softwear/auth/helper.rb
softwear-lib-1.5.16 lib/softwear/auth/helper.rb
softwear-lib-1.5.15 lib/softwear/auth/helper.rb
softwear-lib-1.5.14 lib/softwear/auth/helper.rb
softwear-lib-1.5.13 lib/softwear/auth/helper.rb