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 dropbox:false
compileTimeout: 60 compileTimeout: 60
compileGroup:"standard" compileGroup:"standard"
templates: false
references: false
if project.owner_ref.features? if project.owner_ref.features?
if project.owner_ref.features.collaborators? if project.owner_ref.features.collaborators?
@ -37,7 +39,11 @@ module.exports = ProjectEditorHandler =
if project.owner_ref.features.compileTimeout? if project.owner_ref.features.compileTimeout?
result.features.compileTimeout = project.owner_ref.features.compileTimeout result.features.compileTimeout = project.owner_ref.features.compileTimeout
if project.owner_ref.features.compileGroup? if project.owner_ref.features.compileGroup?
result.features.compileGroup = 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" result.owner = @buildUserModelView project.owner_ref, "owner"

View file

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

View file

@ -7,25 +7,61 @@ script(type="text/ng-template", id="publishProjectAsTemplateModalTemplate")
) × ) ×
h3 #{translate("publish_as_template")} h3 #{translate("publish_as_template")}
.modal-body.modal-body-share .modal-body.modal-body-share
span(ng-hide="problemTalkingToTemplateApi") span(ng-if="project.features.templates")
form() span(ng-hide="problemTalkingToTemplateApi")
label(for='Description') #{translate("template_description")} form()
.form-group label(for='Description') #{translate("template_description")}
textarea.form-control( .form-group
rows=5, textarea.form-control(
name='Description', rows=5,
ng-model="templateDetails.description", name='Description',
value="" ng-model="templateDetails.description",
) value=""
div(ng-show="templateDetails.exists").text-center.templateDetails )
| #{translate("project_last_published_at")} div(ng-show="templateDetails.exists").text-center.templateDetails
strong {{templateDetails.publishedDate}}. | #{translate("project_last_published_at")}
a(ng-href="{{templateDetails.canonicalUrl}}") #{translate("view_in_template_gallery")}. strong {{templateDetails.publishedDate}}.
a(ng-href="{{templateDetails.canonicalUrl}}") #{translate("view_in_template_gallery")}.
span(ng-show="problemTalkingToTemplateApi") #{translate("problem_talking_to_publishing_service")}. 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") .modal-footer(ng-hide="problemTalkingToTemplateApi")
button.btn.btn-default( button.btn.btn-default(

View file

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