Sha256: 456cabe9a91d9da427e55079901e3adf8e98057860a6ff5e15c6fac3679be2e4

Contents?: true

Size: 1.11 KB

Versions: 33

Compression:

Stored size: 1.11 KB

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  
    
    module EmailsHelper
      def backtrace_is_from_app?(line)
        !(line.include?('/gems/') || /^kernel\// =~ line || line.include?('/vendor_ruby/'))
      end

      extend self
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
softwear-lib-2.0.10 lib/softwear/auth/helper.rb
softwear-lib-2.0.9.2 lib/softwear/auth/helper.rb
softwear-lib-2.0.9.1 lib/softwear/auth/helper.rb
softwear-lib-2.0.9 lib/softwear/auth/helper.rb
softwear-lib-2.0.8 lib/softwear/auth/helper.rb
softwear-lib-2.0.7 lib/softwear/auth/helper.rb
softwear-lib-2.0.6 lib/softwear/auth/helper.rb
softwear-lib-2.0.5 lib/softwear/auth/helper.rb
softwear-lib-2.0.4 lib/softwear/auth/helper.rb
softwear-lib-2.0.3 lib/softwear/auth/helper.rb
softwear-lib-2.0.2 lib/softwear/auth/helper.rb
softwear-lib-2.0.1 lib/softwear/auth/helper.rb
softwear-lib-2.0.0 lib/softwear/auth/helper.rb