-
Notifications
You must be signed in to change notification settings - Fork 0
/
show.html.erb
60 lines (51 loc) · 1.69 KB
/
show.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
55
56
57
58
59
60
<div class="booyah-box col-xs-10 col-xs-offset-1">
<div class="col-xs-4">
<%= image_tag 'user.png' %>
</div>
<div class="col-xs-8">
<h1><%= @user.email %></h1>
<h3>Member Since: <%= @user.created_at.strftime("%B %d, %Y") %></h3>
<h4><%= @user.comments.count %> total comments</h4>
<h4><%= @user.comments.where(rating: '5_stars').count %> total 5-star reviews</h4>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<br /><br />
<h1 class="text-center">My Comments</h1>
<% @user.comments.each do |comment| %>
<div class="col-xs-12 col-sm-6">
<h2 class="text-center"><%= link_to comment.place.name, place_path(comment.place) %></h2>
<blockquote>
<% if comment.humanized_rating.present? %>
<b><%= comment.humanized_rating %></b> -
<% end %>
<%= comment.message %>
<small><%= comment.user.email %></small>
</blockquote>
</div>
<% end %>
<div class="clear"></div>
<br /><br />
<h1 class="text-center">My Places</h1>
<% @user.places.each do |place| %>
<div class="booyah-box col-xs-10 col-xs-offset-1">
<h1><%= link_to place.name, place_path(place) %></h1><br />
<i><%= place.address %></i><br />
<p><%= place.description %></p><br />
<% if place.user.present? %>
<small><%= place.user.email %></small>
<% end %>
<% if place.comments.present? %>
<div class="col-xs-12">
<blockquote>
<% if place.comments.last.humanized_rating.present? %>
<b><%= place.comments.last.humanized_rating %></b> -
<% end %>
<%= place.comments.last.message %>
<small><%= place.comments.last.user.email %></small>
</blockquote>
</div>
<% end %>
</div>
<% end %>