Substantially improved item libraries UI, locked behind Patreon tier 5
This commit is contained in:
7
app/client/globalHelpers/isTier5.js
Normal file
7
app/client/globalHelpers/isTier5.js
Normal file
@@ -0,0 +1,7 @@
|
||||
Template.registerHelper("isTier5", function(){
|
||||
let user = Meteor.user();
|
||||
if (!user) return false;
|
||||
patreon = user.patreon;
|
||||
if (!patreon) return false;
|
||||
return patreon.entitledCents >= 500 || patreon.entitledCentsOverride >= 500;
|
||||
});
|
||||
19
app/client/globalHelpers/patreonLoginUrl.js
Normal file
19
app/client/globalHelpers/patreonLoginUrl.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const CLIENT_ID = Meteor.settings &&
|
||||
Meteor.settings.public.patreon &&
|
||||
Meteor.settings.public.patreon.clientId;
|
||||
|
||||
Template.registerHelper("patreonLoginUrl", function() {
|
||||
if (!CLIENT_ID) 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',
|
||||
},
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user