From 265e6599992540cca7ea1a232fdb658424e6a4f3 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Tue, 28 Nov 2017 11:31:31 +0000 Subject: [PATCH] Add multiple steps --- .../web/app/views/project/list/modals.pug | 40 ++++++++++++------- .../project-list/modal-controllers.coffee | 12 +++++- 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/services/web/app/views/project/list/modals.pug b/services/web/app/views/project/list/modals.pug index b57290cf44..38fdb66955 100644 --- a/services/web/app/views/project/list/modals.pug +++ b/services/web/app/views/project/list/modals.pug @@ -319,20 +319,32 @@ script(type="text/ng-template", id="v1ImportModalTemplate") button.close(ng-click="dismiss()") × h3 #{translate("import_project_to_v2")} - .modal-body - img( - src="/img/v1-import/v2-editor.png" - alt="The new V2 Editor." - ) + .modal-body.v1-import-wrapper + .v1-import-step-1(ng-show="step === 1") + img( + src="/img/v1-import/v2-editor.png" + alt="The new V2 Editor." + ) + h2.v1-import-title Try importing your project to V2! + p Some exciting copy about the new features: + ul + li Some stuff + li Some more stuff + li Yet more stuff - h2.v1-import-title Try importing your project to V2! - p Some exciting copy about the new features: - ul - li Some stuff - li Some more stuff - li Yet more stuff + .v1-import-step-2(ng-show="step === 2") + img( + src="/img/v1-import/v2-editor.png" + alt="The new V2 Editor." + ) + h2.v1-import-title #[strong Warning:] Overleaf V2 is in beta + p Once importing your project you will lose access to the some of the features of Overleaf V1. This includes the git bridge, journal integrations, WYSIWYG and linked files. We’re working on bringing these features to V2! + p Once you have imported a project to V2 you #[strong cannot go back to V1]. .modal-footer.v1-import-footer - button.btn.btn-primary.v1-import-btn(ng-click="openV1()") #{translate("open_in_v1")} - button.btn.btn-primary.v1-import-btn(ng-click="import()") #{translate("import_to_v2")} - + div(ng-show="step === 1") + a.btn.btn-primary.v1-import-btn(ng-href=settings.overleaf.host + "/{{project.id}}") #{translate("open_in_v1")} + button.btn.btn-primary.v1-import-btn(ng-click="moveToConfirmation()") #{translate("import_to_v2")} + div(ng-show="step === 2") + a.btn.btn-primary.v1-import-btn(ng-href=settings.overleaf.host + "/{{project.id}}") #{translate("never_mind_open_in_v1")} + button.btn.btn-primary.v1-import-btn(ng-click="import()") #{translate("yes_im_sure")} diff --git a/services/web/public/coffee/main/project-list/modal-controllers.coffee b/services/web/public/coffee/main/project-list/modal-controllers.coffee index 190b960395..5fd0a4707d 100644 --- a/services/web/public/coffee/main/project-list/modal-controllers.coffee +++ b/services/web/public/coffee/main/project-list/modal-controllers.coffee @@ -125,4 +125,14 @@ define [ window.location = '/project/' + response.project_id App.controller 'V1ImportModalController', ($scope, $modalInstance, project) -> - console.log('V1ImportModalController', project) + $scope.project = project + $scope.step = 1 + + $scope.dismiss = () -> + $modalInstance.dismiss('cancel') + + $scope.moveToConfirmation = () -> + $scope.step = 2 + + $scope.import = () -> + console.log('IMPORT', project)