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
bb21e207
Commit
bb21e207
authored
Dec 31, 2020
by
ALGLAVE Ivan
Browse files
RecipeList shows the score depending on a parameter in the url
parent
7b7d1960
Changes
3
Hide whitespace changes
Inline
Side-by-side
AdvancedSearch.php
View file @
bb21e207
...
...
@@ -172,7 +172,8 @@
else
if
(
value
==
'
unwanted
'
)
unwanted
.
push
(
key
);
});
getRecipes
(
wanted
,
unwanted
,
maxUnsatisfied
,
allowMissing
,
allowUnwanted
,
function
(
e
)
{
notifyParent
(
e
);
if
(
maxUnsatisfied
>
0
)
notifyParentScore
(
e
);
else
notifyParent
(
e
);
});
}
...
...
@@ -184,6 +185,15 @@
};
window
.
top
.
postMessage
(
data
,
[
data
.
event
,
data
.
value
]);
}
function
notifyParentScore
(
e
)
// Send a message to the parent window, asking to display the recipe #e
{
var
data
=
{
event
:
'
recipelistscore
'
,
value
:
e
};
window
.
top
.
postMessage
(
data
,
[
data
.
event
,
data
.
value
]);
}
function
appendIngredient
(
ing
,
status
)
{
...
...
Home.php
View file @
bb21e207
...
...
@@ -61,7 +61,11 @@
}
else
if
(
m_event
==
'
recipelist
'
)
{
switchView
(
'
RecipeList.php?ids=
'
+
m_value
);
switchView
(
'
RecipeList.php?ids=
'
+
m_value
+
'
&showscore=false
'
);
}
else
if
(
m_event
==
'
recipelistscore
'
)
{
switchView
(
'
RecipeList.php?ids=
'
+
m_value
+
'
&showscore=true
'
);
}
else
if
(
m_event
==
'
hierarchyDisplay
'
)
{
...
...
RecipeList.php
View file @
bb21e207
...
...
@@ -15,6 +15,8 @@
include
"Donnees.inc.php"
;
include
"scripts/Functions.php"
;
$showScore
=
$_GET
[
'showscore'
]
==
'true'
?
true
:
false
;
if
(
$_GET
[
'ids'
]
==
''
)
echo
'<h1>No recipe found</h1>'
;
...
...
@@ -32,7 +34,7 @@
echo
'<div class="extra">'
;
echo
'<img class="toggleFavourite" src="images/favourite.png" >'
;
echo
'<p class="unsatisfied">Non satisfiés : '
.
$re
[
1
]
.
'</p>'
;
if
(
$showScore
)
echo
'<p class="unsatisfied">Non satisfiés : '
.
$re
[
1
]
.
'</p>'
;
echo
'</div>'
;
echo
'<div class="listElement" onclick="showRecipe('
.
intval
(
$re
[
0
])
.
');">'
;
...
...
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