Sha256: d26ceb66b24af06276bf878645a9e2dc1221bae9e2903db705f2010b24d8c7b5

Contents?: true

Size: 1.11 KB

Versions: 6

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

6 entries across 6 versions & 1 rubygems

Version Path
softwear-2.0.7 lib/softwear/auth/helper.rb
softwear-2.0.6 lib/softwear/auth/helper.rb
softwear-2.0.5 lib/softwear/auth/helper.rb
softwear-2.0.4 lib/softwear/auth/helper.rb
softwear-2.0.3 lib/softwear/auth/helper.rb
softwear-2.0.0 lib/softwear/auth/helper.rb