Add check for OL host to prevent failure on legacy SL

This commit is contained in:
Alasdair Smith 2017-11-29 16:35:50 +00:00
parent f232899f3f
commit 52ad852814

View file

@ -342,8 +342,13 @@ script(type="text/ng-template", id="v1ImportModalTemplate")
.modal-footer.v1-import-footer .modal-footer.v1-import-footer
div(ng-show="step === 1") div(ng-show="step === 1")
a.btn.btn-primary.v1-import-btn(ng-href=settings.overleaf.host + "/{{project.id}}") #{translate("open_in_v1")} if settings.overleaf && settings.overleaf.host
button.btn.btn-primary.v1-import-btn(ng-click="moveToConfirmation()") #{translate("import_to_v2")} 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") div(ng-show="step === 2")
form( form(
async-form="v1Import", async-form="v1Import",
@ -354,10 +359,11 @@ script(type="text/ng-template", id="v1ImportModalTemplate")
) )
input(name='_csrf', type='hidden', value=csrfToken) input(name='_csrf', type='hidden', value=csrfToken)
form-messages(for="v1ImportForm") form-messages(for="v1ImportForm")
a.btn.btn-primary.v1-import-btn( if settings.overleaf && settings.overleaf.host
ng-href=settings.overleaf.host + "/{{project.id}}" a.btn.btn-primary.v1-import-btn(
ng-class="{disabled: v1ImportForm.inflight || v1ImportForm.success}" ng-href=settings.overleaf.host + "/{{project.id}}"
) #{translate("never_mind_open_in_v1")} ng-class="{disabled: v1ImportForm.inflight || v1ImportForm.success}"
) #{translate("never_mind_open_in_v1")}
input.btn.btn-primary.v1-import-btn( input.btn.btn-primary.v1-import-btn(
type="submit", type="submit",
value=translate('yes_im_sure') value=translate('yes_im_sure')