From 38876a9d4c044546089ad57e620f667950cf3b29 Mon Sep 17 00:00:00 2001 From: James Allen Date: Tue, 19 Jan 2016 16:10:50 +0000 Subject: [PATCH] Don't show publish buttons when showing free trial for templates --- .../project/editor/publish-template.jade | 62 ++++++++++--------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/services/web/app/views/project/editor/publish-template.jade b/services/web/app/views/project/editor/publish-template.jade index d1ca335bcd..c89aeebe6d 100644 --- a/services/web/app/views/project/editor/publish-template.jade +++ b/services/web/app/views/project/editor/publish-template.jade @@ -6,8 +6,8 @@ script(type="text/ng-template", id="publishProjectAsTemplateModalTemplate") ng-click="cancel()" ) × h3 #{translate("publish_as_template")} - .modal-body.modal-body-share - span(ng-if="project.features.templates") + div(ng-if="project.features.templates") + .modal-body.modal-body-share span(ng-hide="problemTalkingToTemplateApi") form() label(for='Description') #{translate("template_description")} @@ -24,8 +24,32 @@ script(type="text/ng-template", id="publishProjectAsTemplateModalTemplate") 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")} - div(ng-hide="project.features.templates") + 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 @@ -52,36 +76,14 @@ script(type="text/ng-template", id="publishProjectAsTemplateModalTemplate") li i.fa.fa-check   |#{translate("compile_larger_projects")} - - p(ng-controller="FreeTrialModalController").text-center + + .modal-footer(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( - 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")}... \ No newline at end of file + .row-spaced-small.small(ng-show="startedFreeTrial") + | #{translate("refresh_page_after_starting_free_trial")}