...
 
Commits (5)
......@@ -56,7 +56,7 @@
*ngIf="session.isLoggedIn() && !this.standalone"
></m-juryDutySession__summons>
<m-modal-signup-on-scroll></m-modal-signup-on-scroll>
<m-modal-signup-on-scroll *ngIf="!this.standalone"></m-modal-signup-on-scroll>
<m-channel--onboarding *ngIf="showOnboarding"></m-channel--onboarding>
......
<div class="m-notice--message">
<ng-container *ngIf="cookiesEnabled"
>Minds uses cookies to ensure you get the best experience. By continuing to
use Minds you agree to our privacy policy or you can
<a (click)="toggleCookies(false)">opt-out</a>.</ng-container
>{{ siteTitle }} uses cookies to ensure you get the best experience. By
continuing to use {{ siteTitle }} you agree to Minds privacy policy or you
can <a (click)="toggleCookies(false)">opt-out</a>.</ng-container
>
<ng-container *ngIf="!cookiesEnabled"
>You have disabled cookies from Minds which limits your experience. Consider
opting back in.</ng-container
>You have disabled cookies from {{ siteTitle }} which limits your
experience. Consider opting back in.</ng-container
>
</div>
<ng-container *ngIf="cookiesEnabled">
......
......@@ -8,6 +8,7 @@ import {
} from '@angular/core';
import { Client } from '../../../services/api/client';
import { Storage } from '../../../services/storage';
import { SiteService } from '../../../services/site.service';
@Component({
selector: 'm-cookies-notice',
......@@ -21,7 +22,11 @@ export class DismissableNoticeComponent {
cookiesEnabled: boolean = true;
constructor(private client: Client, private storage: Storage) {
constructor(
private client: Client,
private storage: Storage,
private site: SiteService
) {
if (this.storage.get('cookies-notice-dismissed')) {
this.hidden = true;
}
......@@ -53,4 +58,8 @@ export class DismissableNoticeComponent {
this.client.delete(url);
}
}
get siteTitle() {
return this.site.title;
}
}
......@@ -41,9 +41,7 @@ const routes: Routes = [
RegisterComponent,
ForgotPasswordComponent,
],
exports: [
ForgotPasswordComponent,
],
exports: [ForgotPasswordComponent],
entryComponents: [
LoginComponent,
LogoutComponent,
......
......@@ -260,7 +260,8 @@ export class ProChannelComponent implements OnInit, AfterViewInit, OnDestroy {
return '';
}
return `m-theme--wrapper m-theme--wrapper__${this.channel.pro_settings.scheme || 'light'}`;
return `m-theme--wrapper m-theme--wrapper__${this.channel.pro_settings
.scheme || 'light'}`;
}
@HostListener('window:resize') onResize() {
......
......@@ -20,7 +20,6 @@ export type RouterLinkToType =
| 'donate'
| 'login';
export interface NavItems {
label: string;
onClick: () => void;
......@@ -42,7 +41,7 @@ export class ProChannelService {
protected entitiesService: EntitiesService,
protected session: Session,
protected route: ActivatedRoute,
protected modalService: OverlayModalService,
protected modalService: OverlayModalService
) {}
async load(id: string) {
......
<div class="m-pro--channel-footer">
<div class="m-pro--channel-footer__items">
<a
*ngFor="let link of footerLinks"
......@@ -20,12 +19,16 @@
@{{ currentUsername }}
</a>
<a class="m-pro--channel-footer--link" (click)="logout()" i18n>Logout</a>
<a class="m-pro--channel-footer--link" (click)="logout()" i18n
>Logout</a
>
</ng-container>
<ng-container *ngIf="!isOwner">
<span style="position: relative">
<minds-button-user-dropdown [user]="user"></minds-button-user-dropdown>
<minds-button-user-dropdown
[user]="user"
></minds-button-user-dropdown>
</span>
</ng-container>
</ng-container>
......
<a
class="m-pro__hamburger-menu__trigger"
(click)="toggleMenu()"
>
<a class="m-pro__hamburger-menu__trigger" (click)="toggleMenu()">
<i class="material-icons">menu</i>
</a>
<div class="m-pro__hamburger-menu__menu">
<a
class="m-pro__hamburger-menu__close"
(click)="closeMenu()"
>
<a class="m-pro__hamburger-menu__close" (click)="closeMenu()">
<i class="material-icons">close</i>
</a>
......@@ -28,7 +22,8 @@
routerLinkActive="m-pro__hamburger-menu-menu__item--active"
(click)="closeMenu()"
i18n
>Feed</a>
>Feed</a
>
</li>
<li>
......@@ -37,7 +32,8 @@
routerLinkActive="m-pro__hamburger-menu-menu__item--active"
(click)="closeMenu()"
i18n
>Videos</a>
>Videos</a
>
</li>
<li>
......@@ -46,7 +42,8 @@
routerLinkActive="m-pro__hamburger-menu-menu__item--active"
(click)="closeMenu()"
i18n
>Images</a>
>Images</a
>
</li>
<li>
......@@ -55,7 +52,8 @@
routerLinkActive="m-pro__hamburger-menu-menu__item--active"
(click)="closeMenu()"
i18n
>Articles</a>
>Articles</a
>
</li>
<li>
......@@ -64,7 +62,8 @@
routerLinkActive="m-pro__hamburger-menu-menu__item--active"
(click)="closeMenu()"
i18n
>Groups</a>
>Groups</a
>
</li>
<li>
......@@ -80,14 +79,13 @@
<a
[class.m-pro__hamburger-menu-menu__item--active]="item.isActive()"
(click)="item.onClick(); closeMenu()"
>{{ item.label }}</a>
>{{ item.label }}</a
>
</li>
<li class="m-pro__hamburger-menu-menu__spacer"></li>
</ng-container>
</ul>
<m-pro--channel-footer
(click)="closeMenu()"
></m-pro--channel-footer>
<m-pro--channel-footer (click)="closeMenu()"></m-pro--channel-footer>
</div>
......@@ -4,12 +4,10 @@ import { ProChannelService } from '../channel.service';
@Component({
selector: 'm-pro__hamburger-menu',
templateUrl: 'hamburger-menu.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ProHamburgerMenu {
constructor(
protected service: ProChannelService
) { }
constructor(protected service: ProChannelService) {}
toggleMenu() {
if (document.body) {
......@@ -22,7 +20,10 @@ export class ProHamburgerMenu {
}
closeMenu() {
if (document.body && document.body.classList.contains('hamburger-menu--open')) {
if (
document.body &&
document.body.classList.contains('hamburger-menu--open')
) {
document.body.classList.remove('hamburger-menu--open');
}
}
......
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component, OnDestroy,
Component,
OnDestroy,
OnInit,
} from '@angular/core';
import { Router } from '@angular/router';
......@@ -75,11 +76,13 @@ export class ProChannelHomeComponent implements OnInit, OnDestroy {
}
setMenuNavItems() {
const tags = this.channelService.currentChannel.pro_settings.tag_list.concat([]);
const tags = this.channelService.currentChannel.pro_settings.tag_list.concat(
[]
);
const navItems: Array<NavItems> = tags.map(tag => ({
label: tag.label,
onClick: () => {
this.navigateToCategory(tag.tag)
this.navigateToCategory(tag.tag);
},
isActive: () => {
return false;
......
......@@ -9,7 +9,11 @@ import {
import { ActivatedRoute, Router } from '@angular/router';
import { Subscription } from 'rxjs';
import { FeedsService } from '../../../../common/services/feeds.service';
import { NavItems, ProChannelService, RouterLinkToType } from '../channel.service';
import {
NavItems,
ProChannelService,
RouterLinkToType,
} from '../channel.service';
import { OverlayModalService } from '../../../../services/ux/overlay-modal';
@Component({
......@@ -126,14 +130,16 @@ export class ProChannelListComponent implements OnInit, OnDestroy {
}
setMenuNavItems() {
const tags = this.channelService.currentChannel.pro_settings.tag_list.concat([]);
const tags = this.channelService.currentChannel.pro_settings.tag_list.concat(
[]
);
tags.unshift({ label: 'All', tag: 'all', selected: false });
const navItems: Array<NavItems> = tags.map(tag => ({
label: tag.label,
onClick: () => {
this.selectHashtag(tag.tag)
this.selectHashtag(tag.tag);
},
isActive: () => {
return this.selectedHashtag === tag.tag;
......
......@@ -132,10 +132,12 @@ m-pro--channel-login {
flex: 1;
margin-left: 16px;
z-index: 2;
min-width: 480px;
@media screen and (max-width: 1000px) {
flex-basis: 100%;
margin-left: 0;
min-width: initial;
}
.m-proChannelLogin--subtext {
......
......@@ -29,6 +29,10 @@
/>
</div>
<div class="m-proChannelTile__text" (click)="tileClicked()" *ngIf="getTitle() || getText()">
<div
class="m-proChannelTile__text"
(click)="tileClicked()"
*ngIf="getTitle() || getText()"
>
<h2 [title]="getTitle()">{{ getTitle() }}</h2>
</div>
......@@ -23,14 +23,14 @@ import { ProUnsubscribeModalComponent } from './channel/unsubscribe-modal/modal.
import { ProCategoriesComponent } from './channel/categories/categories.component';
import { BlogView } from '../blogs/view/view';
import { MediaModalComponent } from '../media/modal/modal.component';
import { NewsfeedSingleComponent } from "../newsfeed/single/single.component";
import { MediaViewComponent } from "../media/view/view.component";
import { MediaEditComponent } from "../media/edit/edit.component";
import { BlogViewInfinite } from "../blogs/view/infinite";
import { BlogEdit } from "../blogs/edit/edit";
import { CanDeactivateGuardService } from "../../services/can-deactivate-guard";
import { ForgotPasswordComponent } from "../auth/forgot-password/forgot-password.component";
import { AuthModule } from "../auth/auth.module";
import { NewsfeedSingleComponent } from '../newsfeed/single/single.component';
import { MediaViewComponent } from '../media/view/view.component';
import { MediaEditComponent } from '../media/edit/edit.component';
import { BlogViewInfinite } from '../blogs/view/infinite';
import { BlogEdit } from '../blogs/edit/edit';
import { CanDeactivateGuardService } from '../../services/can-deactivate-guard';
import { ForgotPasswordComponent } from '../auth/forgot-password/forgot-password.component';
import { AuthModule } from '../auth/auth.module';
import { ProHamburgerMenu } from './channel/hamburger-menu/hamburger-menu.component';
const routes: Routes = [
......@@ -98,15 +98,15 @@ export const STANDALONE_ROUTES = [
},
{
path: 'media/edit/:guid',
component: MediaEditComponent
component: MediaEditComponent,
},
{
path: 'blog/view/:guid/:title',
component: BlogViewInfinite
component: BlogViewInfinite,
},
{
path: 'blog/view/:guid',
component: BlogViewInfinite
component: BlogViewInfinite,
},
{
path: 'blog/edit/:guid',
......@@ -115,14 +115,14 @@ export const STANDALONE_ROUTES = [
},
{
path: 'blog/:slugid',
component: BlogViewInfinite
component: BlogViewInfinite,
},
{
path: ':type',
component: ProChannelListComponent,
},
],
}
},
];
@NgModule({
......@@ -162,5 +162,4 @@ export const STANDALONE_ROUTES = [
BlogView,
],
})
export class ProModule {
}
export class ProModule {}
......@@ -43,6 +43,7 @@ import { FeedsService } from '../common/services/feeds.service';
import { ThemeService } from '../common/services/theme.service';
import { GlobalScrollService } from './ux/global-scroll.service';
import { AuthService } from './auth.service';
import { SiteService } from './site.service';
export const MINDS_PROVIDERS: any[] = [
{
......@@ -224,4 +225,5 @@ export const MINDS_PROVIDERS: any[] = [
deps: [RendererFactory2, Client, Session, Storage],
},
AuthService,
SiteService,
];
import { Injectable } from '@angular/core';
@Injectable()
export class SiteService {
isProDomain() {
return Boolean(window.Minds.pro);
}
get title() {
return this.isProDomain() ? window.Minds.pro.title || '' : 'Minds';
}
}
......@@ -10,13 +10,19 @@ export class MindsTitle {
return new MindsTitle(title);
}
constructor(public title: Title) {}
constructor(public title: Title) {
if (window.Minds.pro) {
this.default_title = '';
}
}
setTitle(value: string, join = true) {
let title;
if (value && join) {
title = [value, this.default_title].join(this.sep);
title = [value, this.default_title]
.filter(fragment => Boolean(fragment))
.join(this.sep);
} else if (value) {
title = value;
} else {
......