Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CaCaoCritics
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bilel El Yaagoubi
CaCaoCritics
Commits
ddaac8e7
Commit
ddaac8e7
authored
3 years ago
by
Bilel El Yaagoubi
Browse files
Options
Downloads
Patches
Plain Diff
beginning of work
parent
8b463bc8
No related branches found
No related tags found
1 merge request
!8
Movie page
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
frontend/src/components/Movie.vue
+6
-3
6 additions, 3 deletions
frontend/src/components/Movie.vue
frontend/src/router/index.js
+6
-0
6 additions, 0 deletions
frontend/src/router/index.js
frontend/src/views/MoviePage.vue
+86
-0
86 additions, 0 deletions
frontend/src/views/MoviePage.vue
with
98 additions
and
3 deletions
frontend/src/components/Movie.vue
+
6
−
3
View file @
ddaac8e7
...
@@ -9,7 +9,11 @@
...
@@ -9,7 +9,11 @@
<tr
v-for=
"movie in movies"
:key=
"movie.id"
>
<tr
v-for=
"movie in movies"
:key=
"movie.id"
>
<td>
{{
movie
.
title
}}
</td>
<td>
{{
movie
.
title
}}
</td>
<td>
{{
movie
.
release_date
}}
</td>
<td>
{{
movie
.
release_date
}}
</td>
<td>
<img
:src=
"'https://image.tmdb.org/t/p/original/' + movie.poster_path"
/>
</td>
<td>
<img
:src=
"'https://image.tmdb.org/t/p/original/' + movie.poster_path"
/>
</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
...
@@ -23,5 +27,4 @@ export default {
...
@@ -23,5 +27,4 @@ export default {
};
};
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
></
style
>
</
style
>
This diff is collapsed.
Click to expand it.
frontend/src/router/index.js
+
6
−
0
View file @
ddaac8e7
...
@@ -3,6 +3,7 @@ import Home from "../views/Home.vue";
...
@@ -3,6 +3,7 @@ import Home from "../views/Home.vue";
import
Counter
from
"
../views/Counter.vue
"
;
import
Counter
from
"
../views/Counter.vue
"
;
import
Users
from
"
../views/Users.vue
"
;
import
Users
from
"
../views/Users.vue
"
;
import
About
from
"
../views/About.vue
"
;
import
About
from
"
../views/About.vue
"
;
import
MoviePage
from
"
../views/MoviePage
"
;
const
routes
=
[
const
routes
=
[
{
{
...
@@ -25,6 +26,11 @@ const routes = [
...
@@ -25,6 +26,11 @@ const routes = [
name
:
"
About
"
,
name
:
"
About
"
,
component
:
About
,
component
:
About
,
},
},
{
path
:
"
/movie/:id
"
,
name
:
"
MoviePage
"
,
component
:
MoviePage
,
},
];
];
const
router
=
createRouter
({
const
router
=
createRouter
({
...
...
This diff is collapsed.
Click to expand it.
frontend/src/views/MoviePage.vue
0 → 100644
+
86
−
0
View file @
ddaac8e7
<
template
>
<div
class=
"home"
>
<h1>
Bienvenue sur la page film
</h1>
<img
class=
"logo"
alt=
"Vue logo"
src=
"../assets/logo.png"
/>
<br
/>
<input
type=
"text"
v-model=
"moviename"
placeholder=
"enter a movie name"
/>
<div
class=
"film-name"
>
Le film est :
{{
moviename
}}
</div>
<li
v-for=
"movie in movies"
:key=
"movie.id"
>
<p
class=
"movie-title"
>
{{
movie
.
title
}}
</p>
<p>
<img
:src=
"'https://image.tmdb.org/t/p/original/' + movie.poster_path"
withd=
"100"
height=
"300"
/>
</p>
</li>
</div>
</
template
>
<
script
>
import
axios
from
"
axios
"
;
const
backendURL
=
process
.
env
.
VUE_APP_BACKEND_BASE_URL
;
export
default
{
name
:
"
Home
"
,
data
:
function
()
{
return
{
movieId
:
""
,
moviesInfos
:
{},
};
},
methods
:
{
fetchMovie
:
async
function
()
{
try
{
// Do something if call succeeded
const
response
=
await
axios
.
get
(
backendURL
+
"
/movie/id/
"
+
this
.
movieId
);
await
(
this
.
moviesInfos
=
response
);
console
.
log
(
this
.
moviesInfos
);
}
catch
(
error
)
{
// Do something if call failed
this
.
usersLoadingError
=
"
An error occured while fetching movies.
"
;
console
.
error
(
error
);
}
},
},
created
()
{
this
.
movieId
=
this
.
$route
.
params
.
id
;
console
.
log
(
this
.
movieId
);
this
.
fetchMovie
();
},
};
</
script
>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<
style
scoped
>
.home
{
text-align
:
center
;
}
.logo
{
max-width
:
100px
;
}
h3
{
margin
:
40px
0
0
;
}
ul
{
list-style-type
:
none
;
padding
:
0
;
}
li
{
display
:
inline-block
;
margin
:
0
10px
;
}
a
{
color
:
#ff68ad
;
}
</
style
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment