-
Notifications
You must be signed in to change notification settings - Fork 87
Expand file tree
/
Copy path_photo.html.erb
More file actions
42 lines (32 loc) · 1.22 KB
/
_photo.html.erb
File metadata and controls
42 lines (32 loc) · 1.22 KB
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
<div class="card">
<div class="card-body py-3 d-flex align-items-center justify-content-between">
<h2 class="h5 m-0 p-0 d-flex align-items-center">
<%= image_tag photo.owner.avatar_image, class: "rounded-circle mr-2", width: 36 %>
<%= link_to photo.owner.username, user_path(photo.owner.username), class: "text-dark" %>
</h2>
<% if current_user == photo.owner %>
<div>
<%= link_to edit_photo_path(photo), class: "btn btn-link btn-sm text-muted" do %>
<i class="fas fa-edit fa-fw"></i>
<% end %>
<%= link_to photo, data: { turbo_method: :delete }, class: "btn btn-link btn-sm text-muted" do %>
<i class="fas fa-trash fa-fw"></i>
<% end %>
</div>
<% end %>
</div>
<%= image_tag photo.image, class: "img-fluid" %>
<div class="card-body">
<p class="card-text"><%= photo.caption %></p>
</div>
<ul class="list-group list-group-flush">
<% photo.comments.each do |comment| %>
<%= render "comments/comment", comment: comment %>
<% end %>
</ul>
<% if current_user.leaders.include?(photo.owner) %>
<div class="card-body">
<%= render "comments/form", comment: photo.comments.build %>
</div>
<% end %>
</div>