From 8239adfe7b4b9569abd08380bb3ee519035aca33 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Mon, 29 May 2017 21:58:33 -0400 Subject: [PATCH] refactor: modal-delete-user -> vue component + localizations --- client/js/app.js | 2 + client/js/components/anchor.vue | 10 +-- client/js/components/modal-create-page.vue | 10 +-- client/js/components/modal-delete-user.vue | 65 ++++++++++++++++++++ client/js/components/modal-discard-page.vue | 10 +-- client/js/components/modal-move-page.vue | 14 ++--- client/js/modals/admin-users-delete.js | 43 ------------- client/js/store/index.js | 2 + client/js/store/modules/modal-delete-user.js | 16 +++++ server/locales/en/browser.json | 25 ++++++++ server/views/modals/admin-deleteuser.pug | 12 ---- server/views/modals/create-discard.pug | 10 --- server/views/modals/edit-discard.pug | 11 ---- server/views/modals/editor-link.pug | 33 ---------- server/views/pages/admin/users-edit.pug | 6 +- 15 files changed, 135 insertions(+), 134 deletions(-) create mode 100644 client/js/components/modal-delete-user.vue delete mode 100644 client/js/modals/admin-users-delete.js create mode 100644 client/js/store/modules/modal-delete-user.js delete mode 100644 server/views/modals/admin-deleteuser.pug delete mode 100644 server/views/modals/create-discard.pug delete mode 100644 server/views/modals/edit-discard.pug delete mode 100644 server/views/modals/editor-link.pug diff --git a/client/js/app.js b/client/js/app.js index f2678332..bbbcfeb2 100644 --- a/client/js/app.js +++ b/client/js/app.js @@ -60,6 +60,7 @@ import editorVideoComponent from './components/editor-video.vue' import loadingSpinnerComponent from './components/loading-spinner.vue' import modalCreatePageComponent from './components/modal-create-page.vue' import modalCreateUserComponent from './components/modal-create-user.vue' +import modalDeleteUserComponent from './components/modal-delete-user.vue' import modalDiscardPageComponent from './components/modal-discard-page.vue' import modalMovePageComponent from './components/modal-move-page.vue' import pageLoaderComponent from './components/page-loader.vue' @@ -162,6 +163,7 @@ $(() => { loadingSpinner: loadingSpinnerComponent, modalCreatePage: modalCreatePageComponent, modalCreateUser: modalCreateUserComponent, + modalDeleteUser: modalDeleteUserComponent, modalDiscardPage: modalDiscardPageComponent, modalMovePage: modalMovePageComponent, pageLoader: pageLoaderComponent, diff --git a/client/js/components/anchor.vue b/client/js/components/anchor.vue index 8fbe1a53..e1f90f41 100644 --- a/client/js/components/anchor.vue +++ b/client/js/components/anchor.vue @@ -7,13 +7,13 @@ transition(name='modal-content') .modal-content(v-show='isShown') header.is-blue - span Copy link to this section + span {{ $t('modal.anchortitle') }} section p.control.is-fullwidth input.input(type='text', ref='anchorURLinput', v-model='anchorURL') footer - a.button.is-grey.is-outlined(v-on:click='cancel') Discard - a.button.is-blue(v-clipboard='anchorURL', @success="clipboardSuccess", @error="clipboardError") Copy to Clipboard + a.button.is-grey.is-outlined(v-on:click='cancel') {{ $t('modal.discard') }} + a.button.is-blue(v-clipboard='anchorURL', @success="clipboardSuccess", @error="clipboardError") {{ $t('modal.copyclipboard') }} diff --git a/client/js/components/modal-discard-page.vue b/client/js/components/modal-discard-page.vue index 9968f567..52650d65 100644 --- a/client/js/components/modal-discard-page.vue +++ b/client/js/components/modal-discard-page.vue @@ -6,13 +6,13 @@ .modal-container transition(name='modal-content') .modal-content(v-show='isShown') - header.is-orange Discard? + header.is-orange {{ $t('modal.discardpagetitle') }} section - span(v-if='mode === "create"') Are you sure you want to leave this page and loose anything you wrote so far? - span(v-else) Are you sure you want to leave this page and loose any modifications? + span(v-if='mode === "create"') {{ $t('modal.discardpagecreate') }} + span(v-else) {{ $t('modal.discardpageedit') }} footer - a.button.is-grey.is-outlined(v-on:click='stay') Stay on page - a.button.is-orange(v-on:click='discard') Discard + a.button.is-grey.is-outlined(v-on:click='stay') {{ $t('modal.discardpagestay') }} + a.button.is-orange(v-on:click='discard') {{ $t('modal.discard') }}