Sha256: 5a6405ae860f5e1f6bf9b64ef68770bb107add56b763bea650171a9672951b83

Contents?: true

Size: 596 Bytes

Versions: 37

Compression:

Stored size: 596 Bytes

Contents

module Locomotive
  module Shared
    module AccountsHelper

      def account_avatar_url(account, size = '70x70#')
        if account && account.avatar?
          Locomotive::Dragonfly.resize_url account.avatar.url, size
        else
          'locomotive/user.png'
        end
      end

      def account_avatar_and_name(account, size = '70x70#')
        avatar  = image_tag(account_avatar_url(account, size), class: 'img-circle', style: 'width: 20px')
        profile = avatar + (account.try(:name) || t(:unknown_account, scope: 'locomotive.dashboard.activity'))
      end

    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
locomotivecms-4.2.0.alpha2 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-4.2.0.alpha1 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-4.1.1 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-4.1.0 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-4.1.0.rc1 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-4.0.3 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-4.0.2 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-4.0.1 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-4.0.0 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-4.0.0.rc0 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-4.0.0.alpha3 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-3.4.1 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-4.0.0.alpha2 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-4.0.0.alpha1 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-3.4.0 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-3.3.0 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-3.3.0.rc3 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-3.3.0.rc2 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-3.1.2 app/helpers/locomotive/shared/accounts_helper.rb
locomotivecms-3.2.1 app/helpers/locomotive/shared/accounts_helper.rb