diff --git a/Changelog.md b/Changelog.md index ad9ba7dcc8e5d30129511de777802fd4ab8d1382..e11869d84f239d37f5858196723091f26ba1a76f 100644 --- a/Changelog.md +++ b/Changelog.md @@ -33,6 +33,7 @@ If so, please delete it since it will prevent the federation from working proper * Update help pages [#7528](https://github.com/diaspora/diaspora/pull/7528) * Disable rendering logging in production [#7529](https://github.com/diaspora/diaspora/pull/7529) * Add some missing indexes and cleanup the database if needed [#7533](https://github.com/diaspora/diaspora/pull/7533) +* Remove avatar, name, timestamp and interactions from publisher preview [#7536](https://github.com/diaspora/diaspora/pull/7536) ## Bug fixes diff --git a/app/assets/javascripts/app/views/preview_post_view.js b/app/assets/javascripts/app/views/preview_post_view.js index d3b975f6572a6b296ab866ae30ffd86d7ecc7523..41a793f7b9c076e7f3fa43324724b5a1130bf3df 100644 --- a/app/assets/javascripts/app/views/preview_post_view.js +++ b/app/assets/javascripts/app/views/preview_post_view.js @@ -5,7 +5,6 @@ app.views.PreviewPost = app.views.Post.extend({ className: "stream-element loaded", subviews: { - ".feedback": "feedbackView", ".post-content": "postContentView", ".oembed": "oEmbedView", ".opengraph": "openGraphView", @@ -13,12 +12,6 @@ app.views.PreviewPost = app.views.Post.extend({ ".status-message-location": "postLocationStreamView" }, - tooltipSelector: [ - ".timeago", - ".delete", - ".permalink" - ].join(", "), - initialize: function() { this.model.set("preview", true); this.oEmbedView = new app.views.OEmbed({model: this.model}); @@ -26,10 +19,6 @@ app.views.PreviewPost = app.views.Post.extend({ this.pollView = new app.views.Poll({model: this.model}); }, - feedbackView: function() { - return new app.views.Feedback({model: this.model}); - }, - postContentView: function() { return new app.views.StatusMessage({model: this.model}); }, diff --git a/app/assets/stylesheets/publisher.scss b/app/assets/stylesheets/publisher.scss index 5887a76c45e81ab7ce58108376e9dc099bd8626d..93cd34d199264111088edb662dfa0cb3420f92bd 100644 --- a/app/assets/stylesheets/publisher.scss +++ b/app/assets/stylesheets/publisher.scss @@ -197,10 +197,16 @@ border: 0; } - // This rule is required until we switch to the newer release of bootstrap-markdown with - // the following commit in: - // https://github.com/toopay/bootstrap-markdown/commit/14a21c3837140144b27efc19c795d1a37fad70fb - .md-preview { min-height: 90px; } + .md-preview { + // This rule is required until we switch to the newer release of bootstrap-markdown with + // the following commit in: + // https://github.com/toopay/bootstrap-markdown/commit/14a21c3837140144b27efc19c795d1a37fad70fb + min-height: 90px; + + .stream-element .post-content .markdown-content { + padding-top: 0; + } + } } .publisher-textarea-wrapper { diff --git a/app/assets/templates/feedback_tpl.jst.hbs b/app/assets/templates/feedback_tpl.jst.hbs index cf824d367b5c3147af628b218096b704a4961483..b373b2a7ea115739e3d0e3f745f161c938de4297 100644 --- a/app/assets/templates/feedback_tpl.jst.hbs +++ b/app/assets/templates/feedback_tpl.jst.hbs @@ -13,29 +13,17 @@ – </span> - -{{#if preview}} - <span>{{t "stream.like"}}</span> -{{else}} - <a href="#" class="like" rel='nofollow'> - {{~#if userLike~}} - {{~t "stream.unlike"~}} - {{~else~}} - {{~t "stream.like"~}} - {{~/if~}} - </a> -{{/if}} +<a href="#" class="like" rel='nofollow'> + {{~#if userLike~}} + {{~t "stream.unlike"~}} + {{~else~}} + {{~t "stream.like"~}} + {{~/if~}} +</a> · -{{#if preview}} - <span>{{t "stream.reshare"}}</span> - · -{{else if userCanReshare}} +{{#if userCanReshare}} <a href="#" class="reshare" rel='nofollow'>{{t "stream.reshare"}}</a> · {{/if}} -{{#if preview}} - <span>{{t "stream.comment"}}</span> -{{else}} - <a href="#" class="focus_comment_textarea" rel="nofollow">{{t "stream.comment"}}</a> -{{/if}} +<a href="#" class="focus_comment_textarea" rel="nofollow">{{t "stream.comment"}}</a> diff --git a/app/assets/templates/stream-element_tpl.jst.hbs b/app/assets/templates/stream-element_tpl.jst.hbs index bfba508f75c86779230846a0958f825ddc4c8540..ed6b8083c2e5922e7ff0717f0bbb7cf74095e8d2 100644 --- a/app/assets/templates/stream-element_tpl.jst.hbs +++ b/app/assets/templates/stream-element_tpl.jst.hbs @@ -1,25 +1,26 @@ <div class="media {{#if showPost}} {{#if nsfw}} shield-off {{/if}} {{else}} shield-active {{/if}}"> - {{#with author}} - <a href="/people/{{guid}}" class="img {{{hovercardable this}}}"> - {{{personImage this}}} - </a> - {{/with}} + + {{#unless preview}} + {{#with author}} + <a href="/people/{{guid}}" class="img {{{hovercardable this}}}"> + {{{personImage this}}} + </a> + {{/with}} + {{/unless}} <div class="bd"> - {{#if loggedIn}} - <div class="post-controls"></div> - {{/if}} + {{#unless preview}} + {{#if loggedIn}} + <div class="post-controls"></div> + {{/if}} - <div> - {{#linkToAuthor author}} - {{~name~}} - {{/linkToAuthor}} + <div> + {{#linkToAuthor author}} + {{~name~}} + {{/linkToAuthor}} - <span class="details gray"> - - - {{#if preview}} - <time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}" /> - {{else}} + <span class="details gray"> + - <a href="/posts/{{id}}"> <time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}" /> </a> @@ -27,16 +28,18 @@ <a href="/posts/{{guid}}" class="permalink" title="{{t "stream.permalink"}}"> <i class="entypo-link"></i> </a> - {{/if}} - </span> - </div> + </span> + </div> + {{/unless}} <div class="post-content"> </div> <div class="status-message-location nsfw-hidden"> </div> - <div class="feedback nsfw-hidden"> </div> - <div class="likes nsfw-hidden"> </div> - <div class="reshares nsfw-hidden"> </div> - <div class="comments nsfw-hidden"> </div> + {{#unless preview}} + <div class="feedback nsfw-hidden"> </div> + <div class="likes nsfw-hidden"> </div> + <div class="reshares nsfw-hidden"> </div> + <div class="comments nsfw-hidden"> </div> + {{/unless}} </div> </div> diff --git a/spec/javascripts/app/views/preview_post_view_spec.js b/spec/javascripts/app/views/preview_post_view_spec.js index e2c1b5aecb848f7cc50550efc59b50ecba07ec88..af5f0a4557593c44f9d68ed361e6f77f17a8c40f 100644 --- a/spec/javascripts/app/views/preview_post_view_spec.js +++ b/spec/javascripts/app/views/preview_post_view_spec.js @@ -36,12 +36,6 @@ describe("app.views.PreviewPost", function() { }); describe("render", function() { - it("calls feedbackView", function() { - spyOn(app.views.PreviewPost.prototype, "feedbackView"); - this.view.render(); - expect(app.views.PreviewPost.prototype.feedbackView).toHaveBeenCalled(); - }); - it("calls postContentView", function() { spyOn(app.views.PreviewPost.prototype, "postContentView"); this.view.render(); @@ -55,14 +49,6 @@ describe("app.views.PreviewPost", function() { }); }); - describe("feedbackView", function() { - it("calls app.views.Feedback.initialise", function() { - spyOn(app.views.Feedback.prototype, "initialize"); - this.view.feedbackView(); - expect(app.views.Feedback.prototype.initialize).toHaveBeenCalledWith({model: this.model}); - }); - }); - describe("postContentView", function() { it("calls app.views.Feedback.initialise", function() { spyOn(app.views.StatusMessage.prototype, "initialize");