Sha256: f1dccf5ef57ad13f5e4b4a5a315ed0d9a76d7244b331f2f4dd49faa50825cce9

Contents?: true

Size: 938 Bytes

Versions: 23

Compression:

Stored size: 938 Bytes

Contents

module Softwear
  module Auth
    module Helper
      def profile_picture_of(user = nil, options = {})
        options[:class] ||= ''
        options[:class] += ' media-object img-rounded profile-pic img img-responsive'
        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

23 entries across 23 versions & 1 rubygems

Version Path
softwear-lib-1.10.3 lib/softwear/auth/helper.rb
softwear-lib-1.10.2 lib/softwear/auth/helper.rb
softwear-lib-1.10.1 lib/softwear/auth/helper.rb
softwear-lib-1.9.4 lib/softwear/auth/helper.rb
softwear-lib-1.9.3 lib/softwear/auth/helper.rb
softwear-lib-1.9.2 lib/softwear/auth/helper.rb
softwear-lib-1.9.1 lib/softwear/auth/helper.rb
softwear-lib-1.9.0 lib/softwear/auth/helper.rb
softwear-lib-1.8.9 lib/softwear/auth/helper.rb
softwear-lib-1.8.7 lib/softwear/auth/helper.rb
softwear-lib-1.8.6 lib/softwear/auth/helper.rb
softwear-lib-1.8.5 lib/softwear/auth/helper.rb
softwear-lib-1.8.3 lib/softwear/auth/helper.rb
softwear-lib-1.8.2 lib/softwear/auth/helper.rb
softwear-lib-1.8.1 lib/softwear/auth/helper.rb
softwear-lib-1.8.0 lib/softwear/auth/helper.rb
softwear-lib-1.7.20 lib/softwear/auth/helper.rb
softwear-lib-1.7.19 lib/softwear/auth/helper.rb
softwear-lib-1.7.18 lib/softwear/auth/helper.rb
softwear-lib-1.7.17 lib/softwear/auth/helper.rb