Skip to content
Commits on Source (11)
...@@ -63,7 +63,7 @@ export class MindsAvatar { ...@@ -63,7 +63,7 @@ export class MindsAvatar {
if (this.object.type !== 'user') { if (this.object.type !== 'user') {
this.src = `${this.minds.cdn_url}fs/v1/avatars/${this.object.guid}/large/${this.object.icontime}`; this.src = `${this.minds.cdn_url}fs/v1/avatars/${this.object.guid}/large/${this.object.icontime}`;
} else if (this.object.guid !== this.minds.user.guid) { } else if (!this.minds.user || this.object.guid !== this.minds.user.guid) {
this.src = `${this.minds.cdn_url}icon/${this.object.guid}/large/${this.object.icontime}`; this.src = `${this.minds.cdn_url}icon/${this.object.guid}/large/${this.object.icontime}`;
} }
} }
...@@ -130,6 +130,6 @@ export class MindsAvatar { ...@@ -130,6 +130,6 @@ export class MindsAvatar {
* @returns true if the object guid matches the currently logged in user guid * @returns true if the object guid matches the currently logged in user guid
*/ */
isOwnerAvatar(): boolean { isOwnerAvatar(): boolean {
return this.object.guid === this.minds.user.guid; return this.minds.user && this.object.guid === this.minds.user.guid;
} }
} }
...@@ -22,7 +22,7 @@ export class NSFWSelectorComponent { ...@@ -22,7 +22,7 @@ export class NSFWSelectorComponent {
@Input('service') serviceRef: string = 'consumer'; @Input('service') serviceRef: string = 'consumer';
@Input('consumer') consumer: false; @Input('consumer') consumer: false;
@Input('expanded') expanded: false; @Input('expanded') expanded: false;
@Output('selected') onSelected: EventEmitter<any> = new EventEmitter(); @Output('selectedChange') onSelected: EventEmitter<any> = new EventEmitter();
constructor( constructor(
public creatorService: NSFWSelectorCreatorService, public creatorService: NSFWSelectorCreatorService,
...@@ -33,7 +33,9 @@ export class NSFWSelectorComponent { ...@@ -33,7 +33,9 @@ export class NSFWSelectorComponent {
ngOnInit() { ngOnInit() {
if (this.service.reasons) { if (this.service.reasons) {
this.service.reasons.map(r => this.toggle(r.value)); for (const reason of this.service.reasons) {
this.toggle(reason.value, false);
}
} }
} }
...@@ -64,14 +66,17 @@ export class NSFWSelectorComponent { ...@@ -64,14 +66,17 @@ export class NSFWSelectorComponent {
} }
} }
toggle(reason) { toggle(reason, triggerChange = true) {
if (reason.locked) { if (reason.locked) {
return; return;
} }
this.service.toggle(reason); this.service.toggle(reason);
const reasons = this.service.reasons.filter(r => r.selected); if (triggerChange) {
this.onSelected.next(reasons); const reasons = this.service.reasons.filter(r => r.selected);
this.onSelected.next(reasons);
}
} }
hasSelections(): boolean { hasSelections(): boolean {
......
...@@ -231,7 +231,7 @@ ...@@ -231,7 +231,7 @@
<m-nsfw-selector <m-nsfw-selector
service="editing" service="editing"
[selected]="entity.nsfw" [selected]="entity.nsfw"
(selected)="onNSFWSelected($event)" (selectedChange)="onNSFWSelected($event)"
> >
</m-nsfw-selector> </m-nsfw-selector>
</li> </li>
......
...@@ -71,16 +71,7 @@ const routes: Routes = [ ...@@ -71,16 +71,7 @@ const routes: Routes = [
path: 'analytics', path: 'analytics',
component: AnalyticsComponent, component: AnalyticsComponent,
children: [ children: [
{ path: '', redirectTo: 'channel', pathMatch: 'full' }, { path: '', redirectTo: 'dashboard/', pathMatch: 'full' },
{
path: 'channel',
component: ChannelAnalyticsComponent,
children: [
{ path: '', redirectTo: 'activity', pathMatch: 'full' },
{ path: 'activity', component: ChannelGeneralAnalyticsComponent },
{ path: 'reach', component: ChannelReachAnalyticsComponent },
],
},
{ {
path: 'admin', path: 'admin',
component: AdminAnalyticsComponent, component: AdminAnalyticsComponent,
......
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
.minds-counter { .minds-counter {
font-size: 12px; font-size: 12px;
line-height: 16px; line-height: 16px;
vertical-align: top; vertical-align: middle;
} }
} }
} }
......
...@@ -134,7 +134,7 @@ import { Session } from '../../../services/session'; ...@@ -134,7 +134,7 @@ import { Session } from '../../../services/session';
<m-nsfw-selector <m-nsfw-selector
service="editing" service="editing"
[selected]="group.nsfw" [selected]="group.nsfw"
(selected)="onNSFWSelected($event)" (selectedChange)="onNSFWSelected($event)"
> >
</m-nsfw-selector> </m-nsfw-selector>
</li> </li>
......
...@@ -115,7 +115,7 @@ import { BlockListService } from '../../../../common/services/block-list.service ...@@ -115,7 +115,7 @@ import { BlockListService } from '../../../../common/services/block-list.service
<m-nsfw-selector <m-nsfw-selector
service="editing" service="editing"
[selected]="user.nsfw_lock" [selected]="user.nsfw_lock"
(selected)="setNSFWLock($event)" (selectedChange)="setNSFWLock($event)"
> >
</m-nsfw-selector> </m-nsfw-selector>
</li> </li>
......
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
service="editing" service="editing"
[selected]="activity.nsfw" [selected]="activity.nsfw"
[locked]="activity.ownerObj.nsfw_lock" [locked]="activity.ownerObj.nsfw_lock"
(selected)="onNSWFSelections($event)" (selectedChange)="onNSWFSelections($event)"
> >
</m-nsfw-selector> </m-nsfw-selector>
</ng-container> </ng-container>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ng-container *mIfFeature="'top-feeds'"> <ng-container *mIfFeature="'top-feeds'">
<m-nsfw-selector <m-nsfw-selector
[consumer]="true" [consumer]="true"
(selected)="onNSFWSelected($event)" (selectedChange)="onNSFWSelected($event)"
></m-nsfw-selector> ></m-nsfw-selector>
</ng-container> </ng-container>
<ng-container *ngIf="showBoostOptions"> <ng-container *ngIf="showBoostOptions">
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
</label> </label>
<ng-container *mIfFeature="'top-feeds'; else oldNSFW"> <ng-container *mIfFeature="'top-feeds'; else oldNSFW">
<m-nsfw-selector (selected)="onNSWFSelections($event)"> <m-nsfw-selector (selectedChange)="onNSWFSelections($event)">
</m-nsfw-selector> </m-nsfw-selector>
</ng-container> </ng-container>
......
<div *ngIf="eligible === false">
<p>
Due to Stripe's
<a href="https://stripe.com/restricted-businesses" target="_blank">
Terms of Use</a
>, this feature is currently unavailable for any channel determined to be
not safe for work (NSFW). If you are impacted by Stripe's terms and still
wish to monetize your channel, please consider onboarding to receive
payments in <a (click)="openBtc()">Bitcoin</a>,
<a routerLink="/wallet/tokens/addresses">Ether</a> or
<a routerLink="/wallet/tokens/addresses">Minds Tokens</a>.
</p>
</div>
<form <form
*ngIf="eligible === true"
(submit)="submit()" (submit)="submit()"
[formGroup]="form" [formGroup]="form"
#f="ngForm" #f="ngForm"
......
...@@ -13,6 +13,8 @@ import { Client } from '../../../../services/api'; ...@@ -13,6 +13,8 @@ import { Client } from '../../../../services/api';
import { requiredFor, optionalFor } from './onboarding.validators'; import { requiredFor, optionalFor } from './onboarding.validators';
import { OverlayModalService } from '../../../../services/ux/overlay-modal'; import { OverlayModalService } from '../../../../services/ux/overlay-modal';
import { WalletUSDTermsComponent } from '../terms.component'; import { WalletUSDTermsComponent } from '../terms.component';
import { Session } from '../../../../services/session';
import { BTCSettingsComponent } from '../../../payments/btc/settings.component';
@Component({ @Component({
selector: 'm-walletUsd__onboarding', selector: 'm-walletUsd__onboarding',
...@@ -22,6 +24,7 @@ export class WalletUSDOnboardingComponent implements OnInit { ...@@ -22,6 +24,7 @@ export class WalletUSDOnboardingComponent implements OnInit {
form: FormGroup; form: FormGroup;
inProgress: boolean = false; inProgress: boolean = false;
restrictAsVerified: boolean = false; restrictAsVerified: boolean = false;
eligible: boolean;
minds = window.Minds; minds = window.Minds;
merchant: any; merchant: any;
...@@ -36,7 +39,8 @@ export class WalletUSDOnboardingComponent implements OnInit { ...@@ -36,7 +39,8 @@ export class WalletUSDOnboardingComponent implements OnInit {
private client: Client, private client: Client,
private cd: ChangeDetectorRef, private cd: ChangeDetectorRef,
private router: Router, private router: Router,
protected overlayModal: OverlayModalService protected overlayModal: OverlayModalService,
private session: Session
) {} ) {}
ngOnInit() { ngOnInit() {
...@@ -70,6 +74,12 @@ export class WalletUSDOnboardingComponent implements OnInit { ...@@ -70,6 +74,12 @@ export class WalletUSDOnboardingComponent implements OnInit {
this.form.patchValue(this.merchant); this.form.patchValue(this.merchant);
} }
if (this.session.getLoggedInUser().nsfw.length > 0) {
this.eligible = false;
} else {
this.eligible = true;
}
this.disableRestrictedFields(); this.disableRestrictedFields();
} }
...@@ -180,6 +190,10 @@ export class WalletUSDOnboardingComponent implements OnInit { ...@@ -180,6 +190,10 @@ export class WalletUSDOnboardingComponent implements OnInit {
this.overlayModal.create(WalletUSDTermsComponent).present(); this.overlayModal.create(WalletUSDTermsComponent).present();
} }
openBtc() {
this.overlayModal.create(BTCSettingsComponent, {}).present();
}
detectChanges() { detectChanges() {
this.cd.markForCheck(); this.cd.markForCheck();
this.cd.detectChanges(); this.cd.detectChanges();
......
<?php <?php
$meta = Minds\Core\SEO\Manager::get(); /** @var \Minds\Core\Front\Index $index */
$pro = Minds\Core\Di\Di::_()->get('Pro\Domain')->lookup($_SERVER['HTTP_HOST'] ?? null); $index = \Minds\Core\Di\Di::_()->get('Front\Index');
$context = $index->getContext();
if (!defined('__MINDS_CONTEXT__')) {
define('__MINDS_CONTEXT__', 'app');
}
?> ?>
<html> <html>
<head> <head>
<base href="/" /> <base href="/"/>
<meta charset="utf-8"> <meta charset="utf-8">
<?php if ($pro): ?>
<link rel="icon" type="image/jpeg" href="<?php echo Minds\Core\Di\Di::_()->get('Pro\Domain')->getIcon($pro) ?>" />
<?php else: ?>
<link rel="icon" type="image/svg" href="<?php echo Minds\Core\Config::_()->get('cdn_assets_url') ?>assets/logos/bulb.svg" />
<link rel="apple-touch-icon" sizes="180x180" href="<?php echo Minds\Core\Config::_()->get('cdn_assets_url') ?>assets/logos/bulb-apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="<?php echo Minds\Core\Config::_()->get('cdn_assets_url') ?>assets/logos/bulb-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="<?php echo Minds\Core\Config::_()->get('cdn_assets_url') ?>assets/logos/bulb-16x16.png">
<?php endif; ?>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<?php <?php echo $index->getMetaHtml() ?>
foreach($meta as $name => $content){
$name = strip_tags($name);
$content = str_replace(['"'], '\'', $content);
switch($name){
case "title":
echo "<title>$content</title>\n";
break;
case strpos($name, "smartbanner") !== FALSE:
echo "<meta name=\"$name\" content=\"$content\">\n";
break;
case strpos($name, ":") !== FALSE:
echo "<meta property=\"$name\" content=\"$content\">\n";
break;
default:
echo "<meta name=\"$name\" content=\"$content\">\n";
}
}
?>
<title><?php echo $index->getTitle() ?></title>
<!-- inject:css -->
<!-- endinject -->
<script> <script>
var ua = window.navigator.userAgent; var ua = window.navigator.userAgent;
if(ua.indexOf("MSIE") > -1 || if (
(ua.indexOf("Android 4.3") > -1 && !(ua.indexOf('Chrome') > -1)) //android 4.3, but not chrome browser ua.indexOf("MSIE") > -1 ||
){ (ua.indexOf("Android 4.3") > -1 && !(ua.indexOf('Chrome') > -1)) //android 4.3, but not chrome browser
window.location.href = window.location.href.replace('<?= Minds\Core\Config::_()->get('site_url') ?>', 'https://www.minds.com/not-supported'); ) {
} window.location.href = '/not-supported';
}
</script> </script>
<?php if ($pro && $pro->getCustomHead()): /* Blank line below IS IMPORTANT! Do not remove. */ ?> <!-- inject:css -->
<!-- endinject -->
<!-- Minds Pro: <?php echo $pro->getUserGuid(); ?> --><?php echo "\n" . $pro->getCustomHead() . "\n"; ?>
<!-- End -->
<?php endif; ?>
</head> <?php echo $index->getHeadHtml() ?>
<body> </head>
<body>
<?php if (__MINDS_CONTEXT__ === 'embed'): ?> <?php if ($context === 'embed'): ?>
<!-- The embed component created in embed.ts --> <!-- The embed component created in embed.ts -->
<minds-embed></minds-embed> <minds-embed></minds-embed>
<?php else: ?> <?php else: ?>
<!-- The app component created in app.ts --> <!-- The app component created in app.ts -->
<m-app class=""> <m-app class="">
<div class="mdl-progress mdl-progress__indeterminate initial-loading is-upgraded"> <div class="mdl-progress mdl-progress__indeterminate initial-loading is-upgraded">
<div class="progressbar bar bar1" style="width: 0%;"></div> <div class="progressbar bar bar1" style="width: 0%;"></div>
<div class="bufferbar bar bar2" style="width: 100%;"></div> <div class="bufferbar bar bar2" style="width: 100%;"></div>
<div class="auxbar bar bar3" style="width: 0%;"></div> <div class="auxbar bar bar3" style="width: 0%;"></div>
</div> </div>
<div class="m-initial-loading-centred" style="width:100%; text-align:center; margin: 100px auto;"> <div class="m-initial-loading-centred" style="width:100%; text-align:center; margin: 100px auto;">
<div class="mdl-spinner mdl-spinner--single-color mdl-js-spinner is-active is-upgraded" style="width: 64px;height: 64px;" data-upgraded=",MaterialSpinner"> <div class="mdl-spinner mdl-spinner--single-color mdl-js-spinner is-active is-upgraded"
<div class="mdl-spinner__layer mdl-spinner__layer-1"> style="width: 64px;height: 64px;" data-upgraded=",MaterialSpinner">
<div class="mdl-spinner__circle-clipper mdl-spinner__left"> <div class="mdl-spinner__layer mdl-spinner__layer-1">
<div class="mdl-spinner__circle"></div> <div class="mdl-spinner__circle-clipper mdl-spinner__left">
</div><div class="mdl-spinner__gap-patch"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle"></div></div> <div class="mdl-spinner__circle"></div>
</div> </div>
<div class="mdl-spinner__layer mdl-spinner__layer-2"> <div class="mdl-spinner__gap-patch">
<div class="mdl-spinner__circle-clipper mdl-spinner__left"> <div class="mdl-spinner__circle"></div>
<div class="mdl-spinner__circle"></div> </div>
</div><div class="mdl-spinner__gap-patch"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle"></div></div> <div class="mdl-spinner__circle-clipper mdl-spinner__right">
</div> <div class="mdl-spinner__circle"></div>
<div class="mdl-spinner__layer mdl-spinner__layer-3"> </div>
<div class="mdl-spinner__circle-clipper mdl-spinner__left"> </div>
<div class="mdl-spinner__circle"></div> <div class="mdl-spinner__layer mdl-spinner__layer-2">
</div><div class="mdl-spinner__gap-patch"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle"></div></div> <div class="mdl-spinner__circle-clipper mdl-spinner__left">
</div> <div class="mdl-spinner__circle"></div>
<div class="mdl-spinner__layer mdl-spinner__layer-4"> </div>
<div class="mdl-spinner__circle-clipper mdl-spinner__left"> <div class="mdl-spinner__gap-patch">
<div class="mdl-spinner__circle"></div> <div class="mdl-spinner__circle"></div>
</div><div class="mdl-spinner__gap-patch"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle"></div></div> </div>
</div> <div class="mdl-spinner__circle-clipper mdl-spinner__right">
<div class="mdl-spinner__circle"></div>
</div>
</div>
<div class="mdl-spinner__layer mdl-spinner__layer-3">
<div class="mdl-spinner__circle-clipper mdl-spinner__left">
<div class="mdl-spinner__circle"></div>
</div>
<div class="mdl-spinner__gap-patch">
<div class="mdl-spinner__circle"></div>
</div>
<div class="mdl-spinner__circle-clipper mdl-spinner__right">
<div class="mdl-spinner__circle"></div>
</div>
</div>
<div class="mdl-spinner__layer mdl-spinner__layer-4">
<div class="mdl-spinner__circle-clipper mdl-spinner__left">
<div class="mdl-spinner__circle"></div>
</div>
<div class="mdl-spinner__gap-patch">
<div class="mdl-spinner__circle"></div>
</div>
<div class="mdl-spinner__circle-clipper mdl-spinner__right">
<div class="mdl-spinner__circle"></div>
</div>
</div>
</div> </div>
</div> </div>
</m-app> </m-app>
<?php endif; ?> <?php endif; ?>
<script> <script>
// Fixes undefined module function in SystemJS bundle function module() {} // Fixes undefined module function in SystemJS bundle
function module() {} </script>
</script>
<!-- shims:js --> <!-- shims:js -->
<!-- endinject --> <!-- endinject -->
<!-- libs:js --> <!-- libs:js -->
<!-- endinject --> <!-- endinject -->
<script>
<?php
$minds = [
"MindsContext" => __MINDS_CONTEXT__,
"LoggedIn" => Minds\Core\Session::isLoggedIn() ? true : false,
"Admin" => Minds\Core\Session::isAdmin() ? true : false,
"cdn_url" => Minds\Core\Config::_()->get('cdn_url') ?: Minds\Core\Config::_()->cdn_url,
"cdn_assets_url" => Minds\Core\Config::_()->get('cdn_assets_url'),
"site_url" => Minds\Core\Config::_()->get('site_url') ?: Minds\Core\Config::_()->site_url,
"cinemr_url" => Minds\Core\Config::_()->get('cinemr_url') ?: Minds\Core\Config::_()->cinemr_url,
"socket_server" => Minds\Core\Config::_()->get('sockets-server-uri') ?: 'ha-socket-io-us-east-1.minds.com:3030',
"navigation" => Minds\Core\Navigation\Manager::export(),
"thirdpartynetworks" => Minds\Core\Di\Di::_()->get('ThirdPartyNetworks\Manager')->availableNetworks(),
'language' => Minds\Core\Di\Di::_()->get('I18n')->getLanguage(),
'languages' => Minds\Core\Di\Di::_()->get('I18n')->getLanguages(),
"categories" => Minds\Core\Config::_()->get('categories') ?: [],
"stripe_key" => Minds\Core\Config::_()->get('payments')['stripe']['public_key'],
"recaptchaKey" => Minds\Core\Config::_()->get('google')['recaptcha']['site_key'],
"max_video_length" => Minds\Core\Config::_()->get('max_video_length'),
"max_video_file_size" => Minds\Core\Config::_()->get('max_video_file_size'),
"features" => (object) (Minds\Core\Config::_()->get('features') ?: []),
"blockchain" => (object) Minds\Core\Di\Di::_()->get('Blockchain\Manager')->getPublicSettings(),
"sale" => Minds\Core\Config::_()->get('blockchain')['sale'],
"last_tos_update" => Minds\Core\Config::_()->get('last_tos_update') ?: time(),
"tags" => Minds\Core\Config::_()->get('tags') ?: [],
"pro" => $pro,
'handlers' => [
'plus' => Minds\Core\Di\Di::_()->get('Config')->get('plus')['handler'] ?? null,
'pro' => Minds\Core\Di\Di::_()->get('Config')->get('pro')['handler'] ?? null,
],
'upgrades' => Minds\Core\Di\Di::_()->get('Config')->get('upgrades'),
'contribution_values' => Minds\Core\Rewards\Contributions\ContributionValues::export(),
"environment" => getenv('MINDS_ENV') ?: 'development',
];
if(Minds\Core\Session::isLoggedIn()){ <?php echo $index->getTailHtml() ?>
$minds['user'] = Minds\Core\Session::getLoggedinUser()->export();
$minds['user']['rewards'] = !!Minds\Core\Session::getLoggedinUser()->getPhoneNumberHash();
$minds['wallet'] = array('balance' => Minds\Helpers\Counters::get(Minds\Core\Session::getLoggedinUser()->guid, 'points', false));
}
if (__MINDS_CONTEXT__ === 'embed') { </body>
$minds['MindsEmbed'] = $embedded_entity;
}
?>
window.Minds = <?= json_encode($minds) ?>;
</script>
</body>
</html> </html>