Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #86 from familytree365/refactor-show-and-login
Browse files Browse the repository at this point in the history
Refactored show and login page
  • Loading branch information
curtisdelicata authored Sep 10, 2021
2 parents 18530c2 + d4fb5b2 commit db69a9e
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 25 deletions.
84 changes: 66 additions & 18 deletions pages/login.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,59 @@
<template>
<login-form action="Login" route="login" @success="init" />
<!-- <auth-form
action="Login"
icon="user"
endpoint="login"
:payload="payload"
@success="init"
>
<email v-model="payload.email" />
<password v-model="payload.password" />
<remember v-model="payload.remember" v-if="!isWebview" />
<template v-slot:footer>
<nuxt-link class="is-pulled-right" :to="{ name: 'password.email' }">
{{ "Forgot password" }}
</nuxt-link>
<div class="is-clearfix" />
</template>
</auth-form> -->
<auth-form action="Login"
icon="user"
endpoint="login"
:payload="payload"
@success="init">
<email v-model="payload.email"/>
<password v-model="payload.password"/>
<remember v-model="payload.remember"
v-if="!isWebview"/>
<template v-slot:footer>
<nuxt-link class="mt-1 is-pulled-right"
:to="{ name: 'password.email' }">
{{ i18n('Forgot password') }}
</nuxt-link>
<div class="is-clearfix"/>
<label for="">Login With</label>
<div class="mt-4 columns">
<div class="column">
<button class="button is-dark"
:class="{ 'is-loading': loading }"
type="button"
@click.prevent="socialLogin('github')">
<span class="icon is-small">
<fa :icon="['fab', 'github']"/>
</span>
<span>{{ i18n('Github') }}</span>
</button>
</div>

<div class="column">
<button class="button is-light is-outline"
:class="{ 'is-loading': loading }"
type="button"
@click.prevent="socialLogin('google')">
<span class="icon is-small">
<fa :icon="['fab', 'google']"/>
</span>
<span>{{ i18n('Google') }}</span>
</button>
</div>

<div class="column">
<button class="button is-info"
:class="{ 'is-loading': loading }"
type="button"
@click.prevent="socialLogin('facebook')">
<span class="icon is-small">
<fa :icon="['fab', 'facebook']"/>
</span>
<span>{{ i18n('Facebook') }}</span>
</button>
</div>
</div>
</template>
</auth-form>
</template>

<script>
Expand Down Expand Up @@ -53,12 +90,23 @@ export default {
// remember: false,
// }),
data: () => ({
errors: new Errors(),
payload: {
email: '',
password: '',
remember: false,
device_name: '',
},
loading: false,
}),
// watch: {
// remember(value) {
// console.log(value);
// },
// },
computed: {
...mapState(["meta"]),
...mapGetters(["isWebview"]),
Expand Down
17 changes: 10 additions & 7 deletions pages/trees/show.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<template>
<div>
<v-select
label="name"
v-model="selected_option"
:reduce="person => person.id"
:options="persons"
@input="setSelected"/>
label="name"
v-model="selected_option"
:reduce="person => person.id"
:options="persons"
@input="setSelected"
/>
<div id="tree"/>
<button id="saveButton">
Export my PNG
Expand All @@ -24,8 +25,10 @@ import { sampleData } from './data';
const d3 = { ...d3Base, tip: d3Tip() };
Array.prototype.remove = function () {
let what; const a = arguments; let L = a.length; let
ax;
let what;
const a = arguments;
let L = a.length;
let ax;
while (L && this.length) {
what = a[--L];
while ((ax = this.indexOf(what)) !== -1) {
Expand Down

0 comments on commit db69a9e

Please sign in to comment.