added landing page settings

This commit is contained in:
Sacha Greif 2012-10-08 17:54:37 +09:00
parent 6916e7bae1
commit 439d01f285
7 changed files with 39 additions and 5 deletions

View file

@ -81,6 +81,14 @@
<label>Logo Width</label>
<div class="controls"><input id="logoWidth" name="logoWidth" type="text" value="{{logoWidth}}" /></div>
</div>
<div class="control-group">
<label>Landing Page Text</label>
<div class="controls"><textarea id="landingPageText" name="landingPageText">{{landingPageText}}</textarea></div>
</div>
<div class="control-group">
<label>After Signup Text</label>
<div class="controls"><textarea id="afterSignupText" name="afterSignupText">{{afterSignupText}}</textarea></div>
</div>
<div class="control-group">
<label>Notes</label>
<div class="controls"><textarea id="notes" name="notes">{{notes}}</textarea></div>

View file

@ -15,10 +15,12 @@ Template.settings.events = {
var logoUrl=$('#logoUrl').val();
var logoHeight=$('#logoHeight').val();
var logoWidth=$('#logoWidth').val();
var notes=$('#notes').val();
var veroAPIKey=$('#veroAPIKey').val();
var veroSecret=$('#veroSecret').val();
var intercomId=$('#intercomId').val();
var landingPageText=$('#landingPageText').val();
var afterSignupText=$('#afterSignupText').val();
var notes=$('#notes').val();
var prevSetting=Settings.find().fetch()[0];
@ -41,6 +43,8 @@ Template.settings.events = {
logoWidth: logoWidth,
veroAPIKey: veroAPIKey,
veroSecret:veroSecret,
landingPageText:landingPageText,
afterSignupText:afterSignupText,
notes: notes
}
}, function(error){
@ -66,6 +70,8 @@ Template.settings.events = {
logoWidth: logoWidth,
veroAPIKey: veroAPIKey,
veroSecret:veroSecret,
landingPageText:landingPageText,
afterSignupText:afterSignupText,
notes:notes
}, function(){
throwError("Settings have been created");

View file

@ -1,5 +1,9 @@
<template name="no_account">
<div class="grid-small grid-block dialog">
<p>Sorry, this is a private site. Please sign up first.</p>
{{landingPageText}}
<div class="twitter-signup twitter-auth">
<a class="twitter-button button" href="#">Sign In/Sign Up with Twitter</a>
</div>
</div>
</template>

View file

@ -0,0 +1,10 @@
Template.no_account.helpers({
landingPageText: function(){
return getSetting("landingPageText");
}
});
Template.no_account.events = {
'click .twitter-button': function(){
Meteor.loginWithTwitter(function(){});
}
};

View file

@ -1,5 +1,7 @@
<template name="no_invite">
<div class="grid-small grid-block dialog">
<p>Sorry, you will need to be invited before you have access to the site.</p>
<h2>Thanks for signing up!</h2>
{{afterSignupText}}
<p>The site is currently invite-only, but we will let you know as soon as a spot opens up.</p>
</div>
</template>

View file

@ -0,0 +1,5 @@
Template.no_invite.helpers({
afterSignupText: function(){
return getSetting("afterSignupText");
}
});

View file

@ -88,9 +88,8 @@ canView = function(user, action){
if(action){
switch(error){
case "no_account":
throwError("Please sign in or create an account first.");
action=='replace' ? Router.goto('signin') : Router.navigate('signin', {trigger : true});
// throwError("Please sign in or create an account first.");
action=='replace' ? Router.goto('no_account') : Router.navigate('signin', {trigger : true});
break;
case "no_invite":
// throwError("Sorry, you need to have an invitation to do view the site.");