Skip to content
Commits on Source (8)
......@@ -2,8 +2,8 @@
box-sizing: border-box;
border-radius: 8px;
@include m-theme(){
border: 2px solid rgba(themed($m-white), 0.6);
background: rgba(themed($m-grey-950), 0.7);
border: 1px solid rgba(themed($m-white-always), 0.7);
background: themed($m-black-always);
}
display: block;
......@@ -11,7 +11,7 @@
text-decoration: none;
height: 48px;
padding: 0 8px;
padding: 2px 8px 0 8px;
margin: auto;
cursor: pointer;
......@@ -34,13 +34,13 @@
-webkit-font-smoothing: antialiased;
@include m-theme(){
color: themed($m-white);
color: themed($m-white-always);
}
}
i.material-icons {
@include m-theme(){
color: themed($m-white);
color: themed($m-white-always);
}
}
}
......@@ -262,9 +262,14 @@ m-channel{
font-size: 28px;
margin: 0;
}
.minds-button-edit > button {
font-size:16px;
}
minds-user-dropdown > button {
font-size:24px;
}
button{
border:0;
font-size:16px;
margin-right:-26px;
}
}
......
......@@ -18,6 +18,7 @@ import { BlockListService } from "../../../../common/services/block-list.service
<ul class="minds-dropdown-menu" [hidden]="!showMenu" >
<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"
......@@ -185,6 +186,17 @@ export class UserDropdownButton {
this.showMenu = false;
}
subscribe() {
this.user.subscribed = true;
this.client.post('api/v1/subscribe/' + this.user.guid, {})
.then((response: any) => {
this.user.subscribed = true;
})
.catch((e) => {
this.user.subscribed = false;
});
}
unSubscribe() {
this.user.subscribed = false;
this.client.delete('api/v1/subscribe/' + this.user.guid, {})
......@@ -247,7 +259,6 @@ export class UserDropdownButton {
e.stopPropagation();
if (this.showMenu) {
this.showMenu = false;
return;
}
this.showMenu = true;
......
......@@ -221,6 +221,7 @@ export class RemindMock {
@Input() object;
@Input() events;
@Input() boosted;
@Output() matureVisibilityChange: EventEmitter<any> = new EventEmitter<any>();
}
@Component({
......
......@@ -61,14 +61,14 @@
<div m-read-more class="mdl-card__supporting-text message m-mature-message" [class.m-activity--message-remind]="activity.remind_object"
[hidden]="!activity.message || editing">
<a class="m-mature-text-toggle" (click)="activity.mature_visibility = !activity.mature_visibility"
<a class="m-mature-text-toggle" (click)="toggleMatureVisibility()"
*ngIf="attachment.shouldBeBlurred(activity) || attachment.isForcefullyShown(activity)"
[ngClass]="{ 'mdl-color-text--red-500': attachment.isForcefullyShown(activity) }">
<i class="material-icons m-material-icons-inline">explicit</i>
</a>
<span class="m-mature-message-content" [innerHtml]="activity.message | tags" [ngClass]="{ 'm-mature-text': attachment.shouldBeBlurred(activity) }"
(click)="activity.mature && !activity.mature_visibility ? activity.mature_visibility = !activity.mature_visibility : null">
(click)="activity.mature && !activity.mature_visibility ? toggleMatureVisibility(): null">
</span>
<m-read-more--button></m-read-more--button>
</div>
......@@ -127,7 +127,7 @@
<div class="m-rich-embed"
*ngIf="activity.perma_url && activity.title"
[ngClass]="{ 'm-mature-content': attachment.shouldBeBlurred(activity), 'm-mature-content-shown': attachment.isForcefullyShown(activity) }">
<div class="m-mature-overlay" (click)="activity.mature_visibility = !activity.mature_visibility">
<div class="m-mature-overlay" (click)="toggleMatureVisibility()">
<span class="m-mature-overlay-note">
<i class="material-icons" title="Mature content" i18n-title="@@M__COMMON__MATURE_CONTENT">explicit</i>
<span i18n="@@M__COMMON__CONFIRM_18">Click to confirm your are 18+</span>
......@@ -156,7 +156,7 @@
<div class="item item-image item-image-video m-activity--video"
[ngClass]="{ 'm-mature-content': attachment.shouldBeBlurred(activity), 'm-mature-content-shown': attachment.isForcefullyShown(activity) }"
*ngIf="activity.custom_type == 'video'">
<div class="m-mature-overlay" (click)="activity.mature_visibility = !activity.mature_visibility">
<div class="m-mature-overlay" (click)="toggleMatureVisibility()">
<span class="m-mature-overlay-note">
<i class="material-icons" title="Mature content" i18n-title="@@M__COMMON__MATURE_CONTENT">explicit</i>
<span i18n="@@M__COMMON__CONFIRM_18">Click to confirm your are 18+</span>
......@@ -181,7 +181,7 @@
<div class="item item-image allow-select m-activity--image"
[ngClass]="{ 'm-mature-content': attachment.shouldBeBlurred(activity), 'm-mature-content-shown': attachment.isForcefullyShown(activity) }"
*ngIf="activity.thumbnail_src && !activity.perma_url">
<div class="m-mature-overlay" (click)="activity.mature_visibility = !activity.mature_visibility">
<div class="m-mature-overlay" (click)="toggleMatureVisibility()">
<span class="m-mature-overlay-note">
<i class="material-icons" title="Mature content" i18n-title="@@M__COMMON__MATURE_CONTENT">explicit</i>
<span i18n="@@M__COMMON__CONFIRM_18">Click to confirm your are 18+</span>
......@@ -197,7 +197,7 @@
<div class="item item-image allow-select"
[ngClass]="{ 'm-mature-content': attachment.shouldBeBlurred(activity), 'm-mature-content-shown': attachment.isForcefullyShown(activity) }"
*ngIf="activity.custom_type == 'batch'">
<div class="m-mature-overlay" (click)="activity.mature_visibility = !activity.mature_visibility">
<div class="m-mature-overlay" (click)="toggleMatureVisibility()">
<span class="m-mature-overlay-note">
<i class="material-icons" title="Mature content" i18n-title="@@M__COMMON__MATURE_CONTENT">explicit</i>
<span i18n="@@M__COMMON__CONFIRM_18">Click to confirm your are 18+</span>
......@@ -214,7 +214,12 @@
<!-- Reminds -->
<div *ngIf="activity.remind_object">
<ng-container *ngIf="!isOwnerBlocked(activity.remind_object); else blockedRemindTemplate">
<minds-remind [object]="activity.remind_object" [events]="childEventsEmitter" [boosted]="activity.boosted"></minds-remind>
<minds-remind
[object]="activity.remind_object"
[events]="childEventsEmitter"
[boosted]="activity.boosted"
(matureVisibilityChange)="onRemindMatureVisibilityChange()"
></minds-remind>
</ng-container>
<ng-template #blockedRemindTemplate>
<div class="m-activity__blockedRemind">
......
......@@ -149,13 +149,13 @@ export class Activity implements OnInit {
this.activityAnalyticsOnViewService.setEntity(this.activity);
if (
this.activity.custom_type == 'batch'
&& this.activity.custom_data
this.activity.custom_type == 'batch'
&& this.activity.custom_data
&& this.activity.custom_data[0].src
) {
this.activity.custom_data[0].src = this.activity.custom_data[0].src.replace(this.minds.site_url, this.minds.cdn_url);
}
if (!this.activity.message) {
this.activity.message = '';
}
......@@ -413,6 +413,25 @@ export class Activity implements OnInit {
return activity && activity.pending && activity.pending !== '0';
}
toggleMatureVisibility() {
this.activity.mature_visibility = !this.activity.mature_visibility;
if (this.activity.remind_object) {
// this.activity.remind_object.mature_visibility = !this.activity.remind_object.mature_visibility;
this.activity.remind_object = Object.assign({}, {
...this.activity.remind_object,
mature_visibility: !this.activity.remind_object.mature_visibility
});
}
this.detectChanges();
}
onRemindMatureVisibilityChange() {
this.activity.mature_visibility = !this.activity.mature_visibility;
}
detectChanges() {
this.cd.markForCheck();
this.cd.detectChanges();
......
import { Component, ChangeDetectionStrategy, ChangeDetectorRef, EventEmitter, Input } from '@angular/core';
import { Component, ChangeDetectionStrategy, ChangeDetectorRef, EventEmitter, Input, Output } from '@angular/core';
import { Client } from '../../../../../services/api';
import { Session } from '../../../../../services/session';
......@@ -33,6 +33,8 @@ export class Remind {
menuOptions: any = [];
canDelete: boolean = false;
@Output('matureVisibilityChange') onMatureVisibilityChange: EventEmitter<any> = new EventEmitter<any>();
constructor(
public session: Session,
public client: Client,
......@@ -119,4 +121,10 @@ export class Remind {
togglePin() { /* NOOP */ }
menuOptionSelected(e) { /* NOOP */ }
toggleMatureVisibility() {
this.activity.mature_visibility = !this.activity.mature_visibility;
this.onMatureVisibilityChange.emit();
}
}
......@@ -398,7 +398,7 @@
<!-- Boost revoked -->
<ng-template ngSwitchCase="boost_revoked">
<a [routerLink]="notification.entityObj.type == 'activity' ? ['/newsfeed', notification.entityObj.guid] : ['/boost/console/content']">
<a [routerLink]="notification.entityObj && notification.entityObj.type == 'activity' ? ['/newsfeed', notification.entityObj.guid] : ['/boost/console/content']">
<p><ng-container i18n="@@NOTIFICATIONS__NOTIFICATION__BOOST_REVOKED__BOOST_FOR">You revoked your boost <span *ngIf="notification.entityObj">for </span></ng-container>
<span class="pseudo-link mdl-color-text--blue-grey-400" *ngIf="notification.entityObj && notification.entityObj.title">{{notification.entityObj.title | excerpt}}</span>
<span class="pseudo-link mdl-color-text--blue-grey-400" *ngIf="notification.entityObj && !notification.entityObj.title && notification.entityObj.name">{{notification.entityObj.name}}</span>
......