From 52ad852814bf053e8e3bc7a2522cda771c46a116 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Wed, 29 Nov 2017 16:35:50 +0000 Subject: [PATCH] Add check for OL host to prevent failure on legacy SL --- services/web/app/views/project/list/modals.pug | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/services/web/app/views/project/list/modals.pug b/services/web/app/views/project/list/modals.pug index 7324a1cc97..1e12fb2293 100644 --- a/services/web/app/views/project/list/modals.pug +++ b/services/web/app/views/project/list/modals.pug @@ -342,8 +342,13 @@ script(type="text/ng-template", id="v1ImportModalTemplate") .modal-footer.v1-import-footer 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")} + if settings.overleaf && settings.overleaf.host + 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") form( async-form="v1Import", @@ -354,10 +359,11 @@ script(type="text/ng-template", id="v1ImportModalTemplate") ) input(name='_csrf', type='hidden', value=csrfToken) form-messages(for="v1ImportForm") - a.btn.btn-primary.v1-import-btn( - ng-href=settings.overleaf.host + "/{{project.id}}" - ng-class="{disabled: v1ImportForm.inflight || v1ImportForm.success}" - ) #{translate("never_mind_open_in_v1")} + if settings.overleaf && settings.overleaf.host + a.btn.btn-primary.v1-import-btn( + ng-href=settings.overleaf.host + "/{{project.id}}" + ng-class="{disabled: v1ImportForm.inflight || v1ImportForm.success}" + ) #{translate("never_mind_open_in_v1")} input.btn.btn-primary.v1-import-btn( type="submit", value=translate('yes_im_sure')