Skip to content
Extraits de code Groupes Projets
Valider 23c83b94 rédigé par Dennis Schubert's avatar Dennis Schubert
Parcourir les fichiers

Merge branch 'stable' into develop

parents 4abc0c59 d8505b2a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -71,6 +71,7 @@ With the port to Bootstrap 3, app/views/terms/default.haml has a new structure. ...@@ -71,6 +71,7 @@ With the port to Bootstrap 3, app/views/terms/default.haml has a new structure.
* Fix indentation and a link title on the default home page [#6212](https://github.com/diaspora/diaspora/pull/6212) * Fix indentation and a link title on the default home page [#6212](https://github.com/diaspora/diaspora/pull/6212)
* Bring peeping Tom on the 404 page back [#6226](https://github.com/diaspora/diaspora/pull/6226) * Bring peeping Tom on the 404 page back [#6226](https://github.com/diaspora/diaspora/pull/6226)
* Fix mobile photos index page [#6243](https://github.com/diaspora/diaspora/pull/6243) * Fix mobile photos index page [#6243](https://github.com/diaspora/diaspora/pull/6243)
* Fix conversations view with no contacts [#6266](https://github.com/diaspora/diaspora/pull/6266)
## Features ## Features
......
...@@ -8,6 +8,10 @@ app.views.ConversationsForm = Backbone.View.extend({ ...@@ -8,6 +8,10 @@ app.views.ConversationsForm = Backbone.View.extend({
initialize: function(opts) { initialize: function(opts) {
this.contacts = _.has(opts, "contacts") ? opts.contacts : null; this.contacts = _.has(opts, "contacts") ? opts.contacts : null;
if(!this.contacts || this.contacts.length === 0) {
this.displayNoContactsMessage();
return;
}
this.prefill = []; this.prefill = [];
if (_.has(opts, "prefillName") && _.has(opts, "prefillValue")) { if (_.has(opts, "prefillName") && _.has(opts, "prefillValue")) {
this.prefill = [{name : opts.prefillName, this.prefill = [{name : opts.prefillName,
...@@ -32,6 +36,12 @@ app.views.ConversationsForm = Backbone.View.extend({ ...@@ -32,6 +36,12 @@ app.views.ConversationsForm = Backbone.View.extend({
$("#contact_ids").attr("aria-labelledby", "toLabel"); $("#contact_ids").attr("aria-labelledby", "toLabel");
}, },
displayNoContactsMessage: function() {
$("form#new_conversation").replaceWith(
"<div class=\"well text-center\">" + Diaspora.I18n.t("conversation.new.no_contacts") + "</div>"
);
},
keyDown : function(evt) { keyDown : function(evt) {
if( evt.keyCode === 13 && evt.ctrlKey ) { if( evt.keyCode === 13 && evt.ctrlKey ) {
$(evt.target).parents("form").submit(); $(evt.target).parents("form").submit();
......
...@@ -216,6 +216,11 @@ ...@@ -216,6 +216,11 @@
#conversation_new { #conversation_new {
label { font-weight: bold; } label { font-weight: bold; }
.well {
font-weight: bold;
margin-top: 25px;
}
#new_conversation #conversation_text{ #new_conversation #conversation_text{
width: 100%; width: 100%;
max-width: 100%; max-width: 100%;
......
...@@ -165,6 +165,8 @@ en: ...@@ -165,6 +165,8 @@ en:
conversation: conversation:
participants: "Participants" participants: "Participants"
new:
no_contacts: "You need to add some contacts before you can start a conversation."
notifications: notifications:
mark_read: "Mark read" mark_read: "Mark read"
......
...@@ -8,10 +8,16 @@ Feature: private conversations ...@@ -8,10 +8,16 @@ Feature: private conversations
Given a user named "Robert Grimm" with email "bob@bob.bob" Given a user named "Robert Grimm" with email "bob@bob.bob"
And a user named "Alice Awesome" with email "alice@alice.alice" And a user named "Alice Awesome" with email "alice@alice.alice"
And a user with username "robert_grimm" is connected with "alice_awesome" And a user with username "robert_grimm" is connected with "alice_awesome"
When I sign in as "bob@bob.bob"
Scenario: open the conversations page without any contacts
Given a user with email "eve@eve.eve"
When I sign in as "eve@eve.eve"
And I am on the conversations page
Then I should see "You need to add some contacts before you can start a conversation"
Scenario: send a message Scenario: send a message
Given I send a message with subject "Greetings" and text "hello, alice!" to "Alice Awesome" When I sign in as "bob@bob.bob"
And I send a message with subject "Greetings" and text "hello, alice!" to "Alice Awesome"
Then I should see "Greetings" within "#conversation_inbox" Then I should see "Greetings" within "#conversation_inbox"
And I should see "Greetings" within "#conversation_show" And I should see "Greetings" within "#conversation_show"
And I should see "less than a minute ago" within "#conversation_inbox" And I should see "less than a minute ago" within "#conversation_inbox"
...@@ -26,7 +32,8 @@ Feature: private conversations ...@@ -26,7 +32,8 @@ Feature: private conversations
Then I should see "hey, how you doing?" within ".stream_container" Then I should see "hey, how you doing?" within ".stream_container"
Scenario: send a message using keyboard shortcuts Scenario: send a message using keyboard shortcuts
Given I send a message with subject "Greetings" and text "hello, alice!" to "Alice Awesome" using keyboard shortcuts When I sign in as "bob@bob.bob"
And I send a message with subject "Greetings" and text "hello, alice!" to "Alice Awesome" using keyboard shortcuts
Then I should see "Greetings" within "#conversation_inbox" Then I should see "Greetings" within "#conversation_inbox"
And I should see "Greetings" within "#conversation_show" And I should see "Greetings" within "#conversation_show"
And "Alice Awesome" should be part of active conversation And "Alice Awesome" should be part of active conversation
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter