Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider 1bd630d8 rédigé par Benjamin Neff's avatar Benjamin Neff
Parcourir les fichiers

Merge pull request #7536 from SuperTux88/refactor-publisher-preview

Remove avatar, name, timestamp and interactions from publisher preview
parents 7a21c227 dd6cbbbb
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -33,6 +33,7 @@ If so, please delete it since it will prevent the federation from working proper ...@@ -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) * Update help pages [#7528](https://github.com/diaspora/diaspora/pull/7528)
* Disable rendering logging in production [#7529](https://github.com/diaspora/diaspora/pull/7529) * 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) * 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 ## Bug fixes
......
...@@ -5,7 +5,6 @@ app.views.PreviewPost = app.views.Post.extend({ ...@@ -5,7 +5,6 @@ app.views.PreviewPost = app.views.Post.extend({
className: "stream-element loaded", className: "stream-element loaded",
subviews: { subviews: {
".feedback": "feedbackView",
".post-content": "postContentView", ".post-content": "postContentView",
".oembed": "oEmbedView", ".oembed": "oEmbedView",
".opengraph": "openGraphView", ".opengraph": "openGraphView",
...@@ -13,12 +12,6 @@ app.views.PreviewPost = app.views.Post.extend({ ...@@ -13,12 +12,6 @@ app.views.PreviewPost = app.views.Post.extend({
".status-message-location": "postLocationStreamView" ".status-message-location": "postLocationStreamView"
}, },
tooltipSelector: [
".timeago",
".delete",
".permalink"
].join(", "),
initialize: function() { initialize: function() {
this.model.set("preview", true); this.model.set("preview", true);
this.oEmbedView = new app.views.OEmbed({model: this.model}); this.oEmbedView = new app.views.OEmbed({model: this.model});
...@@ -26,10 +19,6 @@ app.views.PreviewPost = app.views.Post.extend({ ...@@ -26,10 +19,6 @@ app.views.PreviewPost = app.views.Post.extend({
this.pollView = new app.views.Poll({model: this.model}); this.pollView = new app.views.Poll({model: this.model});
}, },
feedbackView: function() {
return new app.views.Feedback({model: this.model});
},
postContentView: function() { postContentView: function() {
return new app.views.StatusMessage({model: this.model}); return new app.views.StatusMessage({model: this.model});
}, },
......
...@@ -197,10 +197,16 @@ ...@@ -197,10 +197,16 @@
border: 0; border: 0;
} }
// This rule is required until we switch to the newer release of bootstrap-markdown with .md-preview {
// the following commit in: // This rule is required until we switch to the newer release of bootstrap-markdown with
// https://github.com/toopay/bootstrap-markdown/commit/14a21c3837140144b27efc19c795d1a37fad70fb // the following commit in:
.md-preview { min-height: 90px; } // https://github.com/toopay/bootstrap-markdown/commit/14a21c3837140144b27efc19c795d1a37fad70fb
min-height: 90px;
.stream-element .post-content .markdown-content {
padding-top: 0;
}
}
} }
.publisher-textarea-wrapper { .publisher-textarea-wrapper {
......
...@@ -13,29 +13,17 @@ ...@@ -13,29 +13,17 @@
</span> </span>
<a href="#" class="like" rel='nofollow'>
{{#if preview}} {{~#if userLike~}}
<span>{{t "stream.like"}}</span> {{~t "stream.unlike"~}}
{{else}} {{~else~}}
<a href="#" class="like" rel='nofollow'> {{~t "stream.like"~}}
{{~#if userLike~}} {{~/if~}}
{{~t "stream.unlike"~}} </a>
{{~else~}}
{{~t "stream.like"~}}
{{~/if~}}
</a>
{{/if}}
· ·
{{#if preview}} {{#if userCanReshare}}
<span>{{t "stream.reshare"}}</span>
·
{{else if userCanReshare}}
<a href="#" class="reshare" rel='nofollow'>{{t "stream.reshare"}}</a> <a href="#" class="reshare" rel='nofollow'>{{t "stream.reshare"}}</a>
· ·
{{/if}} {{/if}}
{{#if preview}} <a href="#" class="focus_comment_textarea" rel="nofollow">{{t "stream.comment"}}</a>
<span>{{t "stream.comment"}}</span>
{{else}}
<a href="#" class="focus_comment_textarea" rel="nofollow">{{t "stream.comment"}}</a>
{{/if}}
<div class="media {{#if showPost}} {{#if nsfw}} shield-off {{/if}} {{else}} shield-active {{/if}}"> <div class="media {{#if showPost}} {{#if nsfw}} shield-off {{/if}} {{else}} shield-active {{/if}}">
{{#with author}}
<a href="/people/{{guid}}" class="img {{{hovercardable this}}}"> {{#unless preview}}
{{{personImage this}}} {{#with author}}
</a> <a href="/people/{{guid}}" class="img {{{hovercardable this}}}">
{{/with}} {{{personImage this}}}
</a>
{{/with}}
{{/unless}}
<div class="bd"> <div class="bd">
{{#if loggedIn}} {{#unless preview}}
<div class="post-controls"></div> {{#if loggedIn}}
{{/if}} <div class="post-controls"></div>
{{/if}}
<div> <div>
{{#linkToAuthor author}} {{#linkToAuthor author}}
{{~name~}} {{~name~}}
{{/linkToAuthor}} {{/linkToAuthor}}
<span class="details gray"> <span class="details gray">
- -
{{#if preview}}
<time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}" />
{{else}}
<a href="/posts/{{id}}"> <a href="/posts/{{id}}">
<time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}" /> <time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}" />
</a> </a>
...@@ -27,16 +28,18 @@ ...@@ -27,16 +28,18 @@
<a href="/posts/{{guid}}" class="permalink" title="{{t "stream.permalink"}}"> <a href="/posts/{{guid}}" class="permalink" title="{{t "stream.permalink"}}">
<i class="entypo-link"></i> <i class="entypo-link"></i>
</a> </a>
{{/if}} </span>
</span> </div>
</div> {{/unless}}
<div class="post-content"> </div> <div class="post-content"> </div>
<div class="status-message-location nsfw-hidden"> </div> <div class="status-message-location nsfw-hidden"> </div>
<div class="feedback nsfw-hidden"> </div> {{#unless preview}}
<div class="likes nsfw-hidden"> </div> <div class="feedback nsfw-hidden"> </div>
<div class="reshares nsfw-hidden"> </div> <div class="likes nsfw-hidden"> </div>
<div class="comments nsfw-hidden"> </div> <div class="reshares nsfw-hidden"> </div>
<div class="comments nsfw-hidden"> </div>
{{/unless}}
</div> </div>
</div> </div>
...@@ -36,12 +36,6 @@ describe("app.views.PreviewPost", function() { ...@@ -36,12 +36,6 @@ describe("app.views.PreviewPost", function() {
}); });
describe("render", 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() { it("calls postContentView", function() {
spyOn(app.views.PreviewPost.prototype, "postContentView"); spyOn(app.views.PreviewPost.prototype, "postContentView");
this.view.render(); this.view.render();
...@@ -55,14 +49,6 @@ describe("app.views.PreviewPost", function() { ...@@ -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() { describe("postContentView", function() {
it("calls app.views.Feedback.initialise", function() { it("calls app.views.Feedback.initialise", function() {
spyOn(app.views.StatusMessage.prototype, "initialize"); spyOn(app.views.StatusMessage.prototype, "initialize");
......
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