Make templates a premium feature

This commit is contained in:
James Allen 2016-01-19 13:37:11 +00:00
parent 58edb87c61
commit 5125aa0089
4 changed files with 62 additions and 16 deletions

View file

@ -26,6 +26,8 @@ module.exports = ProjectEditorHandler =
dropbox:false
compileTimeout: 60
compileGroup:"standard"
templates: false
references: false
if project.owner_ref.features?
if project.owner_ref.features.collaborators?
@ -38,6 +40,10 @@ module.exports = ProjectEditorHandler =
result.features.compileTimeout = project.owner_ref.features.compileTimeout
if project.owner_ref.features.compileGroup?
result.features.compileGroup = project.owner_ref.features.compileGroup
if project.owner_ref.features.templates?
result.features.templates = project.owner_ref.features.templates
if project.owner_ref.features.references?
result.features.references = project.owner_ref.features.references
result.owner = @buildUserModelView project.owner_ref, "owner"

View file

@ -34,6 +34,8 @@ UserSchema = new Schema
github: { type:Boolean, default: Settings.defaultFeatures.github }
compileTimeout: { type:Number, default: Settings.defaultFeatures.compileTimeout }
compileGroup: { type:String, default: Settings.defaultFeatures.compileGroup }
templates: { type:Boolean, default: Settings.defaultFeatures.templates }
references: { type:Boolean, default: Settings.defaultFeatures.references }
}
featureSwitches : {
pdfng: { type: Boolean }

View file

@ -7,6 +7,7 @@ script(type="text/ng-template", id="publishProjectAsTemplateModalTemplate")
) ×
h3 #{translate("publish_as_template")}
.modal-body.modal-body-share
span(ng-if="project.features.templates")
span(ng-hide="problemTalkingToTemplateApi")
form()
label(for='Description') #{translate("template_description")}
@ -24,8 +25,43 @@ script(type="text/ng-template", id="publishProjectAsTemplateModalTemplate")
span(ng-show="problemTalkingToTemplateApi") #{translate("problem_talking_to_publishing_service")}.
div(ng-hide="project.features.templates")
p #{translate("upgrade_to_get_feature", {feature:"templates"})}
ul.list-unstyled
li
i.fa.fa-check  
| #{translate("unlimited_projects")}
li
i.fa.fa-check  
| #{translate("collabs_per_proj", {collabcount:'Multiple'})}
li
i.fa.fa-check  
| #{translate("full_doc_history")}
li
i.fa.fa-check  
| #{translate("sync_to_dropbox")}
li
i.fa.fa-check  
| #{translate("sync_to_github")}
li
i.fa.fa-check  
|#{translate("compile_larger_projects")}
p(ng-controller="FreeTrialModalController").text-center
a.btn.btn-success(
href
ng-class="buttonClass"
ng-click="startFreeTrial('templates')"
) #{translate("start_free_trial")}
p.small(ng-show="startedFreeTrial")
| #{translate("refresh_page_after_starting_free_trial")}
.modal-footer(ng-hide="problemTalkingToTemplateApi")
button.btn.btn-default(

View file

@ -143,6 +143,8 @@ module.exports =
versioning: true
compileTimeout: 60
compileGroup: "standard"
references: true
templates: true
plans: plans = [{
planCode: "personal"