Commit bf1c086c authored by Marcelo Rivera's avatar Marcelo Rivera

(revert): re-add nsfw selector

1 merge request!414[Sprint/GiddyGiraffe] (feat): ability for channels to self-declare nsfw
Pipeline #74412180 passed with stages
in 32 minutes and 7 seconds
......@@ -249,10 +249,6 @@ m-channel{
.m-channel--name{
word-break: break-word;
text-align: center;
display: grid;
grid-template-rows: 1fr;
grid-template-columns: 1fr 40px;
> * {
display:inline-block;
vertical-align:middle;
......@@ -264,9 +260,7 @@ m-channel{
text-rending: optimizeLegibilty;
-webkit-font-smoothing: antialiased;
font-size: 28px;
margin: 0 auto;
grid-row: 1 / span 1;
grid-column: 1 / span 2;
margin: 0;
}
.minds-button-edit > button {
font-size:16px;
......@@ -277,19 +271,7 @@ m-channel{
button{
border:0;
font-size:16px;
}
.m-channelName--toolbar {
display: inline-flex;
flex-direction: row;
grid-column: 2 / span 1;
grid-row: 1 / span 1;
align-self: center;
width: 30px;
& > * {
margin-right: -$minds-margin / 2;
}
margin-right:-26px;
}
}
.m-channel--username{
......
......@@ -3,13 +3,11 @@
<minds-avatar [object]="user" [editMode]="editing" (added)="upload_avatar($event)"></minds-avatar>
<div class="m-channel--name">
<h2>{{user.name}}</h2>
<div class="m-channelName--toolbar">
<span class="minds-button-edit" (click)="toggleEditing()" *ngIf="session.getLoggedInUser().guid == user.guid">
<button class="material-icons" [hidden]="editing">edit</button>
<button class="material-icons" [hidden]="!editing">done</button>
</span>
<minds-button-user-dropdown [(user)]="user"></minds-button-user-dropdown>
</div>
<span class="minds-button-edit" (click)="toggleEditing()" *ngIf="session.getLoggedInUser().guid == user.guid">
<button class="material-icons" [hidden]="editing">edit</button>
<button class="material-icons" [hidden]="!editing">done</button>
</span>
<minds-button-user-dropdown [(user)]="user" *ngIf="session.getLoggedInUser().guid != user.guid"></minds-button-user-dropdown>
</div>
<div class="m-channel--username">
<h2><span>@</span>{{user.username}}</h2>
......@@ -73,6 +71,28 @@
</div>
</div>
<div class="m-channel-bio-editor m-channel-nsfw-editor" *ngIf="editing && isOwner()">
<div class="m-channel-bio-input">
<i class="material-icons mdl-color-text--blue-grey-300">explicit</i>
<m-nsfw-selector
[selected]="user.nsfw"
[service]="'editing'"
[locked]="user.nsfw_lock"
(selected)="onNSWFSelections($event)"
>
</m-nsfw-selector>
</div>
<div
class="mdl-card mdl-color--red-500 mdl-color-text--blue-grey-50 mdl-shadow--2dp"
style="min-height:0;"
*ngIf="errorMessage"
>
<div class="mdl-card__supporting-text mdl-color-text--blue-grey-50">
{{errorMessage}}
</div>
</div>
</div>
<m-channel--social-profiles
[user]="user"
[editing]="editing && isOwner()"
......
......@@ -16,12 +16,10 @@ import { BlockListService } from "../../../../common/services/block-list.service
<button class="material-icons" (click)="toggleMenu($event)">more_vert</button>
<ul class="minds-dropdown-menu" [hidden]="!showMenu" >
<ng-container *ngIf="session.getLoggedInUser().guid != user.guid">
<li class="mdl-menu__item" [hidden]="user.blocked" (click)="block()" i18n="@@MINDS__BUTTONS__USER_DROPDOWN__BLOCK">Block @{{user.username}}</li>
<li class="mdl-menu__item" [hidden]="!user.blocked" (click)="unBlock()" i18n="@@MINDS__BUTTONS__USER_DROPDOWN__UNBLOCK">Un-Block @{{user.username}}</li>
<li class="mdl-menu__item" [hidden]="user.subscribed" (click)="subscribe()" i18n="@@MINDS__BUTTONS__USER_DROPDOWN__SUBSCRIBE">Subscribe</li>
<li class="mdl-menu__item" [hidden]="!user.subscribed" (click)="unSubscribe()" i18n="@@MINDS__BUTTONS__USER_DROPDOWN__UNSUBSCRIBE">Unsubscribe</li>
</ng-container>
<li class="mdl-menu__item" [hidden]="user.blocked" (click)="block()" i18n="@@MINDS__BUTTONS__USER_DROPDOWN__BLOCK">Block @{{user.username}}</li>
<li class="mdl-menu__item" [hidden]="!user.blocked" (click)="unBlock()" i18n="@@MINDS__BUTTONS__USER_DROPDOWN__UNBLOCK">Un-Block @{{user.username}}</li>
<li class="mdl-menu__item" [hidden]="user.subscribed" (click)="subscribe()" i18n="@@MINDS__BUTTONS__USER_DROPDOWN__SUBSCRIBE">Subscribe</li>
<li class="mdl-menu__item" [hidden]="!user.subscribed" (click)="unSubscribe()" i18n="@@MINDS__BUTTONS__USER_DROPDOWN__UNSUBSCRIBE">Unsubscribe</li>
<li class="mdl-menu__item" *ngIf="session.isAdmin()" [hidden]="user.banned !== 'yes'" (click)="unBan()" i18n="@@MINDS__BUTTONS__USER_DROPDOWN__UNBAN_GLOBALLY">Un-ban globally</li>
<li class="mdl-menu__item"
*ngIf="session.isAdmin()"
......@@ -45,7 +43,6 @@ import { BlockListService } from "../../../../common/services/block-list.service
E-mail Address
</li>
<li class="mdl-menu__item"
*ngIf="session.getLoggedInUser().guid != user.guid"
(click)="report(); showMenu = false"
i18n="@@M__ACTION__REPORT"
>
......@@ -68,13 +65,12 @@ import { BlockListService } from "../../../../common/services/block-list.service
Remove Explicit
</li>
<li class="mdl-menu__item m-user-dropdown__item--nsfw"
*ngIf="session.isAdmin() || session.getLoggedInUser().guid == user.guid"
*ngIf="session.isAdmin()"
>
<m-nsfw-selector
service="editing"
[selected]="session.isAdmin() ? user.nsfw_lock : user.nsfw"
[locked]="session.isAdmin() ? [] : user.nsfw_lock"
(selected)="setNSFW($event)"
[selected]="user.nsfw_lock"
(selected)="setNSFWLock($event)"
>
</m-nsfw-selector>
</li>
......@@ -312,16 +308,10 @@ export class UserDropdownButton {
}
}
async setNSFW(reasons: Array<{ label, value, selected}>) {
async setNSFWLock(reasons: Array<{ label, value, selected}>) {
const nsfw = reasons.map(reason => reason.value);
this.client.post(`api/v2/admin/nsfw/${this.user.guid}`, { nsfw });
this.user.nsfw = nsfw;
if (this.session.isAdmin()) {
this.client.post(`api/v2/admin/nsfw/${this.user.guid}`, { nsfw });
} else {
await this.client.post('api/v1/channel/info', { nsfw: this.user.nsfw })
}
}
async setRating(rating: number) {
......
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