Skip to content

Commit c17743f

Browse files
committed
Lint
1 parent 58bf6f8 commit c17743f

File tree

15 files changed

+94
-84
lines changed

15 files changed

+94
-84
lines changed

client/components/LocaleDropdown.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<template>
22
<li class="nav-item dropdown">
33
<a class="nav-link dropdown-toggle" href="#" role="button"
4-
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
4+
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
55
{{ locales[locale] }}
66
</a>
77
<div class="dropdown-menu">
8-
<a v-for="(value, key) in locales" class="dropdown-item" href="#"
9-
@click.prevent="setLocale(key)">
8+
<a v-for="(value, key) in locales" :key="key" class="dropdown-item" href="#"
9+
@click.prevent="setLocale(key)">
1010
{{ value }}
1111
</a>
1212
</div>

client/components/Navbar.vue

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
{{ appName }}
66
</router-link>
77

8-
<button class="navbar-toggler" type="button" data-toggle="collapse"
9-
data-target="#navbarToggler" aria-controls="navbarToggler"
10-
aria-expanded="false" :aria-label="$t('toggle_navigation')"
8+
<button :aria-label="$t('toggle_navigation')" class="navbar-toggler" type="button"
9+
data-toggle="collapse" data-target="#navbarToggler"
10+
aria-controls="navbarToggler" aria-expanded="false"
1111
>
12-
<span class="navbar-toggler-icon"></span>
12+
<span class="navbar-toggler-icon"/>
1313
</button>
1414

15-
<div class="collapse navbar-collapse" id="navbarToggler">
15+
<div id="navbarToggler" class="collapse navbar-collapse">
1616
<ul class="navbar-nav">
1717
<locale-dropdown/>
1818
<!-- <li class="nav-item">
@@ -24,7 +24,7 @@
2424
<!-- Authenticated -->
2525
<li v-if="user" class="nav-item dropdown">
2626
<a class="nav-link dropdown-toggle text-dark"
27-
href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
27+
href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
2828
<img :src="user.photo_url" class="rounded-circle profile-photo mr-1">
2929
{{ user.name }}
3030
</a>
@@ -34,8 +34,8 @@
3434
{{ $t('settings') }}
3535
</router-link>
3636

37-
<div class="dropdown-divider"></div>
38-
<a @click.prevent="logout" class="dropdown-item pl-3" href="#">
37+
<div class="dropdown-divider"/>
38+
<a class="dropdown-item pl-3" href="#" @click.prevent="logout">
3939
<fa icon="sign-out-alt" fixed-width/>
4040
{{ $t('logout') }}
4141
</a>
@@ -65,6 +65,10 @@ import { mapGetters } from 'vuex'
6565
import LocaleDropdown from './LocaleDropdown'
6666
6767
export default {
68+
components: {
69+
LocaleDropdown
70+
},
71+
6872
data: () => ({
6973
appName: process.env.appName
7074
}),
@@ -73,10 +77,6 @@ export default {
7377
user: 'auth/user'
7478
}),
7579
76-
components: {
77-
LocaleDropdown
78-
},
79-
8080
methods: {
8181
async logout () {
8282
// Log out the user.

client/components/global/Button.vue

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<template>
2-
<button :type="nativeType" :disabled="loading" class="btn" :class="{
2+
<button :type="nativeType" :disabled="loading" :class="{
33
[`btn-${type}`]: true,
44
'btn-block': block,
55
'btn-lg': large,
66
'btn-loading': loading
7-
}">
8-
<slot></slot>
7+
}" class="btn">
8+
<slot/>
99
</button>
1010
</template>
1111

@@ -29,8 +29,15 @@ export default {
2929
default: false
3030
},
3131
32-
block: Boolean,
33-
large: Boolean
32+
block: {
33+
type: Boolean,
34+
default: false
35+
},
36+
37+
large: {
38+
type: Boolean,
39+
default: false
40+
}
3441
}
3542
}
3643
</script>

client/components/global/Card.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</div>
66

77
<div class="card-body">
8-
<slot></slot>
8+
<slot/>
99
</div>
1010
</div>
1111
</template>
@@ -14,6 +14,8 @@
1414
export default {
1515
name: 'Card',
1616
17-
props: ['title']
17+
props: {
18+
title: { type: String, default: null }
19+
}
1820
}
1921
</script>

