11<!-- app/views/conversations/_conversation_content.html.erb -->
2- < div id ="<%= dom_id ( conversation ) %> " class ="conversation-details card shadow-sm d-flex flex-column justify-content-between ">
3- < div class ="card-header bg-secondary text-white text-center d-flex align-items-center px-2 rounded-0 ">
4- < a class ="text-decoration-none align-self-start p-4 " href ="<%= conversations_path %> ">
5- < i class ="fas fa-arrow-left fa-2x "> </ i >
6- </ a >
7- <% if conversation . title . present? %>
8- < h4 class ="m-0 me-4 align-self-center ">
9- <%= conversation . title %>
10- </ h4 >
11- <% end %>
12- < div class ="conversation-participants w-100 d-flex align-items-top justify-content-evenly overflow-auto ">
13- <%= render partial : 'better_together/people/mention' , collection : conversation . participants , as : :person , locals : { flex_layout : 'flex-column' , flex_align_items : 'center' } %>
14- </ div >
15- </ div >
2+ < div id ="<%= dom_id ( conversation ) %> "
3+ class ="conversation-details card shadow-sm d-flex flex-column justify-content-between ">
4+ < div class ="position-relative ">
5+ < div class ="card-header bg-secondary text-white text-center d-flex align-items-center px-2 rounded-0 ">
6+ < a class ="text-decoration-none align-self-start p-4 " href ="<%= conversations_path %> ">
7+ < i class ="fas fa-arrow-left fa-2x "> </ i >
8+ </ a >
9+ <% if conversation . title . present? %>
10+ < h4 class ="m-0 me-4 align-self-center ">
11+ <%= conversation . title %>
12+ </ h4 >
13+ <% end %>
14+ < div class ="conversation-participants w-100 d-flex align-items-top justify-content-evenly overflow-auto ">
15+ <%= render partial : 'better_together/people/mention' , collection : conversation . participants , as : :person ,
16+ locals : { flex_layout : 'flex-column' , flex_align_items : 'center' } %>
17+ </ div >
18+ < div data-bs-toggle ="tooltip " title ="<%= t ( '.options_tooltip' ) %> " class ="align-self-center mx-4 ">
19+ < a class ="text-white " href ="# " data-bs-toggle ="dropdown ">
20+ < i class ="fas fa-xl fa-ellipsis "> </ i >
21+ </ a >
22+ < ul class ="dropdown-menu p-2 ">
23+ <% if policy ( @conversation ) . update? %>
24+ < li >
25+ < button class ="btn " data-bs-toggle ="collapse " data-bs-target ="#edit_conversation ">
26+ < i class ="fas fa-pencil me-1 "> </ i >
27+ <%= t ( '.edit_conversation' ) %>
28+ </ button >
29+ </ li >
30+ <% end %>
31+ <% if policy ( @conversation ) . leave_conversation? %>
32+ < li >
33+ <%= button_to leave_conversation_conversation_path ( conversation ) , method : :put , class : 'btn' do %>
34+ < i class ="fas fa-arrow-right-from-bracket me-1 "> </ i >
35+ <%= t ( '.leave_conversation' ) %>
36+ <% end %>
37+ </ li >
38+ <% end %>
39+ <%# TODO: Implement conversation owner can delete/archive a conversation %>
40+ <!-- <li>
41+ <hr class="dropdown-divider">
42+ </li>
43+ <li>
44+ <button class="btn text-danger">
45+ <i class="fas fa-trash-can me-1"></i>
46+ Delete Conversation
47+ </button>
48+ </li> -->
49+ </ ul >
50+ </ div >
51+ </ div >
52+ < div id ="edit_conversation "
53+ class ="collapse bg-secondary text-white px-2 py-3 position-absolute top-100 w-100 rounded-bottom "
54+ style ="z-index: 100; ">
55+ < div class ="w-100 d-flex justify-content-end ">
56+ < button class ="btn " data-bs-toggle ="collapse " data-bs-target ="#edit_conversation ">
57+ < i class ="fas fa-xmark "> </ i >
58+ </ button >
59+ </ div >
60+ <%= render "form" , conversation : @conversation %>
61+ </ div >
62+ </ div >
1663
17- <%= turbo_stream_from conversation %>
64+ <%= turbo_stream_from conversation %>
1865
19- < div id ="conversation_messages " class ="card-body p-4 " data-controller ="better_together--conversation-messages " data-better_together--conversation-messages-current-person-id-value ="<%= current_person . id %> ">
20- <%= render ( partial : 'better_together/messages/message' , collection : messages , as : :message , locals : { read_status : 'read' } ) || render ( partial : 'better_together/conversations/empty' , locals : { conversation : } ) %>
21- </ div >
66+ < div id ="conversation_messages " class ="card-body p-4 " data-controller ="better_together--conversation-messages "
67+ data-better_together--conversation-messages-current-person-id-value ="<%= current_person . id %> ">
68+ <%= render ( partial : 'better_together/messages/message' , collection : messages , as : :message , locals :
69+ { read_status : 'read' } ) || render ( partial : 'better_together/conversations/empty' , locals : { conversation : } ) %>
70+ </ div >
2271
23- < div class ="card-footer ">
24- <%= render partial : 'better_together/messages/form' , locals : { conversation : conversation , message : message } %>
25- </ div >
26- </ div >
72+ < div class ="card-footer ">
73+ <%= render partial : 'better_together/messages/form' , locals : { conversation : conversation , message : message } %>
74+ </ div >
75+ </ div >
0 commit comments