/
_account.html.erb
54 lines (49 loc) · 1.5 KB
/
_account.html.erb
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
<% full ||= false -%>
<article class="account">
<header>
<%= render :partial => 'portrait', :locals => { :account => account, :full => full } %>
<h2 class="username">
<% if full -%>
<%= account.username %>
<% else %>
<%= link_to account.username, account %>
<% end -%>
</h2>
<% if full and (primary_site = account.sites.first) -%>
<%= link_to primary_site.url, primary_site.url, :class => "primary_site" %>
<% end -%>
<% unless account.names.empty? %>
<p><%= account.names.collect {|n| n.value }.reverse.to_sentence %></p>
<% end %>
<% unless account.nicks.empty? %>
<p><strong>AKA:</strong> <%= account.nicks.collect {|n| n.value }.to_sentence %></p>
<% end %>
</header>
<div class="col">
<% if full -%>
<% unless account.books.empty? %>
<h3>Books</h3>
<ul>
<%= render :partial => 'book', :collection => account.books %>
</ul>
<% end %>
<% end -%>
</div>
<div class="col last">
<% if full -%>
<% unless account.sites.empty? %>
<h3>Sites</h3>
<ul>
<%= render :partial => 'site', :collection => account.sites %>
</ul>
<% end %>
<% end -%>
</div>
<% if full -%>
<footer class="my_services">
<ul>
<%= render :partial => 'service', :collection => account.services %>
</ul>
</footer>
<% end -%>
</article>