fatfreecrm/fat_free_crm

View on GitHub
app/views/users/_user.html.haml

Summary

Maintainability
Test Coverage
- if @user == current_user && Setting.per_user_locale
  %div#options(style="float:right")
    #{t :profile_language}: #{link_to(language_for(current_user), "#", id: :locale)}

%table(cellspacing="0" cellpadding="0")
  %tr
    %td(valign="top")
      = avatar_for(@user, style: "margin: 0px 10px 0px 0px")
    %td(valign="top")
      %h3= h(@user.full_name) + " (#{@user.username})"
      - if !@user.title.blank? && !@user.company.blank?
        %div= t(:works_at, job_title: h(@user.title), company: h(@user.company))
      - else
        = h(@user.title) unless @user.title.blank?
        = h(@user.company) unless @user.company.blank?
      %br
      %div
        - unless @user.email.blank?
          #{t :email}: #{auto_link(@user.email)}
        - unless @user.alt_email.blank?
          #{t :or} #{auto_link(@user.alt_email)}
      - if !@user.phone.blank? && !@user.mobile.blank?
        %div #{t :phone}: <b>#{@user.phone}</b>, #{t :mobile}: <b>#{@user.mobile}</b>
      - else
        - if @user.phone.present?
          = t(:phone) + ":"
          = content_tag(:b, @user.phone)
        - if @user.mobile.present?
          = t(:mobile) + ":"
          = content_tag(:b, @user.mobile)

- if Setting.per_user_locale
  %script= render "languages"