Removed all patreon based restrictions
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
Template.registerHelper("isTier5", function(){
|
||||
let user = Meteor.user();
|
||||
if (!user) return false;
|
||||
patreon = user.patreon;
|
||||
if (!patreon) return false;
|
||||
return patreon.entitledCents >= 300 || patreon.entitledCentsOverride >= 300;
|
||||
});
|
||||
@@ -1,24 +0,0 @@
|
||||
import { format as formatUrl } from 'url';
|
||||
|
||||
const CLIENT_ID = Meteor.settings &&
|
||||
Meteor.settings.public.patreon &&
|
||||
Meteor.settings.public.patreon.clientId;
|
||||
|
||||
Template.registerHelper("patreonLoginUrl", function() {
|
||||
if (!CLIENT_ID) {
|
||||
console.warn('Could not find Meteor.settings.public.patreon.clientId to make patreon link')
|
||||
return;
|
||||
}
|
||||
return formatUrl({
|
||||
protocol: 'https',
|
||||
host: 'patreon.com',
|
||||
pathname: '/oauth2/authorize',
|
||||
query: {
|
||||
response_type: 'code',
|
||||
client_id: CLIENT_ID,
|
||||
redirect_uri: Meteor.absoluteUrl() + 'patreon-redirect',
|
||||
state: Meteor.userId(),
|
||||
scope: 'identity',
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -34,9 +34,6 @@
|
||||
<a href="/account" style="text-decoration: underline; cursor: pointer; font-size: 16px;">
|
||||
{{profileLink}}
|
||||
</a>
|
||||
<a href="/account" style="text-decoration: underline; cursor: pointer; font-size: 16px; margin-left: 8px;">
|
||||
{{patreonTier}} tier
|
||||
</a>
|
||||
{{else}}
|
||||
<a href="/sign-in" style="text-decoration: underline; cursor: pointer; font-size: 16px;">
|
||||
Sign in
|
||||
@@ -60,7 +57,7 @@
|
||||
<a href="/library" tabindex="-1">
|
||||
<paper-icon-item id="libary">
|
||||
<iron-icon icon="book" item-icon></iron-icon>
|
||||
Libraries (beta)
|
||||
Item Libraries
|
||||
</paper-icon-item>
|
||||
</a>
|
||||
<a href="/guide" tabindex="-1">
|
||||
|
||||
@@ -27,20 +27,6 @@ Template.appDrawer.helpers({
|
||||
let post = PatreonPosts.findOne({}, {sort: {date: -1}});
|
||||
return (post && post.link) || 'https://www.patreon.com/dicecloud';
|
||||
},
|
||||
patreonTier: function(){
|
||||
let user = Meteor.user();
|
||||
if (!user) return;
|
||||
patreon = user.patreon;
|
||||
if (!patreon) return "free";
|
||||
let entitledCents = patreon.entitledCents || 0;
|
||||
if (patreon.entitledCentsOverride > entitledCents){
|
||||
return "$" + (patreon.entitledCentsOverride / 100).toFixed(0);
|
||||
} else if (!patreon.entitledCents){
|
||||
return "free";
|
||||
} else {
|
||||
return "$" + (patreon.entitledCents / 100).toFixed(0);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
let drawerLayout;
|
||||
|
||||
@@ -10,26 +10,22 @@
|
||||
</div>
|
||||
</app-toolbar>
|
||||
</app-header>
|
||||
{{#if isTier5}}
|
||||
<div class="flex layout vertical center" style="position: relative; padding: 0 16px;">
|
||||
<paper-material class="card" style="padding: 32px; max-width: 800px; width: 100%;">
|
||||
{{#each library in libraries}}
|
||||
<a href="/library/{{library._id}}" tabindex="-1">
|
||||
<paper-item class="library" data-id="{{library._id}}">
|
||||
<paper-item-body>
|
||||
<div>{{library.name}}</div>
|
||||
</paper-item-body>
|
||||
</paper-item>
|
||||
</a>
|
||||
{{/each}}
|
||||
</paper-material>
|
||||
</div>
|
||||
<div class="floatyButton">
|
||||
<paper-fab id="addLibrary" icon="add"></paper-fab>
|
||||
{{#simpleTooltip}}Add Library{{/simpleTooltip}}
|
||||
</div>
|
||||
{{else}}
|
||||
{{> patronsOnly }}
|
||||
{{/if}}
|
||||
<div class="flex layout vertical center" style="position: relative; padding: 0 16px;">
|
||||
<paper-material class="card" style="padding: 32px; max-width: 800px; width: 100%;">
|
||||
{{#each library in libraries}}
|
||||
<a href="/library/{{library._id}}" tabindex="-1">
|
||||
<paper-item class="library" data-id="{{library._id}}">
|
||||
<paper-item-body>
|
||||
<div>{{library.name}}</div>
|
||||
</paper-item-body>
|
||||
</paper-item>
|
||||
</a>
|
||||
{{/each}}
|
||||
</paper-material>
|
||||
</div>
|
||||
<div class="floatyButton">
|
||||
<paper-fab id="addLibrary" icon="add"></paper-fab>
|
||||
{{#simpleTooltip}}Add Library{{/simpleTooltip}}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -8,49 +8,43 @@
|
||||
<div class="flex layout horizontal center" style="height: 40px; margin-left: 8px;">
|
||||
{{name}}
|
||||
</div>
|
||||
{{#if isTier5}}{{#if canUserEdit}}
|
||||
{{#if canUserEdit}}
|
||||
<paper-icon-button icon="settings" id="edit"></paper-icon-button>
|
||||
{{/if}}{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<div bottom-item class="layout horizontal center">
|
||||
<paper-input label="Search" class="search-input">
|
||||
<iron-icon icon="search" prefix></iron-icon>
|
||||
</paper-input>
|
||||
<div class="flex"></div>
|
||||
{{#if canUserSubscribe}}
|
||||
<paper-button style="color: rgba(255,255,255,0.87);" id="subscribe">
|
||||
<iron-icon icon="add-circle"></iron-icon>
|
||||
Subscribe
|
||||
</paper-button>
|
||||
{{else if canUserUnsubscribe}}
|
||||
<paper-button style="color: rgba(255,255,255,0.87);" id="unsubscribe">
|
||||
<iron-icon icon="remove-circle"></iron-icon>
|
||||
Unsubscribe
|
||||
</paper-button>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{#if isTier5}}
|
||||
<div bottom-item class="layout horizontal center">
|
||||
<paper-input label="Search" class="search-input">
|
||||
<iron-icon icon="search" prefix></iron-icon>
|
||||
</paper-input>
|
||||
<div class="flex"></div>
|
||||
{{#if canUserSubscribe}}
|
||||
<paper-button style="color: rgba(255,255,255,0.87);" id="subscribe">
|
||||
<iron-icon icon="add-circle"></iron-icon>
|
||||
Subscribe
|
||||
</paper-button>
|
||||
{{else if canUserUnsubscribe}}
|
||||
<paper-button style="color: rgba(255,255,255,0.87);" id="unsubscribe">
|
||||
<iron-icon icon="remove-circle"></iron-icon>
|
||||
Unsubscribe
|
||||
</paper-button>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</app-toolbar>
|
||||
</app-header>
|
||||
{{#if isTier5}}
|
||||
<div class="flex layout vertical center" style="position: relative; padding: 0 16px;">
|
||||
<paper-material class="card" style="padding: 32px; max-width: 800px; width: 100%;">
|
||||
{{#each items}}
|
||||
<paper-item data-id={{_id}} class="item">
|
||||
<paper-item-body>
|
||||
<div>{{displayName}}</div>
|
||||
</paper-item-body>
|
||||
</paper-item>
|
||||
{{/each}}
|
||||
</paper-material>
|
||||
</div>
|
||||
<div class="floatyButton">
|
||||
<paper-fab id="addLibraryItem" icon="add"></paper-fab>
|
||||
{{#simpleTooltip}}Add Library Item{{/simpleTooltip}}
|
||||
</div>
|
||||
{{else}}
|
||||
{{> patronsOnly }}
|
||||
{{/if}}
|
||||
<div class="flex layout vertical center" style="position: relative; padding: 0 16px;">
|
||||
<paper-material class="card" style="padding: 32px; max-width: 800px; width: 100%;">
|
||||
{{#each items}}
|
||||
<paper-item data-id={{_id}} class="item">
|
||||
<paper-item-body>
|
||||
<div>{{displayName}}</div>
|
||||
</paper-item-body>
|
||||
</paper-item>
|
||||
{{/each}}
|
||||
</paper-material>
|
||||
</div>
|
||||
<div class="floatyButton">
|
||||
<paper-fab id="addLibraryItem" icon="add"></paper-fab>
|
||||
{{#simpleTooltip}}Add Library Item{{/simpleTooltip}}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
<template name="patronsOnly">
|
||||
<div class="flex layout vertical center" style="position: relative; padding: 0 16px;">
|
||||
<paper-material class="card" style="padding: 32px; max-width: 800px; width: 100%;">
|
||||
<h3>
|
||||
This beta feature is available to Patreon Insiders who pledge $5 or more
|
||||
</h3>
|
||||
<div class="layout vertical center">
|
||||
<a href="https://www.patreon.com/join/dicecloud/checkout?rid=3002853">
|
||||
<paper-button raised> Become a Patron </paper-button>
|
||||
</a>
|
||||
<a href="{{patreonLoginUrl}}">
|
||||
<paper-button class="connectPatreon" style="color: #d13b2e; margin-top: 12px;">
|
||||
Connect Patreon account
|
||||
</paper-button>
|
||||
</a>
|
||||
</div>
|
||||
<p style="margin-top: 32px;">
|
||||
With the Item Libraries beta you can create collections of items to use
|
||||
across your characters, and share them with other players.
|
||||
</p>
|
||||
<p>
|
||||
You can also subscribe to existing community libraries of items, saving
|
||||
time and effort manually entering item details.
|
||||
</p>
|
||||
</paper-material>
|
||||
</div>
|
||||
</template>
|
||||
@@ -62,28 +62,6 @@
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Patreon
|
||||
</td>
|
||||
{{#if patreon.accessToken}}
|
||||
<td>
|
||||
{{tier}} tier
|
||||
</td>
|
||||
<td>
|
||||
<paper-icon-button icon="refresh" class="refreshPatreon">
|
||||
</paper-icon-button>
|
||||
</td>
|
||||
{{else}}
|
||||
<td>
|
||||
<a href="{{patreonLoginUrl}}">
|
||||
<paper-button raised class="connectPatreon">
|
||||
Connect Patreon account
|
||||
</paper-button>
|
||||
</a>
|
||||
</td>
|
||||
{{/if}}
|
||||
</tr>
|
||||
</table>
|
||||
<div style="max-width: 250px">
|
||||
{{> atForm state="signIn"}}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
Template.profile.onCreated(function(){
|
||||
this.showApiKey = new ReactiveVar(false);
|
||||
this.loadingPatreon = new ReactiveVar(false);
|
||||
});
|
||||
|
||||
Template.profile.helpers({
|
||||
@@ -13,26 +12,6 @@ Template.profile.helpers({
|
||||
showApiKey: function(){
|
||||
return Template.instance().showApiKey.get();
|
||||
},
|
||||
patreon: function(){
|
||||
let user = Meteor.user();
|
||||
return user && user.patreon || {};
|
||||
},
|
||||
tier: function(){
|
||||
let user = Meteor.user();
|
||||
if (!user) return;
|
||||
patreon = user.patreon;
|
||||
if (!patreon) return;
|
||||
let entitledCents = patreon.entitledCents || 0;
|
||||
if (Template.instance().loadingPatreon.get()){
|
||||
return "loading..."
|
||||
} else if (patreon.entitledCentsOverride > entitledCents){
|
||||
return `$ ${(patreon.entitledCentsOverride / 100).toFixed(0)} (overridden)`;
|
||||
} else if (patreon.entitledCents === undefined){
|
||||
return "?";
|
||||
} else {
|
||||
return "$" + (patreon.entitledCents / 100).toFixed(0);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Template.profile.events({
|
||||
@@ -60,10 +39,4 @@ Template.profile.events({
|
||||
Meteor.call("generateMyApiKey");
|
||||
instance.showApiKey.set(true);
|
||||
},
|
||||
"click .refreshPatreon": function(event, instance){
|
||||
instance.loadingPatreon.set(true);
|
||||
Meteor.call("updateMyPatreonDetails", (error) => {
|
||||
instance.loadingPatreon.set(false);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user