client/components/global/Checkbox.vue

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
<template>
2-
<div class="custom-control custom-checkbox">
2+
<div class="custom-control custom-checkbox d-flex">
33
<input
4-
type="checkbox"
54
:name="name"
6-
@click="handleClick"
75
:checked="internalValue"
6+
:id="id || name"
7+
type="checkbox"
88
class="custom-control-input"
9-
:id="id || name || 'checkbox'"
10-
>
11-
<label class="custom-control-label" :for="id || name || 'checkbox'">
12-
<slot></slot>
9+
@click="handleClick">
10+
<label :for="id || name" class="custom-control-label my-auto">
11+
<slot/>
1312
</label>
1413
</div>
1514
</template>
@@ -19,24 +18,16 @@ export default {
1918
name: 'Checkbox',
2019
2120
props: {
22-
id: String,
23-
name: String,
24-
value: Boolean,
25-
checked: Boolean
21+
id: { type: String, default: null },
22+
name: { type: String, default: 'checkbox' },
23+
value: { type: Boolean, default: false },
24+
checked: { type: Boolean, default: false }
2625
},
2726
2827
data: () => ({
2928
internalValue: false
3029
}),
3130
32-
created () {
33-
this.internalValue = this.value
34-
35-
if ('checked' in this.$options.propsData) {
36-
this.internalValue = this.checked
37-
}
38-
},
39-
4031
watch: {
4132
value (val) {
4233
this.internalValue = val
@@ -53,6 +44,14 @@ export default {
5344
}
5445
},
5546
47+
created () {
48+
this.internalValue = this.value
49+
50+
if ('checked' in this.$options.propsData) {
51+
this.internalValue = this.checked
52+
}
53+
},
54+
5655
methods: {
5756
handleClick (e) {
5857
this.$emit('click', e)

client/components/global/LoginWithGithub.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<button v-if="githubAuth" @click="login" type="button" class="btn btn-dark ml-auto">
2+
<button v-if="githubAuth" type="button" class="btn btn-dark ml-auto" @click="login">
33
{{ $t('login_with') }}
44
<fa :icon="['fab', 'github']"/>
55
</button>

client/pages/auth/login.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<div class="form-group row">
88
<label class="col-md-3 col-form-label text-md-right">{{ $t('email') }}</label>
99
<div class="col-md-7">
10-
<input v-model="form.email" type="email" name="email" class="form-control"
11-
:class="{ 'is-invalid': form.errors.has('email') }">
10+
<input v-model="form.email" :class="{ 'is-invalid': form.errors.has('email') }" type="email" name="email"
11+
class="form-control">
1212
<has-error :form="form" field="email"/>
1313
</div>
1414
</div>
@@ -17,15 +17,15 @@
1717
<div class="form-group row">
1818
<label class="col-md-3 col-form-label text-md-right">{{ $t('password') }}</label>
1919
<div class="col-md-7">
20-
<input v-model="form.password" type="password" name="password" class="form-control"
21-
:class="{ 'is-invalid': form.errors.has('password') }">
20+
<input v-model="form.password" :class="{ 'is-invalid': form.errors.has('password') }" type="password" name="password"
21+
class="form-control">
2222
<has-error :form="form" field="password"/>
2323
</div>
2424
</div>
2525

2626
<!-- Remember Me -->
2727
<div class="form-group row">
28-
<div class="col-md-3"></div>
28+
<div class="col-md-3"/>
2929
<div class="col-md-7 d-flex">
3030
<checkbox v-model="remember" name="remember">
3131
{{ $t('remember_me') }}

client/pages/auth/password/email.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<div class="form-group row">
1010
<label class="col-md-3 col-form-label text-md-right">{{ $t('email') }}</label>
1111
<div class="col-md-7">
12-
<input v-model="form.email" type="email" name="email" class="form-control"
13-
:class="{ 'is-invalid': form.errors.has('email') }">
12+
<input v-model="form.email" :class="{ 'is-invalid': form.errors.has('email') }" type="email" name="email"
13+
class="form-control">
1414
<has-error :form="form" field="email"/>
1515
</div>
1616
</div>

client/pages/auth/password/reset.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<div class="form-group row">
1010
<label class="col-md-3 col-form-label text-md-right">{{ $t('email') }}</label>
1111
<div class="col-md-7">
12-
<input v-model="form.email" type="email" name="email" class="form-control"
13-
:class="{ 'is-invalid': form.errors.has('email') }" readonly>
12+
<input v-model="form.email" :class="{ 'is-invalid': form.errors.has('email') }" type="email" name="email"
13+
class="form-control" readonly>
1414
<has-error :form="form" field="email"/>
1515
</div>
1616
</div>
@@ -19,8 +19,8 @@
1919
<div class="form-group row">
2020
<label class="col-md-3 col-form-label text-md-right">{{ $t('password') }}</label>
2121
<div class="col-md-7">
22-
<input v-model="form.password" type="password" name="password" class="form-control"
23-
:class="{ 'is-invalid': form.errors.has('password') }">
22+
<input v-model="form.password" :class="{ 'is-invalid': form.errors.has('password') }" type="password" name="password"
23+
class="form-control">
2424
<has-error :form="form" field="password"/>
2525
</div>
2626
</div>
@@ -29,8 +29,8 @@
2929
<div class="form-group row">
3030
<label class="col-md-3 col-form-label text-md-right">{{ $t('confirm_password') }}</label>
3131
<div class="col-md-7">
32-
<input v-model="form.password_confirmation" type="password" name="password_confirmation" class="form-control"
33-
:class="{ 'is-invalid': form.errors.has('password_confirmation') }">
32+
<input v-model="form.password_confirmation" :class="{ 'is-invalid': form.errors.has('password_confirmation') }" type="password" name="password_confirmation"
33+
class="form-control">
3434
<has-error :form="form" field="password_confirmation"/>
3535
</div>
3636
</div>

client/pages/auth/register.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<div class="form-group row">
88
<label class="col-md-3 col-form-label text-md-right">{{ $t('name') }}</label>
99
<div class="col-md-7">
10-
<input v-model="form.name" type="text" name="name" class="form-control"
11-
:class="{ 'is-invalid': form.errors.has('name') }">
10+
<input v-model="form.name" :class="{ 'is-invalid': form.errors.has('name') }" type="text" name="name"
11+
class="form-control">
1212
<has-error :form="form" field="name"/>
1313
</div>
1414
</div>
@@ -17,8 +17,8 @@
1717
<div class="form-group row">
1818
<label class="col-md-3 col-form-label text-md-right">{{ $t('email') }}</label>
1919
<div class="col-md-7">
20-
<input v-model="form.email" type="email" name="email" class="form-control"
21-
:class="{ 'is-invalid': form.errors.has('email') }">
20+
<input v-model="form.email" :class="{ 'is-invalid': form.errors.has('email') }" type="email" name="email"
21+
class="form-control">
2222
<has-error :form="form" field="email"/>
2323
</div>
2424
</div>
@@ -27,8 +27,8 @@
2727
<div class="form-group row">
2828
<label class="col-md-3 col-form-label text-md-right">{{ $t('password') }}</label>
2929
<div class="col-md-7">
30-
<input v-model="form.password" type="password" name="password" class="form-control"
31-
:class="{ 'is-invalid': form.errors.has('password') }">
30+
<input v-model="form.password" :class="{ 'is-invalid': form.errors.has('password') }" type="password" name="password"
31+
class="form-control">
3232
<has-error :form="form" field="password"/>
3333
</div>
3434
</div>
@@ -37,8 +37,8 @@
3737
<div class="form-group row">
3838
<label class="col-md-3 col-form-label text-md-right">{{ $t('confirm_password') }}</label>
3939
<div class="col-md-7">
40-
<input v-model="form.password_confirmation" type="password" name="password_confirmation" class="form-control"
41-
:class="{ 'is-invalid': form.errors.has('password_confirmation') }">
40+
<input v-model="form.password_confirmation" :class="{ 'is-invalid': form.errors.has('password_confirmation') }" type="password" name="password_confirmation"
41+
class="form-control">
4242
<has-error :form="form" field="password_confirmation"/>
4343
</div>
4444
</div>
@@ -83,7 +83,7 @@ export default {
8383
const { data } = await this.form.post('/register')
8484
8585
// Log in the user.
86-
const { data: { token }} = await this.form.post('/login')
86+
const { data: { token } } = await this.form.post('/login')
8787
8888
// Save the token.
8989
this.$store.dispatch('auth/saveToken', { token })

0 commit comments

Comments
 (0)