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
|
- content_for :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.to_s.downcase
- when /fax/
.fax
= link_to phone_number, call_phone_book_entry_phone_number_path(@phone_book_entry, phone_number), :method => :put, :title => t('phone_numbers.show.actions.call')
%span= phone_number.name
- when /home/
.home
= link_to phone_number, call_phone_book_entry_phone_number_path(@phone_book_entry, phone_number), :method => :put, :title => t('phone_numbers.show.actions.call')
%span
- when /mobile/
.cellphone
= link_to phone_number, call_phone_book_entry_phone_number_path(@phone_book_entry, phone_number), :method => :put, :title => t('phone_numbers.show.actions.call')
%span= phone_number.name
- when /office/
.office
= link_to phone_number, call_phone_book_entry_phone_number_path(@phone_book_entry, phone_number), :method => :put, :title => t('phone_numbers.show.actions.call')
%span= phone_number.name
- else
.phone
= link_to phone_number, call_phone_book_entry_phone_number_path(@phone_book_entry, phone_number), :method => :put, :title => t('phone_numbers.show.actions.call')
%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
=link_to @phone_book_entry.homepage_organization, @phone_book_entry.homepage_organization
%span www
- if !@phone_book_entry.homepage_personal.blank?
.home
=link_to @phone_book_entry.homepage_personal, @phone_book_entry.homepage_personal
%span www
- if !@phone_book_entry.twitter_account.blank?
.twitter
=link_to @phone_book_entry.twitter_account, "https://twitter.com/#{@phone_book_entry.twitter_account}"
%span Twitter
- if !@phone_book_entry.facebook_account.blank?
.facebook
=link_to @phone_book_entry.facebook_account, "https://www.facebook.com/#{@phone_book_entry.facebook_account}"
%span Facebook
|