Unverified Commit 06b61b64 authored by Benjamin Neff's avatar Benjamin Neff

Merge branch 'next-minor' into develop

parents b0da14c3 57b7debd
......@@ -25,6 +25,8 @@
## Bug fixes
* Don't hide posts when blocking someone from the profile [#7379](https://github.com/diaspora/diaspora/pull/7379)
* Disable autocomplete for the conversation form recipient input [#7375](https://github.com/diaspora/diaspora/pull/7375)
* Fix sharing indicator on profile page for blocked users [#7382](https://github.com/diaspora/diaspora/pull/7382)
## Features
* Add links to liked and commented pages [#5502](https://github.com/diaspora/diaspora/pull/5502)
......
......@@ -30,7 +30,7 @@ app.models.Person = Backbone.Model.extend({
},
isBlocked: function() {
return (this.get('relationship') === 'blocked');
return (this.get("block") !== false);
},
block: function() {
......
......@@ -10,7 +10,6 @@ app.views.Content = app.views.Base.extend({
text : app.helpers.textFormatter(this.model.get("text"), this.model.get("mentioned_people")),
largePhoto : this.largePhoto(),
smallPhotos : this.smallPhotos(),
location: this.location(),
isReshare : this.model.get("post_type") === "Reshare"
});
},
......@@ -38,11 +37,6 @@ app.views.Content = app.views.Base.extend({
$(evt.currentTarget).hide();
},
location: function(){
var location = this.model.get("location")? this.model.get("location") : "";
return location;
},
collapseOversized : function() {
var collHeight = 200
, elem = this.$(".collapsible")
......
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
app.views.LocationStream = app.views.Content.extend({
app.views.LocationStream = app.views.Base.extend({
events: {
"click .near-from": "toggleMap"
},
......
......@@ -11,7 +11,6 @@
//= require jquery-placeholder
//= require rails-timeago
//= require jquery.events.input
//= require jquery.infinitescroll-custom
//= require jquery-ui/core
//= require jquery-ui/widget
//= require jquery-ui/mouse
......
......@@ -52,7 +52,6 @@ class PersonPresenter < BasePresenter
def relationship
return false unless current_user
return :blocked if is_blocked?
contact = current_user_person_contact
return :not_sharing unless contact
......
......@@ -4,7 +4,12 @@
.form-group
%label#to-label{for: "contacts-search-input"}= t(".to")
.recipients-tag-list.clearfix#recipients-tag-list
= text_field_tag "contact_autocomplete", nil, id: "contacts-search-input", class: "form-control"
= text_field_tag "contact_autocomplete",
nil,
id: "contacts-search-input",
class: "form-control",
autocomplete: "off"
- unless defined?(mobile) && mobile
= text_field_tag "person_ids", nil, id: "contact-ids", type: "hidden",
aria: {labelledby: "to-label"}
......
......@@ -4,7 +4,7 @@ describe("app.models.Person", function() {
this.mutualContact = factory.person({relationship: "mutual"});
this.sharingContact = factory.person({relationship: "sharing"});
this.receivingContact = factory.person({relationship: "receiving"});
this.blockedContact = factory.person({relationship: "blocked", block: {id: 1}});
this.blockedContact = factory.person({relationship: "sharing", block: {id: 1}});
});
describe("initialize", function() {
......@@ -20,9 +20,9 @@ describe("app.models.Person", function() {
it("indicates if the person is sharing", function() {
expect(this.mutualContact.isSharing()).toBeTruthy();
expect(this.sharingContact.isSharing()).toBeTruthy();
expect(this.blockedContact.isSharing()).toBeTruthy();
expect(this.receivingContact.isSharing()).toBeFalsy();
expect(this.blockedContact.isSharing()).toBeFalsy();
});
});
......
......@@ -153,6 +153,7 @@ var factory = {
"name": "Bob Grimm",
"diaspora_id": "bob@localhost:3000",
"relationship": "sharing",
"block": false,
"is_own_profile": false
};
return _.extend({}, defaults, overrides);
......
......@@ -92,12 +92,6 @@ describe PersonPresenter do
end
context "relationship" do
it "is blocked?" do
allow(current_user).to receive(:block_for) { double(id: 1) }
allow(current_user).to receive(:contact_for) { non_contact }
expect(@p.full_hash[:relationship]).to be(:blocked)
end
it "is mutual?" do
allow(current_user).to receive(:contact_for) { mutual_contact }
expect(@p.full_hash[:relationship]).to be(:mutual)
......@@ -118,6 +112,19 @@ describe PersonPresenter do
expect(@p.full_hash[:relationship]).to be(:not_sharing)
end
end
describe "block" do
it "contains the block id if it exists" do
allow(current_user).to receive(:contact_for) { non_contact }
allow(current_user).to receive(:block_for) { double(id: 1) }
expect(@p.full_hash[:block][:id]).to be(1)
end
it "is false if no block is present" do
allow(current_user).to receive(:contact_for) { non_contact }
expect(@p.full_hash[:block]).to be(false)
end
end
end
describe "#hovercard" do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment