summaryrefslogtreecommitdiff
path: root/app/views/phone_book_entries/show.html.haml
blob: b6e8c6eeab7c1f5830237928d0e48d019dc0bbb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
- title nil

%section.phone-book-entry
  .content
    %header
      %h1.username
        %a= @phone_book_entry
      - if !@phone_book_entry.organization.blank?
        .work
          %a= @phone_book_entry.organization
          - if !@phone_book_entry.department.blank?
            \/
            = @phone_book_entry.department
          - if !@phone_book_entry.job_title.blank?
            \/
            = @phone_book_entry.job_title
      .personal
        - if !@phone_book_entry.nickname.blank?
          %span.nickname
            a.k.a
            %strong= @phone_book_entry.nickname
        - if @phone_book_entry.birthday    
          %span.birthday
            = l(@phone_book_entry.birthday)
      .tags
        %a= l @phone_book_entry.created_at.utc.getlocal, :format => :short
        ,
        %a= l @phone_book_entry.updated_at.utc.getlocal, :format => :short
    %section.activity
      - if @user_log
        %h2 User Log
        - @user_log.each do |log_entry|
          - if log_entry[:type] == 'voicemail'
            .entry.voice-message
              %span.motive
                = log_entry[:text]
              %span.timestamp
                = log_entry[:timestamp]
          - if log_entry[:type] == 'fax_document'
            .entry.fax
              %span.motive
                = log_entry[:text]
              %span.timestamp
                = log_entry[:timestamp]
          - if log_entry[:type] == 'call_placed'
            .entry.phone
              %span.motive
                log_entry[:text]
              %span.timestamp
                = log_entry[:timestamp]
          - elsif log_entry[:type] == 'call_received'
            .entry.phone
              %span.motive
                = log_entry[:text]
              %span.timestamp
                = log_entry[:timestamp]
          - elsif log_entry[:type] == 'call_missed'
            .entry.phone-down
              %span.motive
                = log_entry[:text]
              %span.timestamp
                = log_entry[:timestamp]

  .sidebar
    = image_tag @phone_book_entry.image_url(:profile).to_s, :class => 'display'
    %p.description
      = @phone_book_entry.description
    .widget.phones
      - @phone_book_entry.phone_numbers.each do |phone_number|
        - case phone_number.name
        - when /fax/
          .fax
            %a= phone_number
            %span= phone_number.name
        - when /home/
          .home
            %a= phone_number
            %span= phone_number.name
        - when /mobile/
          .cellphone
            %a= phone_number
            %span= phone_number.name  
        - when /office/
          .office
            %a= phone_number
            %span= phone_number.name
        - else
          .phone
            %a= phone_number
            %span= phone_number.name
      = link_to t('phone_book_entries.show.manage_phone_numbers'), phone_book_entry_phone_numbers_path(@phone_book_entry)  

    .widget.adresses
      - @phone_book_entry.addresses.each do |address|
        .home
          %strong
            - if !address.line1.blank?
              = address.line1
              %br
            - if !address.line2.blank?
              = address.line1
              %br
            - if !address.street.blank?
              = address.street
              %br
            - if !address.city.blank?
              = "#{address.city} #{address.zip_code}"
              %br
            - if !address.country.blank?
              = address.country.to_s
              %br
          / %span Home
      / .office
    .widget.social
      - if !@phone_book_entry.homepage_organization.blank?
        .home
          %a= @phone_book_entry.homepage_organization
          %span www
      - if !@phone_book_entry.homepage_personal.blank?
        .home
          %a= @phone_book_entry.homepage_personal
          %span www
      - if !@phone_book_entry.twitter_account.blank?
        .twitter
          %a= @phone_book_entry.twitter_account
          %span Twitter
      - if !@phone_book_entry.google_plus_account.blank?
        .google_plus
          %a= @phone_book_entry.google_plus_account
          %span Google+
      - if !@phone_book_entry.facebook_account.blank?
        .facebook
          %a= @phone_book_entry.facebook_account
          %span Facebook
      - if !@phone_book_entry.xing_account.blank?
        .xing
          %a= @phone_book_entry.xing_account
          %span Xing
      - if !@phone_book_entry.linkedin_account.blank?
        .linkedin
          %a= @phone_book_entry.linkedin_account
          %span LinkedIn
      - if !@phone_book_entry.mobileme_account.blank?
        .mobileme
          %a= @phone_book_entry.mobileme_account
          %span MobileMe