Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projet-cdaw
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Quentin Vrel
projet-cdaw
Commits
7c2bbaa9
Commit
7c2bbaa9
authored
Dec 01, 2020
by
quentin.vrel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Registering view (tears and suffering)
parent
8db1d1de
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
119 additions
and
10 deletions
+119
-10
ErrorMessage.vue
frontend/src/components/form/ErrorMessage.vue
+22
-0
PwdInput.vue
frontend/src/components/form/PwdInput.vue
+3
-2
index.js
frontend/src/router/index.js
+10
-6
Login.vue
frontend/src/views/Login.vue
+4
-2
Register.vue
frontend/src/views/Register.vue
+80
-0
No files found.
frontend/src/components/form/ErrorMessage.vue
0 → 100644
View file @
7c2bbaa9
<
template
v-if=
"this.condition"
>
<p
class=
"error-message"
:id=
"this.id"
>
{{
errormessage
}}
</p>
</
template
>
<
script
>
export
default
{
props
:
{
errormessage
:
{
type
:
[
String
,
Boolean
],
default
:
false
},
id
:
{
type
:
String
},
condition
:
{
type
:
String
,
default
:
'false'
}
}
}
</
script
>
<
style
>
.error-message
{
color
:
red
;
font-weight
:
bold
;
text-align
:
center
;
font-size
:
24px
;
}
</
style
>
\ No newline at end of file
frontend/src/components/form/PwdInput.vue
View file @
7c2bbaa9
<
template
>
<
template
>
<div
class=
"form-group row"
>
<div
class=
"form-group row"
>
<label
class=
"col-md-4 col-form-label text-md-right"
:for=
"this.id"
>
{{
label
}}
</label>
<label
class=
"col-md-4 col-form-label text-md-right"
:for=
"this.id"
>
{{
label
}}
</label>
<input
class=
"col-md-6 form-control "
type=
"password"
:id=
"this.id"
:name=
"this.id"
>
<input
class=
"col-md-6 form-control "
type=
"password"
:id=
"this.id"
:name=
"this.id"
:onchange=
"this.toogle"
>
</div>
</div>
</
template
>
</
template
>
...
@@ -10,7 +10,8 @@
...
@@ -10,7 +10,8 @@
export
default
{
export
default
{
props
:
{
props
:
{
id
:
{
type
:
String
,
default
:
''
},
id
:
{
type
:
String
,
default
:
''
},
label
:
{
type
:
String
,
default
:
'label'
}
label
:
{
type
:
String
,
default
:
'label'
},
toogle
:
{
type
:
String
,
default
:
''
}
}
}
}
}
</
script
>
</
script
>
...
...
frontend/src/router/index.js
View file @
7c2bbaa9
import
Vue
from
'vue'
import
Vue
from
'vue'
import
VueRouter
from
'vue-router'
import
VueRouter
from
'vue-router'
import
Home
from
'../views/Home.vue'
Vue
.
use
(
VueRouter
)
Vue
.
use
(
VueRouter
)
const
routes
=
[
const
routes
=
[
{
path
:
'/'
,
name
:
'Home'
,
component
:
Home
},
{
{
path
:
'/about'
,
path
:
'/about'
,
name
:
'About'
,
name
:
'About'
,
...
@@ -18,6 +13,15 @@ const routes = [
...
@@ -18,6 +13,15 @@ const routes = [
// which is lazy-loaded when the route is visited.
// which is lazy-loaded when the route is visited.
component
:
()
=>
import
(
/* webpackChunkName: "about" */
'../views/About.vue'
)
component
:
()
=>
import
(
/* webpackChunkName: "about" */
'../views/About.vue'
)
},
},
{
path
:
'/home'
,
name
:
'Home'
,
component
:
()
=>
import
(
'../views/Home.vue'
)
},{
path
:
'/register'
,
name
:
'Register'
,
component
:
()
=>
import
(
'../views/Register.vue'
)
},
{
{
path
:
'/login'
,
path
:
'/login'
,
name
:
'Login'
,
name
:
'Login'
,
...
...
frontend/src/views/Login.vue
View file @
7c2bbaa9
...
@@ -37,13 +37,15 @@ export default {
...
@@ -37,13 +37,15 @@ export default {
position
:
relative
;
position
:
relative
;
}
}
form
{
.login-page
>
form
{
flex-direction
:
column
;
flex-direction
:
column
;
display
:
flex
;
display
:
flex
;
width
:
900px
;
width
:
900px
;
background-color
:
rgba
(
196
,
196
,
196
,
0.6
);
background-color
:
rgba
(
196
,
196
,
196
,
0.6
);
margin
:
0
auto
;
margin
:
0
auto
;
padding
:
50px
;
padding-top
:
50px
;
padding-bottom
:
40px
;
}
}
...
...
frontend/src/views/Register.vue
0 → 100644
View file @
7c2bbaa9
<
template
>
<div
class=
"register-page"
>
<page-title
pagetitle=
"S'Inscrire"
/>
<form
action=
"#"
@
submit
.
prevent=
"onSubmit"
>
<div
class=
"form-content"
>
<text-input
id=
"mail"
label=
"Email"
/>
<text-input
id=
"pseudo"
label=
"Pseudo"
/>
<pwd-input
id=
"password1"
label=
"Mot de passe"
/>
<pwd-input
id=
"password2"
label=
"Confirmer"
/>
<error-message
id=
"error-password"
errormessage=
"Les mots de passe ne correspondent pas."
v-show=
"this.showPwdError"
/>
<error-message
id=
"error-back"
errormessage=
"Cet email ou ce pseudo est déjà pris."
v-show=
"this.showBackError"
/>
</div>
<svg-button
svg=
"/icons/back.svg"
/>
<svg-button
svg=
"/icons/validate.svg"
/>
</form>
</div>
</
template
>
<
script
>
import
PageTitle
from
'@/components/PageTitle.vue'
import
SvgButton
from
'@/components/SvgButton.vue'
import
TextInput
from
'@/components/form/TextInput.vue'
import
PwdInput
from
'@/components/form/PwdInput.vue'
import
ErrorMessage
from
'@/components/form/ErrorMessage.vue'
export
default
{
name
:
'Register'
,
components
:
{
PageTitle
,
SvgButton
,
TextInput
,
PwdInput
,
ErrorMessage
},
data
()
{
return
{
showPwdError
:
false
,
showBackError
:
false
,
}
},
methods
:
{
updateShowPwdError
:
function
(){
this
.
showPwdError
=
(
document
.
getElementById
(
'password1'
).
value
!==
document
.
getElementById
(
'password2'
).
value
);
},
updateShowBackError
:
function
(){
this
.
showBackError
=
false
;
//TODO
},
onSubmit
:
function
(){
this
.
showPwdError
=
(
document
.
getElementById
(
'password1'
).
value
!==
document
.
getElementById
(
'password2'
).
value
);
if
(
this
.
showPwdError
)
{
return
;
}
this
.
showBackError
=
false
;
//TODO
if
(
this
.
showBackError
)
{
return
;
}
this
.
$router
.
push
(
'home'
);
}
}
}
</
script
>
<
style
>
.register-page
.form-content
{
flex-direction
:
column
;
display
:
flex
;
width
:
900px
;
background-color
:
rgba
(
196
,
196
,
196
,
0.6
);
margin
:
0
auto
;
padding-top
:
50px
;
}
*,
::before
,
::after
{
box-sizing
:
border-box
;
}
</
style
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment