blob: f42af89fb26d25429371e6cf6b2f2d932dcb6eb8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
<% chat_room_text_class = case chat_message.chat_room.gid
when "cosmic" then "text-gray-400"
when "trade" then "text-blue-400"
when "help" then "text-pink-300"
when "system" then "text-red-500"
when "achievement" then "text-purple-400"
when "news" then "text-yellow-400"
else "text-gray-400"
end
chat_room_prefix = case chat_message.chat_room.gid
when "cosmic" then "[C]"
when "trade" then "[T]"
when "help" then "[H]"
when "system" then "[S]"
when "achievement" then "[A]"
when "news" then "[N]"
else nil
end
%>
<p>
<span class="<%= chat_room_text_class %>">
<span class="text-xs"><%= chat_message.created_at.strftime("%H:%M") %></span>
<%= chat_room_prefix %>
</span>
<% if chat_message.chat_room.gid == "system" %>
<span class="text-glow <%= chat_room_text_class %>"><%= chat_message.body %></span>
<% elsif chat_message.chat_room.gid == "news" %>
<span class="<%= chat_room_text_class %>"><%= chat_message.body %></span>
<% elsif chat_message.chat_room.gid == "achievement" %>
<%= render "application/components/text/title", title: chat_message.target.active_title %>
<span class="<%= chat_room_text_class %>">
<%# TODO: Sort out this subject/target stuff that I just half-blindly ported over from old Esoterra. %>
<%= chat_message.target&.name %> <%= chat_message.body %>
</span>
<% else %>
<% if chat_message.sender %>
<%= render "application/components/text/title", title: chat_message.sender.active_title %>
<% end %>
<span class="<%= chat_room_text_class %>">
<% if chat_message.sender %>
<%= chat_message.sender.name %>:
<% end %>
<%= chat_message.body %>
</span>
<% end %>
</p>
|