bullet_train-themes-light 1.0.23 → 1.0.24

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e115d85db405bc49a6ac24c8307be81d0b47578721204c3d3a46bff8dae9830
4
- data.tar.gz: 1c3d99286f0cf02625aa34e7f4ad3db8342b61cdd9c5c679c80e3395fa648783
3
+ metadata.gz: 62876938f237b59152f1a3615cfa11eab6f99b5a8f019a2ea5ce2f474bddfd93
4
+ data.tar.gz: a60919cb5fa7ddde111e579b2dcda6153a18af2ae2f559e5ccbf8091eb076b12
5
5
  SHA512:
6
- metadata.gz: 12a7f99f570bdcfb26d3fade9bc5b88ec9d80d0345a8f546d60104469ca1aca2073160e5d702493b7628c6ca88535792ce40d1652e8fd60f633341ee92f9788c
7
- data.tar.gz: 7d7d73ead2f224c97467f8b83c6a1e62ab6bef3ffb208d3df140a8304c3e2f1e1ba281d1b9ce1e6ce3bed8642b1cb3f5d8c1721aada8a664a5188c6a01e5811f
6
+ metadata.gz: bb63d3b24365d86bef9efc547a94e2fd32baaea77db3d8875efeb8e782ab042540db70f3ca38899470868b05ffc4ff27e979aeeda5feeacb98fb8816ff37fe6c
7
+ data.tar.gz: 84daffe16622fb1279926d52e32c25ba9b4b49b0243f1b0276095029dfb11ee4d67daec0f8d9621367b688e298ff1a0480500faf956f6400e48b720bcd25bd5d
@@ -1,12 +1,21 @@
1
1
  <% new_message ||= false %>
2
- <% current_user_message = message.membership.user == current_user %>
2
+ <% current_author = defined?(current_user) ? current_user : send(BulletTrain::Conversations.current_participant_helper_method) %>
3
+ <% current_user_message = message.author == current_author %>
3
4
  <% avatar = capture do %>
4
- <img src="<%= membership_profile_photo_url(message.membership) %>" title="<%= message.membership.name %>" alt="<%= message.membership.name %>" class="w-6 h-6 rounded-full <%= current_user_message ? 'order-2' : 'order-1' %>">
5
+ <% if message.membership %>
6
+ <img src="<%= membership_profile_photo_url(message.membership) %>" title="<%= message.user_name %>" alt="<%= message.user_name %>" class="w-6 h-6 rounded-full <%= current_user_message ? 'order-2' : 'order-1' %>">
7
+ <% elsif message.participant %>
8
+ <div class="<%= current_user_message ? 'order-2' : 'order-1' %>">
9
+ <% if BulletTrain::Conversations.respond_to?(:participant_avatar_partial) && BulletTrain::Conversations.participant_avatar_partial %>
10
+ <%= render BulletTrain::Conversations.participant_avatar_partial, participant: message.participant %>
11
+ <% end %>
12
+ </div>
13
+ <% end %>
5
14
  <% end %>
6
15
  <% next_message ||= message.next_message %>
7
16
 
8
17
  <%# A message series is a series of messages by the same user, each message within 5 minutes of the previous message. It has nothing to do with replies and message threads %>
9
- <% next_message_in_series = (message.user == next_message&.user) && (message.created_at > next_message.created_at - 5.minutes) && (message.parent_message_id == next_message&.parent_message_id || message.id == next_message.parent_message_id)%>
18
+ <% next_message_in_series = (message.author == next_message&.author) && (message.created_at > next_message.created_at - 5.minutes) && (message.parent_message_id == next_message&.parent_message_id || message.id == next_message.parent_message_id)%>
10
19
  <% if next_message_in_series %>
11
20
  <% avatar = nil %>
12
21
  <% end %>
@@ -28,7 +37,7 @@
28
37
  <% timestamp = next_message_in_series || show_as_thread ? '' : time_ago_in_words(message.created_at) + " ago" %>
29
38
 
30
39
  <% threaded_message = message.threaded? %>
31
- <% thread_started_by_current_user = message.thread_origin_user == current_user %>
40
+ <% thread_started_by_current_user = message.thread_origin_user == current_author %>
32
41
  <% last_message_in_thread = !placeholder_message && threaded_message && (message.next_message.nil? || message.next_message.thread_id != message.thread_id)%>
33
42
  <% out_of_thread_message = !show_as_thread && threaded_message && message.reply? && message.previous_message != message.previous_message_in_thread %>
34
43
  <% has_replies = message.replies.any? && message.next_message == message.next_message_in_thread %>
@@ -43,7 +52,7 @@
43
52
  <div class="chat-message"
44
53
  <% unless show_as_thread %>
45
54
  data-reply-target="message"
46
- data-user="<%= message.membership.label_string %>"
55
+ data-user="<%= message.author.label_string %>"
47
56
  data-message-id="<%= message.parent_message_id || message.id %>"
48
57
  data-action="mouseleave->reply#hideReplyButton"
49
58
  <% end %>
@@ -102,7 +111,7 @@
102
111
 
103
112
  <div class="flex flex-grow order-1 <%= current_user_message ? 'justify-end items-end pr-8' : 'justify-start items-start pl-8' %> <%= 'mb-3' unless next_message_in_series %>">
104
113
  <div class="<%= show_as_thread ? 'text-gray-400' : 'text-gray-300' %> text-sm">
105
- <strong><%= message.user.name %></strong>
114
+ <strong><%= message.author.name %></strong>
106
115
  <%= timestamp %>
107
116
  </div>
108
117
  </div>
@@ -1,7 +1,7 @@
1
1
  module BulletTrain
2
2
  module Themes
3
3
  module Light
4
- VERSION = "1.0.23"
4
+ VERSION = "1.0.24"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-themes-light
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.23
4
+ version: 1.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver