decidim-core 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/decidim/messaging/conversations_controller.rb +6 -1
- data/app/helpers/decidim/messaging/conversation_helper.rb +9 -5
- data/app/views/layouts/decidim/_user_menu.html.erb +1 -0
- data/config/locales/ca.yml +1 -0
- data/config/locales/en.yml +1 -0
- data/config/locales/es.yml +1 -0
- data/lib/decidim/core/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57b7690831d061951bff19709653676583f7ef7e
|
4
|
+
data.tar.gz: 24e3aa8fbbc19862a9891cb7f501430e98a3ab4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfeedbe421c2b4a64b1e2870e9b5f51f8c981cc57c38b9aa26b0399ad8e0abebadb7fc5ad60c8ca4496dbf1f72433631b1abe4fc0ed9d0dc01f06feb8d3890f3
|
7
|
+
data.tar.gz: 1c8fe1ffcef6c25e84c40e88c472303ffc026166716cceb766392296353aee3ecbb54e208c8413e2e16f64b98aa68a3a4059a5854d561449ad6e6f6f06067b5a
|
@@ -4,8 +4,10 @@ module Decidim
|
|
4
4
|
module Messaging
|
5
5
|
# The controller to handle the user's conversations.
|
6
6
|
class ConversationsController < Decidim::ApplicationController
|
7
|
+
include ConversationHelper
|
7
8
|
include FormFactory
|
8
9
|
|
10
|
+
helper ConversationHelper
|
9
11
|
helper Decidim::DatetimeHelper
|
10
12
|
|
11
13
|
before_action :authenticate_user!
|
@@ -14,8 +16,11 @@ module Decidim
|
|
14
16
|
|
15
17
|
def new
|
16
18
|
authorize! :create, Conversation
|
17
|
-
|
18
19
|
@form = form(ConversationForm).from_params(params)
|
20
|
+
|
21
|
+
conversation = conversation_between(current_user, @form.recipient)
|
22
|
+
|
23
|
+
redirect_to conversation_path(conversation) if conversation
|
19
24
|
end
|
20
25
|
|
21
26
|
def create
|
@@ -21,16 +21,20 @@ module Decidim
|
|
21
21
|
def link_to_current_or_new_conversation_with(user)
|
22
22
|
return decidim.new_user_session_path unless user_signed_in?
|
23
23
|
|
24
|
-
|
25
|
-
conversation.participants.to_set == [current_user, user].to_set
|
26
|
-
end
|
24
|
+
conversation = conversation_between(current_user, user)
|
27
25
|
|
28
|
-
if
|
29
|
-
decidim.conversation_path(
|
26
|
+
if conversation
|
27
|
+
decidim.conversation_path(conversation)
|
30
28
|
else
|
31
29
|
decidim.new_conversation_path(recipient_id: user.id)
|
32
30
|
end
|
33
31
|
end
|
32
|
+
|
33
|
+
def conversation_between(one_user, another_user)
|
34
|
+
UserConversations.for(one_user).find do |conversation|
|
35
|
+
conversation.participants.to_set == [one_user, another_user].to_set
|
36
|
+
end
|
37
|
+
end
|
34
38
|
end
|
35
39
|
end
|
36
40
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<li><%= link_to t(".profile"), decidim.account_path %></li>
|
2
2
|
<li><%= link_to t(".notifications"), decidim.notifications_path %></li>
|
3
|
+
<li><%= link_to t(".conversations"), decidim.conversations_path %></li>
|
3
4
|
<% if can? :read, :admin_dashboard %>
|
4
5
|
<li><%= link_to t(".admin_dashboard"), decidim_admin.root_path %></li>
|
5
6
|
<% end %>
|
data/config/locales/ca.yml
CHANGED
data/config/locales/en.yml
CHANGED
data/config/locales/es.yml
CHANGED
data/lib/decidim/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-12-
|
13
|
+
date: 2017-12-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: active_link_to
|
@@ -508,28 +508,28 @@ dependencies:
|
|
508
508
|
requirements:
|
509
509
|
- - '='
|
510
510
|
- !ruby/object:Gem::Version
|
511
|
-
version: 0.8.
|
511
|
+
version: 0.8.3
|
512
512
|
type: :runtime
|
513
513
|
prerelease: false
|
514
514
|
version_requirements: !ruby/object:Gem::Requirement
|
515
515
|
requirements:
|
516
516
|
- - '='
|
517
517
|
- !ruby/object:Gem::Version
|
518
|
-
version: 0.8.
|
518
|
+
version: 0.8.3
|
519
519
|
- !ruby/object:Gem::Dependency
|
520
520
|
name: decidim-dev
|
521
521
|
requirement: !ruby/object:Gem::Requirement
|
522
522
|
requirements:
|
523
523
|
- - '='
|
524
524
|
- !ruby/object:Gem::Version
|
525
|
-
version: 0.8.
|
525
|
+
version: 0.8.3
|
526
526
|
type: :development
|
527
527
|
prerelease: false
|
528
528
|
version_requirements: !ruby/object:Gem::Requirement
|
529
529
|
requirements:
|
530
530
|
- - '='
|
531
531
|
- !ruby/object:Gem::Version
|
532
|
-
version: 0.8.
|
532
|
+
version: 0.8.3
|
533
533
|
description: Adds core features so other engines can hook into the framework.
|
534
534
|
email:
|
535
535
|
- josepjaume@gmail.com
|