Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ALGLAVE Ivan
Drinkpedia
Commits
1f0fbba7
Commit
1f0fbba7
authored
Dec 30, 2020
by
ALGLAVE Ivan
Browse files
Recipes.php now links to RecipeList with all lists as parameter
parent
9e5b65ac
Changes
6
Hide whitespace changes
Inline
Side-by-side
RecipeList.php
View file @
1f0fbba7
...
...
@@ -28,20 +28,22 @@
{
$re
=
explode
(
':'
,
$recipesIds
[
$i
]);
echo
'<li>'
;
echo
'<li><div class="container">'
;
echo
'<img class="toggleFavourite" src="images/favourite.png" >'
;
echo
'<div class="listElement" onclick="showRecipe('
.
intval
(
$re
[
0
])
.
');">'
;
$recipe
=
$Recettes
[
intval
(
$re
[
0
])];
$image_url
=
getRecipeImage
(
$recipe
[
'titre'
]);
$image_url
=
''
.
'Photos/'
.
$image_url
;
if
(
file_exists
(
$image_url
))
echo
'<img src="'
.
$image_url
.
'"></img>'
;
else
echo
'<img src="images/missing.jfif"></img>'
;
if
(
file_exists
(
$image_url
))
echo
'<img
class="cocktailImg"
src="'
.
$image_url
.
'"></img>'
;
else
echo
'<img
class="cocktailImg"
src="images/missing.jfif"></img>'
;
echo
'<h1>'
.
$recipe
[
'titre'
]
.
'</h1>'
;
echo
'</div>'
;
echo
'</li>'
;
echo
'</
div></
li>'
;
}
}
...
...
RecipeView.php
View file @
1f0fbba7
...
...
@@ -5,6 +5,7 @@
<body>
<img
class=
"toggleFavourite"
src=
"images/favourite.png"
>
<?php
include
"scripts/Functions.php"
;
include
"Donnees.inc.php"
;
...
...
@@ -22,7 +23,7 @@
?>
<div>
<img
src=
<?php
echo
"
\"
"
.
$image_url
.
"
\"
"
?>
width="
128
"
height=
"
128
"
;
?
>
<img
src=
<?php
echo
"
\"
"
.
$image_url
.
"
\"
"
?>
width="
256
"
height=
"
256
"
;
?
>
<span>
<h1>
<?php
echo
$r_name
;
?>
...
...
Recipes.php
View file @
1f0fbba7
...
...
@@ -4,37 +4,22 @@
<title>
Drinkpedia
</title>
<meta
charset=
"UTF-8"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/Recipes.css"
>
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"
></script>
</head>
<body>
<h1>
Cocktails
</h1>
<ul>
<?php
include
"Donnees.inc.php"
;
$ar
=
$Recettes
;
for
(
$i
=
0
;
$i
<
count
(
$ar
);
$i
++
)
{
echo
'<li onclick="notifyParent('
.
$i
.
');" hint="Voir">'
.
$ar
[
$i
][
'titre'
]
.
'</li>'
;
}
?>
</ul>
<script
src=
"scripts/DataQuery.js"
></script>
<script>
function
notifyParent
(
e
)
// Send a message to the parent window, asking to display the recipe #e
{
getRecipes
([],
[],
0
,
true
,
true
,
function
(
e
)
{
var
data
=
{
event
:
'
recipe
selec
t
'
,
value
:
Number
(
e
)
event
:
'
recipe
lis
t
'
,
value
:
e
};
window
.
top
.
postMessage
(
data
,
[
data
.
event
,
data
.
value
]);
}
}
);
</script>
</body>
</html>
\ No newline at end of file
css/RecipeList.css
View file @
1f0fbba7
...
...
@@ -29,19 +29,34 @@ ul li:last-child {
border-bottom-right-radius
:
15px
;
}
.container
{
width
:
100%
;
overflow
:
hidden
;
}
.listElement
{
float
:
left
;
display
:
flex
;
flex-direction
:
row
;
justify-content
:
left
;
align-items
:
center
;
}
.
listElement
i
mg
{
.
cocktailI
mg
{
border-radius
:
7px
;
background-color
:
white
;
border-color
:
black
;
border-width
:
2px
;
border-style
:
solid
;
width
:
64px
;
height
:
64px
;
margin-right
:
15px
;
}
\ No newline at end of file
object-fit
:
contain
;
}
.toggleFavourite
{
float
:
right
;
vertical-align
:
middle
;
width
:
32px
;
height
:
auto
;
}
\ No newline at end of file
css/RecipeView.css
View file @
1f0fbba7
...
...
@@ -2,4 +2,17 @@ body {
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
img
{
background-color
:
white
;
object-fit
:
contain
;
}
.toggleFavourite
{
position
:
absolute
;
top
:
0px
;
right
:
0px
;
width
:
32px
;
height
:
32px
;
}
\ No newline at end of file
images/favourite.png
0 → 100644
View file @
1f0fbba7
26.7 KB
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment