message_train 0.5.3 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/helpers/message_train/boxes_helper.rb +28 -0
- data/app/helpers/message_train/collectives_helper.rb +17 -0
- data/app/models/message_train/attachment.rb +1 -1
- data/app/models/message_train/ignore.rb +5 -1
- data/app/models/message_train/message.rb +6 -2
- data/app/models/message_train/receipt.rb +5 -1
- data/app/views/message_train/boxes/_dropdown_list.html.haml +5 -4
- data/app/views/message_train/boxes/_list_item.html.haml +6 -5
- data/app/views/message_train/boxes/_widget.html.haml +10 -9
- data/app/views/message_train/boxes/show.html.haml +47 -46
- data/app/views/message_train/collectives/_dropdown_list.html.haml +7 -6
- data/app/views/message_train/collectives/_list_item.html.haml +6 -5
- data/app/views/message_train/collectives/_widget.html.haml +9 -8
- data/app/views/message_train/conversations/_conversation.html.haml +25 -24
- data/app/views/message_train/conversations/show.html.haml +11 -10
- data/app/views/message_train/messages/_message.html.haml +46 -45
- data/app/views/message_train/unsubscribes/index.html.haml +1 -1
- data/message_train.gemspec +3 -3
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/features/messages_spec.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22a2a975ced65cb55871dcfa1f5a2a0e8bf84f7c
|
4
|
+
data.tar.gz: cbad8e0df97bd6caef57802f258e4bfa1d6644b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a165b762a0af4973aa939c3deb7b2a836b9fd993dc96b5ac3ce20a97fa3f6ed838df503393a0cd0e0ca4918cd1db0606256f13750ee830808b51b6d2b43c5d5c
|
7
|
+
data.tar.gz: 954357e4d1563d1b5d61f6f678b7caecde7ffe30cb5541206398325168b1573f95baf18cf524b701c721bae87d41b605f3f091ef3dfbd65df0a2da348129cde3
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.0
|
@@ -58,5 +58,33 @@ module MessageTrain
|
|
58
58
|
participant.id
|
59
59
|
)
|
60
60
|
end
|
61
|
+
|
62
|
+
def boxes_dropdown_cache_key(boxes)
|
63
|
+
parts = [
|
64
|
+
'boxes-dropdown',
|
65
|
+
@box_user
|
66
|
+
]
|
67
|
+
updated_at = boxes.collect do |x|
|
68
|
+
x.conversations && x.conversations.maximum(:updated_at)
|
69
|
+
end.compact.max
|
70
|
+
updated_at && parts << [
|
71
|
+
updated_at
|
72
|
+
]
|
73
|
+
parts
|
74
|
+
end
|
75
|
+
|
76
|
+
def boxes_widget_cache_key(boxes)
|
77
|
+
parts = [
|
78
|
+
'boxes-widget',
|
79
|
+
@box_user
|
80
|
+
]
|
81
|
+
updated_at = boxes.collect do |x|
|
82
|
+
x.conversations && x.conversations.maximum(:updated_at)
|
83
|
+
end.compact.max
|
84
|
+
updated_at && parts << [
|
85
|
+
updated_at
|
86
|
+
]
|
87
|
+
parts
|
88
|
+
end
|
61
89
|
end
|
62
90
|
end
|
@@ -70,5 +70,22 @@ module MessageTrain
|
|
70
70
|
]
|
71
71
|
)
|
72
72
|
end
|
73
|
+
|
74
|
+
def collectives_cache_key(collective_boxes, box_user)
|
75
|
+
parts = [
|
76
|
+
'collectives-dropdown',
|
77
|
+
box_user
|
78
|
+
]
|
79
|
+
collective_boxes.collect do |table_name, x|
|
80
|
+
updated_at = x.collect do |y|
|
81
|
+
y.conversations && y.conversations.maximum(:updated_at)
|
82
|
+
end.compact.max
|
83
|
+
updated_at && parts << [
|
84
|
+
table_name,
|
85
|
+
updated_at
|
86
|
+
]
|
87
|
+
end
|
88
|
+
parts
|
89
|
+
end
|
73
90
|
end
|
74
91
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module MessageTrain
|
2
2
|
# Attachment model
|
3
3
|
class Attachment < ActiveRecord::Base
|
4
|
-
belongs_to :message, foreign_key: :message_train_message_id
|
4
|
+
belongs_to :message, foreign_key: :message_train_message_id, touch: true
|
5
5
|
has_attached_file(
|
6
6
|
:attachment,
|
7
7
|
styles: lambda do |attachment|
|
@@ -2,7 +2,11 @@ module MessageTrain
|
|
2
2
|
# Ignore model
|
3
3
|
class Ignore < ActiveRecord::Base
|
4
4
|
belongs_to :participant, polymorphic: true
|
5
|
-
belongs_to
|
5
|
+
belongs_to(
|
6
|
+
:conversation,
|
7
|
+
foreign_key: :message_train_conversation_id,
|
8
|
+
touch: true
|
9
|
+
)
|
6
10
|
|
7
11
|
validates_presence_of :conversation, :participant
|
8
12
|
|
@@ -5,7 +5,11 @@ module MessageTrain
|
|
5
5
|
serialize :recipients_to_save, Hash
|
6
6
|
|
7
7
|
# Relationships
|
8
|
-
belongs_to
|
8
|
+
belongs_to(
|
9
|
+
:conversation,
|
10
|
+
foreign_key: :message_train_conversation_id,
|
11
|
+
touch: true
|
12
|
+
)
|
9
13
|
belongs_to :sender, polymorphic: true
|
10
14
|
has_many :attachments, foreign_key: :message_train_message_id
|
11
15
|
has_many :receipts, foreign_key: :message_train_message_id
|
@@ -44,7 +48,7 @@ module MessageTrain
|
|
44
48
|
end
|
45
49
|
|
46
50
|
def self.mark(mark_to_set, participant)
|
47
|
-
|
51
|
+
find_each do |message|
|
48
52
|
message.mark(mark_to_set, participant)
|
49
53
|
end
|
50
54
|
end
|
@@ -3,7 +3,11 @@ module MessageTrain
|
|
3
3
|
class Receipt < ActiveRecord::Base
|
4
4
|
belongs_to :recipient, polymorphic: true
|
5
5
|
belongs_to :received_through, polymorphic: true
|
6
|
-
belongs_to
|
6
|
+
belongs_to(
|
7
|
+
:message,
|
8
|
+
foreign_key: :message_train_message_id,
|
9
|
+
touch: true
|
10
|
+
)
|
7
11
|
validates_presence_of :recipient, :message
|
8
12
|
|
9
13
|
default_scope { order(updated_at: :desc) }
|
@@ -1,4 +1,5 @@
|
|
1
|
-
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
- cache boxes_dropdown_cache_key(boxes), 'message-train' do
|
2
|
+
- unless boxes.empty?
|
3
|
+
= dropdown_nav_item "#{:box_title_in.l} #{badge(boxes.first.unread_count.to_s) unless boxes.first.unread_count == 0}".html_safe, '#' do
|
4
|
+
- boxes.each do |box|
|
5
|
+
= box_nav_item box
|
@@ -1,5 +1,6 @@
|
|
1
|
-
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
- cache ['boxes-list-item', @box_user, box], 'message-train' do
|
2
|
+
- if box.present?
|
3
|
+
%li{ html_options }
|
4
|
+
= link_to box.title, message_train.box_path(box.division)
|
5
|
+
- if unread_count > 0
|
6
|
+
= badge unread_count.to_s
|
@@ -1,10 +1,11 @@
|
|
1
1
|
- unless boxes.empty?
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
-
|
7
|
-
-
|
8
|
-
|
9
|
-
|
10
|
-
|
2
|
+
- cache boxes_widget_cache_key(boxes), 'message-train' do
|
3
|
+
.hidden-print
|
4
|
+
%h3= :messages.l
|
5
|
+
.text-center= link_to :compose.l, message_train.new_box_message_path(:in), class: 'btn btn-lg btn-primary btn-compose'
|
6
|
+
%ul.list-group
|
7
|
+
- boxes.each do |box|
|
8
|
+
- if @collective.nil?
|
9
|
+
= box_list_item box, class: 'list-group-item'
|
10
|
+
- else
|
11
|
+
= collective_list_item box, class: 'list-group-item'
|
@@ -4,52 +4,53 @@
|
|
4
4
|
- else
|
5
5
|
- add_title collective_name(@collective) + ' ' + @box.title
|
6
6
|
- marking_path = message_train.collective_box_path(@collective.path_part, @box.division)
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
%
|
15
|
-
|
16
|
-
|
17
|
-
%
|
18
|
-
= link_to :all.l, '#0', class: 'check', data: { selector: '.message_train_conversation'}
|
19
|
-
= link_to :none.l, '#0', class: 'check', data: { selector: ''}
|
20
|
-
= link_to :read.l, '#0', class: 'check', data: { selector: '.message_train_conversation.read'}
|
21
|
-
= link_to :unread.l, '#0', class: 'check', data: { selector: '.message_train_conversation.unread'}
|
22
|
-
.btn-group
|
23
|
-
%button.btn.btn-info.dropdown-toggle{ aria: { expanded: 'false', haspopup: 'true' }, data: { toggle: 'dropdown'}, type: 'button' }
|
24
|
-
= :mark.l
|
25
|
-
%span.caret
|
26
|
-
%ul.dropdown-menu
|
27
|
-
%li
|
28
|
-
= link_to :mark_as_name.l(name: :read.l), '#0', class: 'mark', id: 'mark-read', data: { mark: 'read'}
|
29
|
-
%li
|
30
|
-
= link_to :mark_as_name.l(name: :unread.l), '#0', class: 'mark', id: 'mark-unread', data: { mark: 'unread'}
|
31
|
-
- if @box.division == :trash
|
7
|
+
- cache ['boxes-show', @box_user, @box], 'message-train' do
|
8
|
+
= form_tag marking_path, method: :put, remote: true, id: 'box', data: { type: :json } do
|
9
|
+
- unless @conversations.empty?
|
10
|
+
#box-actions.box-actions
|
11
|
+
.btn-group.check-all
|
12
|
+
%button.btn.btn-default{ type: 'button' }
|
13
|
+
= check_box_tag 'check_all', 'all', false
|
14
|
+
%button.btn.btn-default.dropdown-toggle{ aria: { expanded: 'false', haspopup: 'true' }, data: { toggle: 'dropdown'}, type: 'button' }
|
15
|
+
%span.caret
|
16
|
+
%span.sr-only= :toggle_dropdown.l
|
17
|
+
%ul.dropdown-menu
|
32
18
|
%li
|
33
|
-
= link_to :
|
34
|
-
|
35
|
-
|
36
|
-
= link_to :
|
37
|
-
|
19
|
+
= link_to :all.l, '#0', class: 'check', data: { selector: '.message_train_conversation'}
|
20
|
+
= link_to :none.l, '#0', class: 'check', data: { selector: ''}
|
21
|
+
= link_to :read.l, '#0', class: 'check', data: { selector: '.message_train_conversation.read'}
|
22
|
+
= link_to :unread.l, '#0', class: 'check', data: { selector: '.message_train_conversation.unread'}
|
23
|
+
.btn-group
|
24
|
+
%button.btn.btn-info.dropdown-toggle{ aria: { expanded: 'false', haspopup: 'true' }, data: { toggle: 'dropdown'}, type: 'button' }
|
25
|
+
= :mark.l
|
26
|
+
%span.caret
|
27
|
+
%ul.dropdown-menu
|
38
28
|
%li
|
39
|
-
= link_to :mark_as_name.l(name: :
|
40
|
-
%li.divider{ role: 'separator' }
|
41
|
-
- if @box.division == :ignored
|
29
|
+
= link_to :mark_as_name.l(name: :read.l), '#0', class: 'mark', id: 'mark-read', data: { mark: 'read'}
|
42
30
|
%li
|
43
|
-
= link_to :mark_as_name.l(name: :
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
31
|
+
= link_to :mark_as_name.l(name: :unread.l), '#0', class: 'mark', id: 'mark-unread', data: { mark: 'unread'}
|
32
|
+
- if @box.division == :trash
|
33
|
+
%li
|
34
|
+
= link_to :mark_as_name.l(name: :untrashed.l), '#0', class: 'mark', id: 'mark-untrash', data: { mark: 'untrash'}
|
35
|
+
%li.divider{ role: 'separator' }
|
36
|
+
%li
|
37
|
+
= link_to :mark_as_name.l(name: :deleted.l), '#0', class: 'mark', id: 'mark-deleted', data: { mark: 'deleted'}
|
38
|
+
- else
|
39
|
+
%li
|
40
|
+
= link_to :mark_as_name.l(name: :trashed.l), '#0', class: 'mark', id: 'mark-trash', data: { mark: 'trash'}
|
41
|
+
%li.divider{ role: 'separator' }
|
42
|
+
- if @box.division == :ignored
|
43
|
+
%li
|
44
|
+
= link_to :mark_as_name.l(name: :unignored.l), '#0', class: 'mark', id: 'mark-unignored', data: { mark: 'unignore'}
|
45
|
+
- else
|
46
|
+
%li
|
47
|
+
= link_to :mark_as_name.l(name: :ignored.l), '#0', class: 'mark', id: 'mark-ignored', data: { mark: 'ignore'}
|
48
|
+
- if @collective.nil?
|
49
|
+
= link_to :compose.l, message_train.new_box_message_path(@box.division), class: 'btn btn-primary compose'
|
50
|
+
- elsif @collective.allows_sending_by? @box_user
|
51
|
+
= link_to :compose_to_collective.l(collective: collective_name(@collective)), message_train.new_collective_box_message_path(@collective.path_part, @box.division), class: 'btn btn-primary compose'
|
52
|
+
%span#spinner.hide= icon 'refresh spinning'
|
53
|
+
= hidden_field_tag :mark_to_set
|
54
|
+
%table#message-train-conversations.message-train-conversations.table.table-condensed
|
55
|
+
= render @conversations
|
56
|
+
= paginate @conversations
|
@@ -1,6 +1,7 @@
|
|
1
|
-
-
|
2
|
-
- collective_boxes.
|
3
|
-
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
- cache collectives_cache_key(collective_boxes, box_user), 'message-train' do
|
2
|
+
- unless collective_boxes.empty?
|
3
|
+
- collective_boxes.each do |key, boxes|
|
4
|
+
- if show[key]
|
5
|
+
= dropdown_nav_item "#{key.to_s.humanize} #{badge(total_unread_count[key].to_s) unless total_unread_count[key] == 0}".html_safe, '#' do
|
6
|
+
- boxes.each do |box|
|
7
|
+
= collective_nav_item box, box_user
|
@@ -1,5 +1,6 @@
|
|
1
|
-
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
- cache ['collectives-list-item', @box_user, box], 'message-train' do
|
2
|
+
- if box.present?
|
3
|
+
%li{ html_options }
|
4
|
+
= link_to box.title, message_train.collective_box_path(box.parent.path_part, box.division)
|
5
|
+
- if unread_count > 0
|
6
|
+
= badge unread_count.to_s
|
@@ -1,8 +1,9 @@
|
|
1
|
-
-
|
2
|
-
.
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
-
|
8
|
-
|
1
|
+
- cache ['collectives-widget', box_user, collective], 'message-train' do
|
2
|
+
- unless collective.boxes_for_participant(box_user).empty?
|
3
|
+
.hidden-print
|
4
|
+
%h3= :collective_messages.l(collective: collective_name(collective))
|
5
|
+
- if collective.allows_sending_by?(box_user)
|
6
|
+
.text-center= link_to :compose_to_collective.l(collective: collective_name(collective)), message_train.new_collective_box_message_path(collective.path_part, :sent), class: 'btn btn-lg btn-primary btn-compose'
|
7
|
+
%ul.list-group
|
8
|
+
- collective.boxes_for_participant(box_user).each do |box|
|
9
|
+
= collective_list_item box, class: 'list-group-item'
|
@@ -1,24 +1,25 @@
|
|
1
|
-
|
2
|
-
%
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
1
|
+
- cache ['conversation-result', @box_user, conversation], 'message-train' do
|
2
|
+
%tr.message_train_conversation{ class: conversation_class(@box, conversation), id: 'message_train_conversation_' + conversation.id.to_s }
|
3
|
+
%td.col-xs-1= check_box_tag "objects[conversations][#{conversation.id.to_s}]", conversation.id
|
4
|
+
- if @collective.nil?
|
5
|
+
%td.col-xs-2= link_to conversation_senders(conversation), message_train.box_conversation_path(@box.division, conversation)
|
6
|
+
%td.col-xs-8= link_to conversation.subject, message_train.box_conversation_path(@box.division, conversation)
|
7
|
+
%td
|
8
|
+
- if conversation.attachments.any?
|
9
|
+
= icon 'paperclip'
|
10
|
+
%td.col-xs-1.conversation-actions
|
11
|
+
= conversation_trashed_toggle conversation
|
12
|
+
- if @box.division == :trash
|
13
|
+
= conversation_deleted_toggle conversation
|
14
|
+
%td.col-xs-1.date-column= fuzzy_date(conversation.updated_at)
|
15
|
+
- else
|
16
|
+
%td.col-xs-2= link_to conversation_senders(conversation), message_train.collective_box_conversation_path(@collective.path_part, @box.division, conversation)
|
17
|
+
%td.col-xs-8= link_to conversation.subject, message_train.collective_box_conversation_path(@collective.path_part, @box.division, conversation)
|
18
|
+
%td
|
19
|
+
- if conversation.attachments.any?
|
20
|
+
= icon 'paperclip'
|
21
|
+
%td.col-xs-1.conversation-actions
|
22
|
+
= conversation_trashed_toggle conversation, @collective
|
23
|
+
- if @box.division == :trash
|
24
|
+
= conversation_deleted_toggle conversation, @collective
|
25
|
+
%td.col-xs-1.date-column= fuzzy_date(conversation.updated_at)
|
@@ -1,12 +1,13 @@
|
|
1
1
|
- add_title @conversation.subject
|
2
2
|
- add_subtitle :updated_at_time.l(time: @conversation.updated_at)
|
3
|
-
|
4
|
-
#
|
5
|
-
.
|
6
|
-
|
7
|
-
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
=
|
12
|
-
|
3
|
+
- cache ['conversations-show', @box_user, @conversation], 'message-train' do
|
4
|
+
#box
|
5
|
+
#conversation-actions.conversation-actions.pull-right
|
6
|
+
.btn.btn-default.btn-lg= conversation_ignored_toggle(@conversation)
|
7
|
+
#message_train_conversation.clear-both
|
8
|
+
- unless @messages.empty?
|
9
|
+
#message_train_messages.messages.panel-group{aria: { multiselectable: 'true' }, role: 'tablist'}
|
10
|
+
= render @messages
|
11
|
+
= paginate @messages
|
12
|
+
= modal 'attachment_preview', :attachment_preview.l do
|
13
|
+
#image_placeholder
|
@@ -1,45 +1,46 @@
|
|
1
|
-
-
|
2
|
-
|
3
|
-
.panel-
|
4
|
-
.message
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
.panel-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
.panel-
|
20
|
-
.message
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
.panel-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
.
|
37
|
-
-
|
38
|
-
.
|
39
|
-
|
40
|
-
|
41
|
-
.
|
42
|
-
-
|
43
|
-
|
44
|
-
|
45
|
-
|
1
|
+
- cache ['message-result', @box_user, message], 'message-train' do
|
2
|
+
- if message.draft
|
3
|
+
.panel.panel-default{ class: message_class(@box, message), id: "message_train_message_#{message.id}", data: { mark_path: message_train.box_conversation_path(@box.division, id: message.message_train_conversation_id, objects: { 'messages' => {message.id.to_s => message.id.to_s} }) } }
|
4
|
+
.panel-heading{role: 'tab', id: "message_#{message.id}_heading"}
|
5
|
+
.message-actions.pull-right
|
6
|
+
= message_read_toggle message
|
7
|
+
= message_trashed_toggle message
|
8
|
+
- if @box.division == :trash
|
9
|
+
= message_deleted_toggle message
|
10
|
+
%h4.panel-title
|
11
|
+
= link_to "#message_#{message.id}_collapse", aria: { controls: "message_#{message.id}_collapse", expanded: 'true' }, data: { parent: '#accordion', toggle: 'collapse' }, role: 'button' do
|
12
|
+
%span.caret
|
13
|
+
= :message_draft.l
|
14
|
+
%small= message.updated_at
|
15
|
+
.panel-collapse.collapse.in{aria: { labelledby: "message_#{message.id}_heading" }, role: 'tabpanel', id: "message_#{message.id}_collapse"}
|
16
|
+
.panel-body
|
17
|
+
= render partial: 'message_train/messages/form', locals: { message: message }
|
18
|
+
- else
|
19
|
+
.panel.panel-default{ class: message_class(@box, message), id: "message_train_message_#{message.id}", data: { mark_path: message_train.box_conversation_path(@box.division, id: message.message_train_conversation_id, objects: { 'messages' => {message.id.to_s => message.id.to_s} }) } }
|
20
|
+
.panel-heading{role: 'tab', id: "message_#{message.id}_heading"}
|
21
|
+
.message-actions.pull-right
|
22
|
+
= message_read_toggle message
|
23
|
+
= message_trashed_toggle message
|
24
|
+
- if @box.division == :trash
|
25
|
+
= message_deleted_toggle message
|
26
|
+
%h4.panel-title
|
27
|
+
= link_to "#message_#{message.id}_collapse", aria: { controls: "message_#{message.id}_collapse", expanded: 'true' }, data: { parent: '#accordion', toggle: 'collapse' }, role: 'button' do
|
28
|
+
%span.caret
|
29
|
+
= :from_sender.l(sender: message.sender.display_name)
|
30
|
+
%small= message.updated_at
|
31
|
+
.panel-collapse.collapse.in{aria: { labelledby: "message_#{message.id}_heading" }, role: 'tabpanel', id: "message_#{message.id}_collapse"}
|
32
|
+
.panel-body
|
33
|
+
%p= :to_recipient.l(recipient: message_recipients(message))
|
34
|
+
%p.lead= message.subject
|
35
|
+
= sanitize message.body
|
36
|
+
- if message.attachments.any?
|
37
|
+
.row.attachment-thumbnails
|
38
|
+
- for attachment in message.attachments
|
39
|
+
.col-md-4
|
40
|
+
= attachment_link(attachment)
|
41
|
+
- if @box.parent.allows_sending_by?(@box_user)
|
42
|
+
.panel-footer
|
43
|
+
- if @collective.nil?
|
44
|
+
= link_to :reply.l, message_train.new_box_message_path(@box, conversation_id: message.message_train_conversation_id), class: 'btn btn-primary'
|
45
|
+
- else
|
46
|
+
= link_to :reply.l, message_train.new_collective_box_message_path(@collective.path_part, @box, conversation_id: message.message_train_conversation_id), class: 'btn btn-primary'
|
@@ -1,5 +1,5 @@
|
|
1
1
|
- add_title :manage_your_email_notifications.l
|
2
|
-
- if
|
2
|
+
- if @box_user.unsubscribed_from_all?
|
3
3
|
%p= :you_have_chosen_not_to_be_emailed.l
|
4
4
|
%p= icon_button_to 'primary', 'check', :enable_some_notifications.l, message_train.unsubscribes_all_path, method: :delete
|
5
5
|
- else
|
data/message_train.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: message_train 0.
|
5
|
+
# stub: message_train 0.6.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "message_train"
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.6.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Karen Lundgren"]
|
14
|
-
s.date = "2016-03-
|
14
|
+
s.date = "2016-03-03"
|
15
15
|
s.description = "Rails 4 Engine providing private/public messaging for any object, such as Users or Groups"
|
16
16
|
s.email = "karen.e.lundgren@gmail.com"
|
17
17
|
s.extra_rdoc_files = [
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -16,6 +16,7 @@ RSpec.feature 'Messages' do
|
|
16
16
|
fill_in 'Subject', with: 'This is a draft.'
|
17
17
|
fill_in_ckeditor 'Body', with: 'This is the body.'
|
18
18
|
submit_via_button 'Send'
|
19
|
+
wait_until { page.has_css? '.alert' }
|
19
20
|
end
|
20
21
|
it_behaves_like(
|
21
22
|
'a bootstrap page with an alert',
|
@@ -52,6 +53,7 @@ RSpec.feature 'Messages' do
|
|
52
53
|
end
|
53
54
|
end
|
54
55
|
submit_via_button 'Send'
|
56
|
+
wait_until { page.has_css? '.alert' }
|
55
57
|
end
|
56
58
|
it_behaves_like(
|
57
59
|
'a bootstrap page with an alert',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: message_train
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karen Lundgren
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|