|
1 | | -<div class="thread-message" style="margin-left: <%= depth * 20 %>px;"> |
| 1 | +<div class="thread-message" style="margin-left: <%= depth * 6 %>px;"> |
2 | 2 | <% if depth == 0 %> |
3 | | - <h2> |
4 | | - <span><%= message.list_seq %>: (<%= message.count_recursively %>)</span> |
5 | | - <%= link_to without_list_prefix(message.subject), "/#{list.name}/#{message.list_seq}" %> |
6 | | - </h2> |
| 3 | + <div class="bg-white rounded-lg shadow-md border border-gray-200 overflow-hidden hover:shadow-lg transition-shadow"> |
| 4 | + <div class="p-5"> |
| 5 | + <div class="flex items-start justify-between gap-4"> |
| 6 | + <div class="flex-1 min-w-0"> |
| 7 | + <h2 class="text-lg font-semibold text-gray-900 hover:text-red-600 transition-colors mb-2"> |
| 8 | + <span class="px-0.5">[#<%= message.list_seq %>]</span> |
| 9 | + <%= link_to without_list_prefix(message.subject), "/#{list.name}/#{message.list_seq}" %> |
| 10 | + <span class="text-sm text-gray-500 font-normal ml-2">— <%= message.from %></span> |
| 11 | + </h2> |
| 12 | + <div class="flex items-center gap-3 text-sm text-gray-600"> |
| 13 | + <span class="inline-flex items-center gap-1"> |
| 14 | + <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 15 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"></path> |
| 16 | + </svg> |
| 17 | + <%= count = message.count_recursively %> <%= count == 1 ? 'message' : 'messages' %> |
| 18 | + </span> |
| 19 | + </div> |
| 20 | + </div> |
| 21 | + </div> |
| 22 | + </div> |
| 23 | + </div> |
7 | 24 | <% else %> |
8 | | - <div class="reply"> |
9 | | - <span class="reply-meta"> |
10 | | - <%= link_to "[#{message.list_seq}]", "/#{list.name}/#{message.list_seq}" %> |
11 | | - <%= without_list_prefix(message.subject) %> |
12 | | - - <%= message.from&.first || message.from %> |
13 | | - </span> |
| 25 | + <div class="py-2 border-l-2 border-gray-200 pl-4 hover:border-red-400 transition-colors"> |
| 26 | + <div class="flex items-start gap-2 text-sm"> |
| 27 | + <svg class="w-4 h-4 text-gray-400 mt-0.5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 28 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"></path> |
| 29 | + </svg> |
| 30 | + <div class="flex-1 min-w-0"> |
| 31 | + <%= link_to "/#{list.name}/#{message.list_seq}", class: "text-gray-900 hover:text-red-600 transition-colors" do %> |
| 32 | + <span class="px-0.5">[#<%= message.list_seq %>] <%= without_list_prefix(message.subject) %></span> |
| 33 | + <% end %> |
| 34 | + <span class="text-gray-500">— <%= message.from %></span> |
| 35 | + </div> |
| 36 | + </div> |
14 | 37 | </div> |
15 | 38 | <% end %> |
16 | 39 |
|
17 | 40 | <% if message.children&.any? %> |
18 | | - <% message.children.each do |child| %> |
19 | | - <%= render partial: 'thread', locals: { message: child, list: list, depth: depth + 1 } %> |
20 | | - <% end %> |
| 41 | + <div class="mt-2"> |
| 42 | + <%= render partial: 'thread', collection: message.children, as: :message, locals: {list: list, depth: depth + 1} %> |
| 43 | + </div> |
21 | 44 | <% end %> |
22 | 45 | </div> |
0 commit comments