Move nsfw-shield to status-message

closes #6270
This commit is contained in:
Steffen van Bergerem 2015-07-30 01:17:07 +02:00 committed by Jonne Haß
parent ed463750b1
commit 536d1fe0e7
6 changed files with 40 additions and 38 deletions

View file

@ -16,6 +16,7 @@
## Features ## Features
* Implement NodeInfo [#6239](https://github.com/diaspora/diaspora/pull/6239) * Implement NodeInfo [#6239](https://github.com/diaspora/diaspora/pull/6239)
* Display original author on reshares of NSFW posts [#6270](https://github.com/diaspora/diaspora/pull/6270)
# 0.5.2.0 # 0.5.2.0

View file

@ -103,6 +103,8 @@
padding-left: 10px; padding-left: 10px;
} }
.nsfw-off { display: none; }
.nsfw-shield { display: none; }
.oembed { width: 95%; } .oembed { width: 95%; }
.photo_attachments { .photo_attachments {
img.big_stream_photo { max-width: 90%; } img.big_stream_photo { max-width: 90%; }

View file

@ -45,6 +45,9 @@
border-bottom: 1px solid $border-grey; border-bottom: 1px solid $border-grey;
padding: 10px; padding: 10px;
& > .media { & > .media {
&.shield-active .nsfw-hidden { display: none; }
&:not(.shield-active) .nsfw-shield { display: none; }
&:not(.shield-off) .nsfw-off { display: none; }
& > .img > .avatar { & > .img > .avatar {
margin-top: 5px; margin-top: 5px;
&.small { &.small {

View file

@ -1,5 +1,29 @@
<div class="nsfw-shield">
<strong>
#NSFW
</strong>
|
<a href="#" class="show_nsfw_post">
{{t "stream.show_nsfw_post"}}
</a>
|
<a href="#" class="toggle_nsfw_state">
{{t "stream.show_nsfw_posts"}}
</a>
</div>
<div class="nsfw-off">
<strong>
#NSFW
</strong>
|
<a href="#" class="toggle_nsfw_state">
{{t "stream.hide_nsfw_posts"}}
</a>
</div>
{{#if largePhoto}} {{#if largePhoto}}
<div class="photo_attachments"> <div class="photo_attachments nsfw-hidden">
<a href="#" class="stream-photo-link"> <a href="#" class="stream-photo-link">
{{#with largePhoto}} {{#with largePhoto}}
<img src="{{sizes.large}}" class="stream-photo big_stream_photo" data-small-photo="{{sizes.small}}" data-full-photo="{{sizes.large}}" rel="lightbox"> <img src="{{sizes.large}}" class="stream-photo big_stream_photo" data-small-photo="{{sizes.small}}" data-full-photo="{{sizes.large}}" rel="lightbox">
@ -14,7 +38,7 @@
</div> </div>
{{/if}} {{/if}}
<div class="collapsible"> <div class="collapsible nsfw-hidden">
<div class="markdown-content"> <div class="markdown-content">
{{#if text}} {{#if text}}
{{{text}}} {{{text}}}

View file

@ -1,5 +1,4 @@
<div class="media"> <div class="media {{#if showPost}} {{#if nsfw}} shield-off {{/if}} {{else}} shield-active {{/if}}">
{{#with author}} {{#with author}}
<a href="/people/{{guid}}" class="img {{{hovercardable this}}}"> <a href="/people/{{guid}}" class="img {{{hovercardable this}}}">
{{{personImage this}}} {{{personImage this}}}
@ -54,38 +53,11 @@
</span> </span>
</div> </div>
{{#if showPost}} <div class="post-content"> </div>
{{#if nsfw}} <div class="status-message-location nsfw-hidden"> </div>
<div class="nsfw_off">
<strong>
#NSFW
</strong>
|
<a href="#" class="toggle_nsfw_state">
{{t "stream.hide_nsfw_posts"}}
</a>
</div>
{{/if}}
<div class="post-content"> </div>
<div class="status-message-location"> </div>
<div class="feedback"> </div>
<div class="likes"> </div>
<div class="comments"> </div>
{{else}}
<div class="nsfw-shield">
<strong>
#NSFW
</strong>
|
<a href="#" class="show_nsfw_post">
{{t "stream.show_nsfw_post"}}
</a>
|
<a href="#" class="toggle_nsfw_state">
{{t "stream.show_nsfw_posts"}}
</a>
</div>
{{/if}}
<div class="feedback nsfw-hidden"> </div>
<div class="likes nsfw-hidden"> </div>
<div class="comments nsfw-hidden"> </div>
</div> </div>
</div>

View file

@ -144,7 +144,7 @@ describe("app.views.StreamPost", function(){
this.view = new this.PostViewClass({model : this.statusMessage}).render(); this.view = new this.PostViewClass({model : this.statusMessage}).render();
this.hiddenPosts = function(){ this.hiddenPosts = function(){
return this.view.$(".nsfw-shield"); return this.view.$(".media.shield-active .nsfw-shield");
}; };
}); });