Merge branch 'stable' into develop
This commit is contained in:
commit
2549f44b7c
9 changed files with 56 additions and 21 deletions
|
|
@ -25,6 +25,7 @@ Ruby 2.0 is no longer officially supported.
|
||||||
* Remove some old temporary workarounds [#5964](https://github.com/diaspora/diaspora/pull/5964)
|
* Remove some old temporary workarounds [#5964](https://github.com/diaspora/diaspora/pull/5964)
|
||||||
* Remove unused `hasPhotos` and `hasText` functions [#5969](https://github.com/diaspora/diaspora/pull/5969)
|
* Remove unused `hasPhotos` and `hasText` functions [#5969](https://github.com/diaspora/diaspora/pull/5969)
|
||||||
* Replace foreman with eye [#5966](https://github.com/diaspora/diaspora/pull/5966)
|
* Replace foreman with eye [#5966](https://github.com/diaspora/diaspora/pull/5966)
|
||||||
|
* Improved handling of reshares with deleted roots [#5968](https://github.com/diaspora/diaspora/pull/5968)
|
||||||
|
|
||||||
## Bug fixes
|
## Bug fixes
|
||||||
* Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846)
|
* Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846)
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,8 @@ app.views.Content = app.views.Base.extend({
|
||||||
text : app.helpers.textFormatter(this.model.get("text"), this.model.get("mentioned_people")),
|
text : app.helpers.textFormatter(this.model.get("text"), this.model.get("mentioned_people")),
|
||||||
largePhoto : this.largePhoto(),
|
largePhoto : this.largePhoto(),
|
||||||
smallPhotos : this.smallPhotos(),
|
smallPhotos : this.smallPhotos(),
|
||||||
location: this.location()
|
location: this.location(),
|
||||||
|
isReshare : this.model.get("post_type") === "Reshare"
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,11 @@
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
width: auto;
|
width: auto;
|
||||||
|
|
||||||
|
#real-post-content div.reshare {
|
||||||
|
border-left: 2px solid #DDD;
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.oembed { width: 95%; }
|
.oembed { width: 95%; }
|
||||||
.photo_attachments {
|
.photo_attachments {
|
||||||
img.big_stream_photo { max-width: 90%; }
|
img.big_stream_photo { max-width: 90%; }
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,11 @@
|
||||||
<div class="reshare">
|
<div class="reshare">
|
||||||
|
<div class="media">
|
||||||
{{#if root}}
|
{{#if root}}
|
||||||
|
|
||||||
<div class="media">
|
|
||||||
|
|
||||||
{{#with root}}
|
{{#with root}}
|
||||||
<a href="/people/{{author.guid}}" class="img {{{hovercardable this}}}">
|
<a href="/people/{{author.guid}}" class="img {{{hovercardable this}}}">
|
||||||
{{{personImage author 'small'}}}
|
{{{personImage author 'small'}}}
|
||||||
</a>
|
</a>
|
||||||
{{/with}}
|
|
||||||
|
|
||||||
{{#with root}}
|
|
||||||
<div class="bd">
|
<div class="bd">
|
||||||
<div>
|
<div>
|
||||||
{{#linkToAuthor author}}
|
{{#linkToAuthor author}}
|
||||||
|
|
@ -33,14 +28,10 @@
|
||||||
|
|
||||||
{{> status-message}}
|
{{> status-message}}
|
||||||
</div>
|
</div>
|
||||||
|
{{else}}
|
||||||
</div>
|
<p>
|
||||||
|
{{t "stream.original_post_deleted"}}
|
||||||
{{else}}
|
</p>
|
||||||
|
{{/if}}
|
||||||
<p>
|
</div>
|
||||||
{{t "stream.original_post_deleted"}}
|
|
||||||
</p>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,15 @@
|
||||||
|
|
||||||
<div class="collapsible">
|
<div class="collapsible">
|
||||||
<div class="markdown-content">
|
<div class="markdown-content">
|
||||||
{{{text}}}
|
{{#if text}}
|
||||||
|
{{{text}}}
|
||||||
|
{{else if isReshare}}
|
||||||
|
<div class="reshare">
|
||||||
|
<p>
|
||||||
|
{{t "stream.original_post_deleted"}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="oembed"></div>
|
<div class="oembed"></div>
|
||||||
<div class="opengraph"></div>
|
<div class="opengraph"></div>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ class Reshare < Post
|
||||||
end
|
end
|
||||||
|
|
||||||
def root_diaspora_id
|
def root_diaspora_id
|
||||||
self.root.author.diaspora_handle
|
root.try(:author).try(:diaspora_handle)
|
||||||
end
|
end
|
||||||
|
|
||||||
delegate :o_embed_cache, :open_graph_cache,
|
delegate :o_embed_cache, :open_graph_cache,
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,8 @@
|
||||||
- if !post.activity_streams?
|
- if !post.activity_streams?
|
||||||
= render 'status_messages/status_message', :post => post, :photos => post.photos
|
= render 'status_messages/status_message', :post => post, :photos => post.photos
|
||||||
- else
|
- else
|
||||||
= t('.deleted')
|
.content
|
||||||
|
= t('.deleted')
|
||||||
|
|
||||||
.reshare_via
|
.reshare_via
|
||||||
%span
|
%span
|
||||||
|
|
|
||||||
|
|
@ -10,4 +10,19 @@ describe("app.views.Content", function(){
|
||||||
expect(this.view.smallPhotos().length).toEqual(1);
|
expect(this.view.smallPhotos().length).toEqual(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("presenter", function(){
|
||||||
|
beforeEach(function(){
|
||||||
|
this.post.set({text : ""}); // for textFormatter
|
||||||
|
});
|
||||||
|
|
||||||
|
it("provides isReshare", function(){
|
||||||
|
expect(this.view.presenter().isReshare).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("provides isReshare and be true when the post is a reshare", function(){
|
||||||
|
this.post.set({post_type : "Reshare"});
|
||||||
|
expect(this.view.presenter().isReshare).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,19 @@ describe Reshare, :type => :model do
|
||||||
expect(FactoryGirl.create(:reshare, :public => false).public).to be true
|
expect(FactoryGirl.create(:reshare, :public => false).public).to be true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#root_diaspora_id" do
|
||||||
|
it "should return the root diaspora id" do
|
||||||
|
reshare = FactoryGirl.create(:reshare, root: FactoryGirl.build(:status_message, author: bob.person, public: true))
|
||||||
|
expect(reshare.root_diaspora_id).to eq(bob.person.diaspora_handle)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should be nil if no root found" do
|
||||||
|
reshare = FactoryGirl.create(:reshare, root: FactoryGirl.build(:status_message, author: bob.person, public: true))
|
||||||
|
reshare.root = nil
|
||||||
|
expect(reshare.root_diaspora_id).to be_nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "#receive" do
|
describe "#receive" do
|
||||||
let(:receive_reshare) { @reshare.receive(@root.author.owner, @reshare.author) }
|
let(:receive_reshare) { @reshare.receive(@root.author.owner, @reshare.author) }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue