Skip to content

Commit 6658695

Browse files
committed
use the list layout to render the conversation index and new views
1 parent 9f67599 commit 6658695

File tree

5 files changed

+31
-22
lines changed

5 files changed

+31
-22
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
<div class="card shadow-sm">
3+
<div class="card-header bg-secondary rounded-0 text-white d-flex flex-row justify-content-between align-items-center">
4+
<h5 class="mb-0">
5+
<%= link_to t('.conversations'), conversations_path, class: 'text-decoration-none text-light' %>
6+
</h5>
7+
<%= link_to new_conversation_path, class: "btn btn-xs btn-primary", data: { turbo_frame: "_top" } do %>
8+
<%= t('.new') %> <i class="fas fa-plus ms-1"></i>
9+
<% end %>
10+
</div>
11+
<%= yield if block_given? %>
12+
<ul id="conversations_list" class="list-group list-group-flush flex-column">
13+
<%= render(partial: 'better_together/conversations/conversation_with_last_message', collection: @conversations, as: :conversation) || render(partial: 'better_together/conversations/empty') %>
14+
</ul>
15+
</div>
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
<%= render 'communicator' do %>
2-
<%= content_tag :div, id: "conversations_index" do %>
3-
<div class="px-4 mt-3">
4-
<h3><%= t('.active_conversations') %></h3>
5-
<ul class="list-group">
6-
<%= render(partial: 'better_together/conversations/conversation_with_last_message', collection: @conversations, as: :conversation) || render(partial: 'better_together/conversations/empty') %>
7-
</ul>
8-
</div>
9-
<% end %>
1+
2+
<%= content_tag :div, id: "conversations_index" do %>
3+
<%= render 'list' %>
104
<% end %>

app/views/better_together/conversations/new.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<%= render 'communicator' do %>
1+
<%= render layout: 'list' do %>
22
<div id="new_conversation_form" class="conversation-messages card shadow-sm">
33
<div class="card-header rounded-0 bg-primary text-white">
4-
<h3 class="mb-0"><%= t('.new_conversation') %></h3>
4+
<h6 class="mb-0"><%= t('.new_conversation') %></h6>
55
</div>
66

77
<div class="card-body">
@@ -17,7 +17,7 @@
1717
</div>
1818

1919
<div>
20-
<%= form.submit t('.create_conversation'), class: 'btn btn-primary' %>
20+
<%= form.submit t('.create_conversation'), class: 'btn btn-sm btn-primary' %>
2121
</div>
2222
<% end %>
2323
</div>

config/locales/en.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ en:
1111
contact_details:
1212
title: "Contact Details"
1313
conversations:
14-
communicator:
14+
list:
1515
create_conversation: "Create Conversation"
16+
new_conversation: "New Conversation"
17+
conversations: "Conversations"
18+
new: "New"
19+
add_participants: "Add Participants"
1620
conversation:
1721
last_message: "Last message"
1822
layout_with_sidebar:
1923
active_conversations: "Active Conversations"
2024
last_message: "Last message"
21-
conversations: "Conversations"
22-
new: "New"
23-
new_conversation: "New Conversation"
24-
add_participants: "Add Participants"
2525
empty:
2626
no_messages: "No messages yet. Why not start the conversation?"
2727
platform_invitation:

config/locales/es.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ es:
1111
contact_details:
1212
title: "Detalles de Contacto"
1313
conversations:
14-
communicator:
14+
list:
1515
create_conversation: "Crear Conversación"
16+
new_conversation: "Nueva Conversación"
17+
conversations: "Conversaciones"
18+
new: "Nuevo"
19+
add_participants: "Agregar Participantes"
1620
conversation:
1721
last_message: "Último mensaje"
1822
layout_with_sidebar:
1923
active_conversations: "Conversaciones Activas"
2024
last_message: "Último mensaje"
21-
conversations: "Conversaciones"
22-
new: "Nuevo"
23-
new_conversation: "Nueva Conversación"
24-
add_participants: "Agregar Participantes"
2525
empty:
2626
no_messages: "Aún no hay mensajes. ¿Por qué no iniciar la conversación?"
2727
platform_invitation:

0 commit comments

Comments
 (0)