|
1 | | -<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md border border-gray-200 dark:border-gray-700 overflow-hidden" id="<%= dom_id message %>"> |
| 1 | +<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md border border-gray-200 dark:border-gray-700 overflow-hidden" id="<%= dom_id message %>" data-list-seq="<%= message.list_seq %>"> |
2 | 2 | <div class="border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900 px-6 py-4"> |
3 | 3 | <h2 class="text-xl font-semibold text-gray-900 dark:text-gray-100 mb-3"><%= message.subject %></h2> |
4 | 4 | <div class="space-y-1 text-sm text-gray-600 dark:text-gray-400"> |
|
32 | 32 | </div> |
33 | 33 | </div> |
34 | 34 | <% end %> |
| 35 | + |
| 36 | + <% if defined?(@prev_thread) || defined?(@next_thread) || defined?(@prev_message_in_thread) || defined?(@next_message_in_thread) %> |
| 37 | + <div class="border-t border-gray-200 dark:border-gray-700 px-6 py-4 bg-gray-50 dark:bg-gray-900" data-controller="keyboard-nav"> |
| 38 | + <div class="grid grid-cols-2 gap-4"> |
| 39 | + <div> |
| 40 | + <h3 class="text-xs font-medium text-gray-500 dark:text-gray-400 mb-2">Thread</h3> |
| 41 | + <div class="flex gap-2"> |
| 42 | + <% if @prev_thread %> |
| 43 | + <%= link_to [message.list, @prev_thread], class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors", data: {turbo_frame: 'message_content', turbo_action: 'advance', nav: 'prev-thread'} do %> |
| 44 | + <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 45 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path> |
| 46 | + </svg> |
| 47 | + Prev |
| 48 | + <% end %> |
| 49 | + <% else %> |
| 50 | + <span class="inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded bg-gray-100 dark:bg-gray-800 text-gray-400 dark:text-gray-600 cursor-not-allowed"> |
| 51 | + <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 52 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path> |
| 53 | + </svg> |
| 54 | + Prev |
| 55 | + </span> |
| 56 | + <% end %> |
| 57 | + <% if @next_thread %> |
| 58 | + <%= link_to [message.list, @next_thread], class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors", data: {turbo_frame: 'message_content', turbo_action: 'advance', nav: 'next-thread'} do %> |
| 59 | + Next |
| 60 | + <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 61 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path> |
| 62 | + </svg> |
| 63 | + <% end %> |
| 64 | + <% else %> |
| 65 | + <span class="inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded bg-gray-100 dark:bg-gray-800 text-gray-400 dark:text-gray-600 cursor-not-allowed"> |
| 66 | + Next |
| 67 | + <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 68 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path> |
| 69 | + </svg> |
| 70 | + </span> |
| 71 | + <% end %> |
| 72 | + </div> |
| 73 | + </div> |
| 74 | + <div> |
| 75 | + <h3 class="text-xs font-medium text-gray-500 dark:text-gray-400 mb-2">In This Thread</h3> |
| 76 | + <div class="flex gap-2"> |
| 77 | + <% if @prev_message_in_thread %> |
| 78 | + <%= link_to [message.list, @prev_message_in_thread], class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors", data: {turbo_frame: 'message_content', turbo_action: 'advance', nav: 'prev-message'} do %> |
| 79 | + <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 80 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path> |
| 81 | + </svg> |
| 82 | + Prev |
| 83 | + <% end %> |
| 84 | + <% else %> |
| 85 | + <span class="inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded bg-gray-100 dark:bg-gray-800 text-gray-400 dark:text-gray-600 cursor-not-allowed"> |
| 86 | + <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 87 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path> |
| 88 | + </svg> |
| 89 | + Prev |
| 90 | + </span> |
| 91 | + <% end %> |
| 92 | + <% if @next_message_in_thread %> |
| 93 | + <%= link_to [message.list, @next_message_in_thread], class: "inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors", data: {turbo_frame: 'message_content', turbo_action: 'advance', nav: 'next-message'} do %> |
| 94 | + Next |
| 95 | + <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 96 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path> |
| 97 | + </svg> |
| 98 | + <% end %> |
| 99 | + <% else %> |
| 100 | + <span class="inline-flex items-center gap-1 px-3 py-2 text-sm font-medium rounded bg-gray-100 dark:bg-gray-800 text-gray-400 dark:text-gray-600 cursor-not-allowed"> |
| 101 | + Next |
| 102 | + <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 103 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path> |
| 104 | + </svg> |
| 105 | + </span> |
| 106 | + <% end %> |
| 107 | + </div> |
| 108 | + </div> |
| 109 | + </div> |
| 110 | + </div> |
| 111 | + <% end %> |
35 | 112 | </div> |
0 commit comments