1
0
Fork 0
mirror of https://github.com/overleaf/overleaf.git synced 2025-04-11 06:05:13 +00:00

Merge pull request from sharelatex/ja-v2-templates

Split out feature flags into publish and view templates
This commit is contained in:
James Allen 2018-08-29 10:27:23 +01:00 committed by GitHub
commit 6a04800f70
3 changed files with 3 additions and 91 deletions
services/web/app
coffee/infrastructure
views/project

View file

@ -18,7 +18,9 @@ module.exports = Features =
return Settings.showV2Banner
when 'custom-togglers'
return Settings.overleaf?
when 'templates'
when 'publish-templates'
return true
when 'view-templates'
return !Settings.overleaf?
when 'affiliations'
return Settings?.apis?.v1?.url?

View file

@ -79,7 +79,6 @@ block content
include ./editor/editor
include ./editor/binary-file
include ./editor/history
include ./editor/publish-template
.ui-layout-east
include ./editor/chat

View file

@ -1,89 +0,0 @@
script(type="text/ng-template", id="publishProjectAsTemplateModalTemplate")
.modal-header
button.close(
type="button"
data-dismiss="modal"
ng-click="cancel()"
) ×
h3 #{translate("publish_as_template")}
div(ng-if="project.features.templates")
.modal-body.modal-body-share
span(ng-hide="problemTalkingToTemplateApi")
form()
label(for='Description') #{translate("template_description")}
.form-group
textarea.form-control(
rows=5,
name='Description',
ng-model="templateDetails.description",
value=""
)
div(ng-show="templateDetails.exists").text-center.templateDetails
| #{translate("project_last_published_at")}
strong {{templateDetails.publishedDate}}.
a(ng-href="{{templateDetails.canonicalUrl}}") #{translate("view_in_template_gallery")}.
span(ng-show="problemTalkingToTemplateApi") #{translate("problem_talking_to_publishing_service")}.
.modal-footer(ng-hide="problemTalkingToTemplateApi")
button.btn.btn-default(
ng-click="cancel()",
ng-disabled="state.publishInflight || state.unpublishInflight"
)
span #{translate("cancel")}
button.btn.btn-info(
ng-click="unpublishTemplate()",
ng-disabled="state.publishInflight || state.unpublishInflight"
ng-show="templateDetails.exists"
)
span(ng-show="!state.unpublishInflight") #{translate("unpublish")}
span(ng-show="state.unpublishInflight") #{translate("unpublishing")}...
button.btn.btn-primary(
ng-click="publishTemplate()",
ng-disabled="state.publishInflight || state.unpublishInflight"
)
span(ng-show="!state.publishInflight && !templateDetails.exists") #{translate("publish")}
span(ng-show="!state.publishInflight && templateDetails.exists") #{translate("republish")}
span(ng-show="state.publishInflight") #{translate("publishing")}...
div(ng-hide="project.features.templates")
.modal-body.modal-body-share
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")}
.modal-footer(ng-controller="FreeTrialModalController")
.text-center
a.btn.btn-success(
href
ng-class="buttonClass"
ng-click="startFreeTrial('templates')"
) #{translate("start_free_trial")}
.row-spaced-small.small(ng-show="startedFreeTrial")
| #{translate("refresh_page_after_starting_free_trial")}