...
 
Commits (2)
......@@ -67,6 +67,7 @@ export interface MindsUser {
is_mature?: boolean;
mature_lock?: boolean;
tags?: Array<string>;
toaster_notifications?: boolean;
}
export interface MindsGroup {
......
......@@ -314,6 +314,10 @@ m-media--grid{
letter-spacing: 0.25px;
}
h1.m-media-content--heading a {
text-decoration: none;
}
.m-media-content--info {
display: flex;
......
......@@ -55,7 +55,8 @@
<div class="mdl-grid m-media-content--meta">
<div class="mdl-cell mdl-cell--12-col m-media-content--title" [ngClass]="{ 'm-mature-text': attachment.shouldBeBlurred(entity) }">
<div class="mdl-cell mdl-cell--8-col mdl-cell--6-col-phone">
<h1 class="m-media-content--heading" [ngClass]="{'m-media--long-heading': entity.title && entity.title.length > 80}" >{{ entity.title }}</h1>
<h1 class="m-media-content--heading" [innerHtml]="entity.title | tags" [ngClass]="{'m-media--long-heading': entity.title && entity.title.length > 80}" >
</h1>
</div>
<!-- Additional block -->
......
......@@ -33,6 +33,8 @@ export class NotificationsToasterComponent implements OnInit {
listenForNotifications() {
this.notification.onReceive.subscribe((notification: any) => {
if(this.isToasterDisabled()) return;
this.notifications.unshift(notification);
this.detectChanges();
......@@ -62,4 +64,8 @@ export class NotificationsToasterComponent implements OnInit {
this.cd.markForCheck();
this.cd.detectChanges();
}
isToasterDisabled() {
return window.Minds.user && !window.Minds.user.toaster_notifications;
}
}
......@@ -98,6 +98,24 @@
</div>
<!-- END: MATURE CONTENT -->
<!-- START: TOASTER NOTIFICATIONS -->
<div class="m-settings--section m-border m-settings--toaster">
<h4 i18n="@@MINDS__SETTINGS__TOASTER_TITLE">Notifications</h4>
<div class="mdl-card__supporting-text">
<input type="checkbox"
id="flag_toaster"
(click)="change()"
name="toaster_notifications"
[(ngModel)]="toaster_notifications"
/>
<label for="flag_toaster">
<ng-container i18n="@@MINDS__SETTINGS__TOASTER_LABEL">Enable toaster notifications</ng-container>
</label>
</div>
</div>
<!-- END: TOASTER NOTIFICATIONS -->
<!-- START: LANGUAGE -->
<div class="m-settings--section m-border m-settings--language">
......@@ -126,4 +144,4 @@
<ng-container i18n="@@MINDS__SETTINGS__CLOSE_ALL_SESSIONS_CONFIRM">Close All Sessions</ng-container>
</button>
</div>
<!-- END: SESSIONS -->
<!-- END: SESSIONS -->
\ No newline at end of file
......@@ -28,6 +28,7 @@ export class SettingsGeneralComponent {
email: string;
mature: boolean = false;
enabled_mails: boolean = true;
toaster_notifications: boolean = true;
password: string;
password1: string;
......@@ -100,6 +101,7 @@ export class SettingsGeneralComponent {
this.language = response.channel.language || 'en';
this.selectedCategories = response.channel.categories || [];
this.openSessions = response.channel.open_sessions || 1;
this.toaster_notifications = response.channel.toaster_notifications;
this.thirdpartynetworks.overrideStatus(response.thirdpartynetworks);
......@@ -157,7 +159,8 @@ export class SettingsGeneralComponent {
mature: this.mature ? 1 : 0,
disabled_emails: this.enabled_mails ? 0 : 1,
language: this.language,
categories: this.selectedCategories
categories: this.selectedCategories,
toaster_notifications: this.toaster_notifications
})
.then((response: any) => {
this.changed = false;
......@@ -181,6 +184,8 @@ export class SettingsGeneralComponent {
window.location.reload(true);
}
window.Minds.user.toaster_notifications = this.toaster_notifications;
this.inProgress = false;
}).catch(e=> {
this.inProgress = false;
......
......@@ -7422,6 +7422,20 @@
<context context-type="linenumber">133</context>
</context-group>
</trans-unit>
<trans-unit id="MINDS__SETTINGS__TOASTER_TITLE" datatype="html">
<source>Notifications</source>
<context-group purpose="location">
<context context-type="sourcefile">app/modules/settings/general/general.component.ts</context>
<context context-type="linenumber">103</context>
</context-group>
</trans-unit>
<trans-unit id="MINDS__SETTINGS__TOASTER_LABEL" datatype="html">
<source>Enable toaster notifications</source>
<context-group purpose="location">
<context context-type="sourcefile">app/modules/settings/general/general.component.ts</context>
<context context-type="linenumber">112</context>
</context-group>
</trans-unit>
<trans-unit id="MINDS__SETTINGS__LANGUAGE_SETTINGS_TITLE" datatype="html">
<source>Language Settings</source>
<context-group purpose="location">
......
......@@ -3324,6 +3324,14 @@
<source>Email Notifications</source>
<target>Email Notifications</target>
</trans-unit>
<trans-unit id="MINDS__SETTINGS__TOASTER_TITLE">
<source>Notifications</source>
<target>Notifications</target>
</trans-unit>
<trans-unit id="MINDS__SETTINGS__TOASTER_LABEL">
<source>Enable toaster notifications</source>
<target>Enable toaster notifications</target>
</trans-unit>
<trans-unit id="MINDS__SETTINGS__SESSIONS">
<source>Sessions</source>
<target>Sessions</target>
......
......@@ -3406,6 +3406,14 @@
<source>Email Notifications</source>
<target>Thông báo Email</target>
</trans-unit>
<trans-unit id="MINDS__SETTINGS__TOASTER_TITLE">
<source>Notifications</source>
<target>Notifications</target>
</trans-unit>
<trans-unit id="MINDS__SETTINGS__TOASTER_LABEL">
<source>Enable toaster notifications</source>
<target>Enable toaster notifications</target>
</trans-unit>
<trans-unit id="MINDS__SETTINGS__SESSIONS">
<source>Sessions</source>
<target>Phiên</target>
......