effective_messaging 0.1.6 → 0.1.7

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: d37eb42009c2a8b1145f7e8cd7b35cd855ccbb3ec7a242a2f8c0aecf25ac3ada
4
- data.tar.gz: 47e1d414597b4e055e78dd7fac10bb69ebc74aa2eb1daef1b432d8a952798d90
3
+ metadata.gz: db18ef76924e1e79b7bb689ec41d693f920e045838c194a97c644dcc83c5d801
4
+ data.tar.gz: be11de5dc4779d03356d0deee5f7f7c00688d452e0e67861b39cf61354c0c906
5
5
  SHA512:
6
- metadata.gz: aba43008da596da217249e50059c97308e0583984e37823e3604f481980a882eee20d8ef6f074a649b46b2d305bbfe70c254cc748aa54d333c276a0cba218442
7
- data.tar.gz: e16f2c230b43c1d39a47ea7a1e761894c1c02ecb05e4cc1ee6fe5442833a7c2ed96fdb660ae907c23ba2a33e0159eb95765ec6843f203ef0ec4b1720720d8562
6
+ metadata.gz: f100cd5242657f441e5d6535254503b914b8382164ea94dd342b57d7876c44c63f694a15b3d9b64c6edef51f58a6a6e26cdec7482b5ed925f2bb3e232f904d16
7
+ data.tar.gz: 55ad03d9d06b23c70defd737a2a047080944868ccc51c08494ba9feb50f401073297ef667db89fdf03bbfafec6034c9c9f282df008b1bbad861c351251a578bb
@@ -5,11 +5,11 @@ class EffectiveChatsDatatable < Effective::Datatable
5
5
 
6
6
  col :token, visible: false
7
7
  col :created_at, visible: false
8
- col :updated_at, label: 'Last message'
8
+ col :updated_at, label: 'Last active'
9
9
 
10
10
  col :title
11
- col :chat_users, label: 'Participants'
12
- col :chat_messages_count, label: 'Messages'
11
+ col :chat_users
12
+ col :chat_messages_count, label: ets(Effective::ChatMessage)
13
13
 
14
14
  actions_col
15
15
  end
@@ -1,5 +1,5 @@
1
1
  = tabs do
2
- = tab "Chat" do
2
+ = tab(chat) do
3
3
  = render 'admin/chats/form_chat', chat: chat
4
4
 
5
5
  - if chat.persisted?
@@ -3,15 +3,15 @@
3
3
 
4
4
  - if f.object.anonymous?
5
5
  = f.static_field :anonymous do
6
- %p Yes, this is an anonymous chat. User names and emails will not be displayed
6
+ %p Yes, this is an anonymous #{etd(f.object)}. User names and emails will not be displayed
7
7
  - else
8
- = f.check_box :anonymous, label: 'Yes, this is an anonymous chat', hint: 'user names and emails will not be displayed'
8
+ = f.check_box :anonymous, label: "Yes, this is an anonymous #{etd(f.object)}", hint: 'user names and emails will not be displayed'
9
9
 
10
10
  = f.hidden_field :user_type, value: current_user.class.name
11
11
 
12
12
  - ajax_url = (@select2_ajax_path || effective_resources.users_admin_select2_ajax_index_path) unless Rails.env.test?
13
13
 
14
- = f.select :user_ids, current_user.class.all, required: true,
15
- ajax_url: ajax_url, hint: 'The users that can participate in this chat'
14
+ = f.select :user_ids, current_user.class.all, required: true, label: ets(chat.chat_users),
15
+ ajax_url: ajax_url, hint: "The users that can participate in this #{etd(f.object)}"
16
16
 
17
17
  = effective_submit(f)
@@ -7,7 +7,7 @@
7
7
  = render(partial: 'effective/chats/chat_message', collection: chat.chat_messages, chat: chat)
8
8
 
9
9
  - if chat.chat_messages.blank?
10
- %p There are no messages so far. Please send one!
10
+ %p There are no #{etsd(chat.chat_messages)} so far. Please send one!
11
11
 
12
12
  %hr
13
13
 
@@ -16,12 +16,12 @@
16
16
 
17
17
  .card
18
18
  .card-header.bg-secondary
19
- Send message
19
+ = et('effective_messaging.send')
20
20
  .card-body
21
21
  %p Your name is displayed as <strong>#{chat_user.name}</strong>
22
22
 
23
23
  = f.fields_for :chat_messages, chat_message do |fcm|
24
24
  - # The user and name are set by controller's current_user
25
- = fcm.text_area :body, required: true, label: 'Send message...'
25
+ = fcm.text_area :body, required: true, label: 'Send a message...'
26
26
 
27
- = f.submit 'Send Message'
27
+ = f.submit et('effective_messaging.send')
@@ -6,16 +6,16 @@
6
6
  = badges('anonymous')
7
7
 
8
8
  = succeed('.') do
9
- A chat with
9
+ A #{etd(chat)} with
10
10
 
11
11
  - if current_chat_user.present? && chat_users_count < 5
12
12
  = (chat.chat_users - [current_chat_user]).map(&:name).to_sentence
13
13
  - else
14
- = pluralize(chat_users_count, 'participants')
14
+ = pluralize(chat_users_count, etd(chat.chat_users))
15
15
 
16
16
  opened
17
17
  = time_ago_in_words(chat.created_at)
18
18
  ago
19
19
 
20
20
  = succeed('.') do
21
- = pluralize(chat.chat_messages_count, 'message')
21
+ = pluralize(chat.chat_messages_count, etd(chat.chat_messages))
@@ -1,10 +1,10 @@
1
- %h2 Messages and Chat
1
+ %h2= t('effective_messaging.dashboard')
2
2
 
3
3
  - if current_user.chats.present?
4
- %p You are a member of #{pluralize(current_user.chats.length, 'chat')}.
4
+ %p You are a #{etd(Effective::ChatUser)} of #{pluralize(current_user.chats.length, etd(Effective::Chat))}.
5
5
 
6
6
  - datatable = EffectiveResources.best('EffectiveChatsDatatable').new(self, namespace: :effective)
7
7
  = render_datatable(datatable, simple: true)
8
8
 
9
9
  - else
10
- %p You haven't received any messages. When you do, we'll show it here.
10
+ %p You haven't received any #{etsd(Effective::ChatMessage)}. When you do, we'll show it here.
@@ -0,0 +1,10 @@
1
+ en:
2
+ effective_messaging:
3
+ dashboard: 'Chat Messages'
4
+ send: 'Send Message'
5
+
6
+ activerecord:
7
+ models:
8
+ effective/chat: 'Chat'
9
+ effective/chat_user: 'Chat Participant'
10
+ effective/chat_message: 'Chat Message'
@@ -1,3 +1,3 @@
1
1
  module EffectiveMessaging
2
- VERSION = '0.1.6'.freeze
2
+ VERSION = '0.1.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_messaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-09 00:00:00.000000000 Z
11
+ date: 2023-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -227,6 +227,7 @@ files:
227
227
  - app/views/effective/messaging/_dashboard.html.haml
228
228
  - app/views/effective/messaging_mailer/chat_new_message.liquid
229
229
  - config/effective_messaging.rb
230
+ - config/locales/effective_messaging.yml
230
231
  - config/routes.rb
231
232
  - db/migrate/01_create_effective_messaging.rb.erb
232
233
  - db/seeds.rb