-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: enrich Plain page layout and simplify associated pages
- Loading branch information
Showing
9 changed files
with
330 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,35 @@ | ||
<template> | ||
<div> | ||
<div | ||
class="oc-login oc-height-viewport" | ||
:style="{ backgroundImage: 'url(' + backgroundImg + ')' }" | ||
> | ||
<h1 class="oc-invisible-sr" v-text="pageTitle" /> | ||
<router-view /> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from '@vue/composition-api' | ||
import { computed, defineComponent, unref } from '@vue/composition-api' | ||
import { useRouteMeta, useStore, useTranslations } from 'web-pkg' | ||
export default defineComponent({ | ||
name: 'PlainLayout' | ||
name: 'PlainLayout', | ||
setup() { | ||
const store = useStore() | ||
const { $gettext } = useTranslations() | ||
const title = useRouteMeta('title') | ||
const pageTitle = computed(() => { | ||
return $gettext(unref(title)) | ||
}) | ||
const backgroundImg = computed(() => { | ||
return store.getters.configuration?.currentTheme?.loginPage?.backgroundImg | ||
}) | ||
return { | ||
pageTitle, | ||
backgroundImg | ||
} | ||
} | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,63 @@ | ||
<template> | ||
<div | ||
class="oc-login oc-height-viewport" | ||
:style="{ backgroundImage: 'url(' + backgroundImg + ')' }" | ||
> | ||
<h1 class="oc-invisible-sr" v-text="pageTitle" /> | ||
<div class="oc-login-card-wrapper oc-height-viewport oc-flex oc-flex-center oc-flex-middle"> | ||
<div class="oc-login-card"> | ||
<img class="oc-login-logo" :src="logoImg" alt="" :aria-hidden="true" /> | ||
<div class="oc-login-card-body oc-width-medium"> | ||
<h2 class="oc-login-card-title" v-text="cardTitle" /> | ||
<p v-text="cardHint" /> | ||
</div> | ||
<div class="oc-height-viewport oc-flex oc-flex-column oc-flex-center oc-flex-middle"> | ||
<div class="oc-login-card"> | ||
<img class="oc-login-logo" :src="logoImg" alt="" :aria-hidden="true" /> | ||
<div class="oc-login-card-body oc-width-medium"> | ||
<h2 class="oc-login-card-title" v-text="cardTitle" /> | ||
<p v-text="cardHint" /> | ||
</div> | ||
<div class="oc-login-card-footer oc-pt-rm"> | ||
<p> | ||
{{ footerSlogan }} | ||
</p> | ||
</div> | ||
<oc-button | ||
id="exitAnchor" | ||
type="router-link" | ||
class="oc-mt-m oc-width-medium" | ||
:to="{ name: 'login' }" | ||
size="large" | ||
appearance="filled" | ||
variation="primary" | ||
v-text="navigateToLoginText" | ||
/> | ||
</div> | ||
<oc-button | ||
id="exitAnchor" | ||
type="router-link" | ||
class="oc-mt-m oc-width-medium" | ||
:to="{ name: 'login' }" | ||
size="large" | ||
appearance="filled" | ||
variation="primary" | ||
v-text="navigateToLoginText" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from '@vue/composition-api' | ||
import { mapGetters } from 'vuex' | ||
import { computed, defineComponent } from '@vue/composition-api' | ||
import { useStore, useTranslations } from 'web-pkg' | ||
export default defineComponent({ | ||
name: 'AccessDeniedPage', | ||
computed: { | ||
...mapGetters(['configuration']), | ||
pageTitle() { | ||
return this.$gettext(this.$route.meta.title) | ||
}, | ||
cardTitle() { | ||
return this.$gettext('Logged out') | ||
}, | ||
cardHint() { | ||
return this.$gettext('You were automatically logged out for security reasons.') | ||
}, | ||
navigateToLoginText() { | ||
return this.$gettext('Log in again') | ||
}, | ||
logoImg() { | ||
return this.configuration.currentTheme.logo.login | ||
}, | ||
backgroundImg() { | ||
return this.configuration.currentTheme.loginPage.backgroundImg | ||
setup() { | ||
const store = useStore() | ||
const { $gettext } = useTranslations() | ||
const logoImg = computed(() => { | ||
return store.getters.configuration.currentTheme.logo.login | ||
}) | ||
const cardTitle = computed(() => { | ||
return $gettext('Logged out') | ||
}) | ||
const cardHint = computed(() => { | ||
return $gettext('You were automatically logged out for security reasons.') | ||
}) | ||
const footerSlogan = computed(() => { | ||
return store.getters.configuration.currentTheme.general.slogan | ||
}) | ||
const navigateToLoginText = computed(() => { | ||
return $gettext('Log in again') | ||
}) | ||
return { | ||
logoImg, | ||
cardTitle, | ||
cardHint, | ||
footerSlogan, | ||
navigateToLoginText | ||
} | ||
} | ||
}) | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.oc-login-card-wrapper { | ||
flex-flow: column; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,52 @@ | ||
<template> | ||
<div> | ||
<p v-translate>Please wait while you're being logged out.</p> | ||
<div class="oc-login-card oc-position-center"> | ||
<img class="oc-login-logo" :src="logoImg" alt="" :aria-hidden="true" /> | ||
<div class="oc-login-card-body oc-width-medium"> | ||
<h2 class="oc-login-card-title" v-text="cardTitle" /> | ||
<p v-text="cardHint" /> | ||
</div> | ||
<div class="oc-login-card-footer oc-pt-rm"> | ||
<p> | ||
{{ footerSlogan }} | ||
</p> | ||
</div> | ||
</div> | ||
</template> | ||
<script> | ||
import { authService } from '../services/auth' | ||
export default { | ||
<script lang="ts"> | ||
import { computed, defineComponent } from '@vue/composition-api' | ||
import { useRouter, useStore, useTranslations } from 'web-pkg' | ||
import { authService } from 'web-runtime/src/services/auth' | ||
export default defineComponent({ | ||
name: 'LogoutPage', | ||
async created() { | ||
await authService.logoutUser() | ||
this.router.push({ name: 'login' }) | ||
setup() { | ||
const router = useRouter() | ||
const store = useStore() | ||
const { $gettext } = useTranslations() | ||
authService.logoutUser().then(() => { | ||
router.push({ name: 'login' }) | ||
}) | ||
const logoImg = computed(() => { | ||
return store.getters.configuration.currentTheme.logo.login | ||
}) | ||
const cardTitle = computed(() => { | ||
return $gettext('Logout in progress') | ||
}) | ||
const cardHint = computed(() => { | ||
return $gettext("Please wait while you're being logged out.") | ||
}) | ||
const footerSlogan = computed(() => { | ||
return store.getters.configuration.currentTheme.general.slogan | ||
}) | ||
return { | ||
logoImg, | ||
cardTitle, | ||
cardHint, | ||
footerSlogan | ||
} | ||
} | ||
} | ||
}) | ||
</script> |
Oops, something went wrong.