|
1 | 1 | <div class="thread-message" style="margin-left: <%= depth * 6 %>px;" <% if (depth == 0) && message.children&.any? %>data-controller="thread"<% end %>> |
2 | 2 | <% if depth == 0 %> |
3 | | - <div class="bg-white dark:bg-gray-800 rounded-lg shadow-md border border-gray-200 dark:border-gray-700 overflow-hidden hover:shadow-lg transition-shadow"> |
| 3 | + <%= link_to "/#{list.name}/#{message.list_seq}", class: 'message-item block bg-white dark:bg-gray-800 rounded-lg shadow-md border border-gray-200 dark:border-gray-700 overflow-hidden hover:shadow-lg transition-shadow', data: {turbo_frame: 'message_content', turbo_action: 'advance', action: 'click->message-list#select'} do %> |
4 | 4 | <div class="p-5"> |
5 | 5 | <div class="flex items-start justify-between gap-4"> |
6 | 6 | <div class="flex-1 min-w-0"> |
|
10 | 10 | <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path> |
11 | 11 | </svg> |
12 | 12 | <% end %> |
13 | | - <span class="px-0.5">[#<%= message.list_seq %>]</span> |
14 | | - <%= link_to without_list_prefix(message.subject), "/#{list.name}/#{message.list_seq}", data: {turbo_frame: 'message_content'} %> |
| 13 | + <span class="px-0.5">[#<%= message.list_seq %>] <%= without_list_prefix(message.subject) %></span> |
15 | 14 | <span class="text-sm text-gray-500 dark:text-gray-400 font-normal ml-2">— <%= message.from %></span> |
16 | 15 | </h2> |
| 16 | + <% if message.body.present? %> |
| 17 | + <p class="text-sm text-gray-600 dark:text-gray-400 mb-2 line-clamp-1"><%= message.first_line %></p> |
| 18 | + <% end %> |
17 | 19 | <div class="flex items-center gap-3 text-sm text-gray-600 dark:text-gray-400"> |
18 | 20 | <span class="inline-flex items-center gap-1"> |
19 | 21 | <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
20 | 22 | <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> |
21 | 23 | </svg> |
22 | 24 | <%= count = message.count_recursively %> <%= count == 1 ? 'message' : 'messages' %> |
23 | 25 | </span> |
| 26 | + <span class="inline-flex items-center gap-1"> |
| 27 | + <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 28 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path> |
| 29 | + </svg> |
| 30 | + <%= message.published_date %> |
| 31 | + </span> |
24 | 32 | </div> |
25 | 33 | </div> |
26 | 34 | </div> |
27 | 35 | </div> |
28 | | - </div> |
| 36 | + <% end %> |
29 | 37 | <% else %> |
30 | | - <div class="py-2 border-l-2 border-gray-200 dark:border-gray-700 pl-4 hover:border-red-400 dark:hover:border-red-500 transition-colors"> |
| 38 | + <%= link_to "/#{list.name}/#{message.list_seq}", class: 'message-item block py-2 border-l-2 border-gray-200 dark:border-gray-700 pl-4 hover:border-red-400 dark:hover:border-red-500 transition-colors', data: {turbo_frame: 'message_content', turbo_action: 'advance', action: 'click->message-list#select'} do %> |
31 | 39 | <div class="flex items-start gap-2 text-sm"> |
32 | 40 | <svg class="w-4 h-4 text-gray-400 dark:text-gray-500 mt-0.5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
33 | 41 | <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"></path> |
34 | 42 | </svg> |
35 | 43 | <div class="flex-1 min-w-0"> |
36 | | - <%= link_to "/#{list.name}/#{message.list_seq}", class: 'text-gray-900 dark:text-gray-100 hover:text-red-600 dark:hover:text-red-400 transition-colors', data: {turbo_frame: 'message_content'} do %> |
| 44 | + <span class="text-gray-900 dark:text-gray-100 hover:text-red-600 dark:hover:text-red-400 transition-colors"> |
37 | 45 | <span class="px-0.5">[#<%= message.list_seq %>] <%= without_list_prefix(message.subject) %></span> |
38 | | - <% end %> |
| 46 | + </span> |
39 | 47 | <span class="text-gray-500 dark:text-gray-400">— <%= message.from %></span> |
| 48 | + <span class="text-gray-500 dark:text-gray-400 ml-2"><%= message.published_date %></span> |
| 49 | + <% if message.body.present? %> |
| 50 | + <p class="text-xs text-gray-500 dark:text-gray-400 mt-1 line-clamp-1"><%= message.first_line %></p> |
| 51 | + <% end %> |
40 | 52 | </div> |
41 | 53 | </div> |
42 | | - </div> |
| 54 | + <% end %> |
43 | 55 | <% end %> |
44 | 56 |
|
45 | 57 | <% if message.children&.any? %> |
|
0 commit comments