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
18fef28e
Commit
18fef28e
authored
Dec 02, 2020
by
quentin.vrel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handling the different routes
parent
2fae6713
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
23 deletions
+36
-23
ButtonText.vue
frontend/src/components/ButtonText.vue
+4
-6
Home.vue
frontend/src/views/Home.vue
+15
-10
Login.vue
frontend/src/views/Login.vue
+9
-4
Register.vue
frontend/src/views/Register.vue
+8
-3
No files found.
frontend/src/components/ButtonText.vue
View file @
18fef28e
<
template
>
<
template
>
<button
class=
"text-button"
:style=
"this.style"
v-on:click=
"this.emit
"
>
<button
:id=
"this.id"
class=
"text-button"
:style=
"this.style
"
>
{{
text
}}
{{
text
}}
</button>
</button>
</
template
>
</
template
>
...
@@ -29,7 +29,9 @@ export default {
...
@@ -29,7 +29,9 @@ export default {
text
:
{
type
:
String
,
default
:
''
},
text
:
{
type
:
String
,
default
:
''
},
width
:
{
type
:
[
String
],
default
:
"750px"
},
width
:
{
type
:
[
String
],
default
:
"750px"
},
height
:
{
type
:
[
String
],
default
:
"130px"
},
height
:
{
type
:
[
String
],
default
:
"130px"
},
click
:
{
type
:
String
,
default
:
''
}
click
:
{
type
:
String
,
default
:
''
},
id
:
{
type
:
String
,
default
:
''
},
},
},
computed
:
{
computed
:
{
style
()
{
style
()
{
...
@@ -38,10 +40,6 @@ export default {
...
@@ -38,10 +40,6 @@ export default {
maxWidth
:
this
.
width
maxWidth
:
this
.
width
}
}
return
style
;
return
style
;
},
emit
()
{
const
emit
=
"$emit('"
+
this
.
click
+
"')"
;
return
emit
}
}
}
}
}
}
...
...
frontend/src/views/Home.vue
View file @
18fef28e
<
template
>
<
template
>
<div
class=
"home"
>
<div
class=
"home"
>
<page-title
pagetitle=
"Riichi Mahjong"
/>
<page-title
pagetitle=
"Riichi Mahjong"
/>
<form
action=
"#"
@
submit
.
prevent=
"login"
>
<form
class=
"home-form"
action=
"#"
@
submit
.
prevent=
"onSubmit"
>
<button-text
width=
"615px"
height=
"130px"
text=
"Se Connecter"
/>
<button-text
id=
"login"
width=
"615px"
height=
"130px"
text=
"Se Connecter"
/>
</form>
<button-text
id=
"register"
width=
"615px"
height=
"130px"
text=
"S'Enregistrer"
/>
<form
action=
"#"
@
submit
.
prevent=
"register"
>
<button-text
width=
"615px"
height=
"130px"
text=
"S'Enregistrer"
/>
</form>
</form>
</div>
</div>
</
template
>
</
template
>
...
@@ -21,13 +19,15 @@ export default {
...
@@ -21,13 +19,15 @@ export default {
ButtonText
ButtonText
},
},
methods
:
{
methods
:
{
login
:
function
(){
onSubmit
:
function
(){
if
(
event
.
submitter
.
id
==
'login'
)
{
this
.
$router
.
push
(
'login'
);
this
.
$router
.
push
(
'login'
);
},
}
register
:
function
()
{
if
(
event
.
submitter
.
id
==
'register'
)
{
this
.
$router
.
push
(
'register'
);
this
.
$router
.
push
(
'register'
);
}
}
}
}
}
}
}
</
script
>
</
script
>
...
@@ -43,4 +43,9 @@ export default {
...
@@ -43,4 +43,9 @@ export default {
margin-left
:
auto
;
margin-left
:
auto
;
margin-right
:
auto
;
margin-right
:
auto
;
}
}
.home-form
{
display
:
flex
;
flex-direction
:
column
;
}
</
style
>
</
style
>
\ No newline at end of file
frontend/src/views/Login.vue
View file @
18fef28e
...
@@ -9,8 +9,8 @@
...
@@ -9,8 +9,8 @@
</div>
</div>
<svg-button
svg=
"/icons/back.svg"
/>
<svg-button
id=
"back"
svg=
"/icons/back.svg"
/>
<svg-button
svg=
"/icons/validate.svg"
/>
<svg-button
id=
"validate"
svg=
"/icons/validate.svg"
/>
</form>
</form>
</div>
</div>
</
template
>
</
template
>
...
@@ -31,10 +31,15 @@ export default {
...
@@ -31,10 +31,15 @@ export default {
CheckboxInput
CheckboxInput
},
},
methods
:
{
methods
:
{
onSubmit
:
function
(){
onSubmit
:
function
(
event
){
if
(
event
.
submitter
.
id
==
'back'
)
{
this
.
$router
.
push
(
'/'
);
}
if
(
event
.
submitter
.
id
==
'validate'
)
{
this
.
$router
.
push
(
'lobby'
);
this
.
$router
.
push
(
'lobby'
);
}
}
}
}
}
}
}
</
script
>
</
script
>
...
...
frontend/src/views/Register.vue
View file @
18fef28e
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
</div>
</div>
<svg-button
svg=
"/icons/back.svg"
/>
<svg-button
id=
"back"
svg=
"/icons/back.svg"
/>
<svg-button
svg=
"/icons/validate.svg"
/>
<svg-button
id=
"validate"
svg=
"/icons/validate.svg"
/>
</form>
</form>
</div>
</div>
</
template
>
</
template
>
...
@@ -56,9 +56,14 @@ export default {
...
@@ -56,9 +56,14 @@ export default {
if
(
this
.
showBackError
)
{
if
(
this
.
showBackError
)
{
return
;
return
;
}
}
if
(
event
.
submitter
.
id
==
'back'
)
{
this
.
$router
.
push
(
'/'
);
}
if
(
event
.
submitter
.
id
==
'validate'
)
{
this
.
$router
.
push
(
'lobby'
);
this
.
$router
.
push
(
'lobby'
);
}
}
}
}
}
}
}
</
script
>
</
script
>
...
...
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