TIST-17: added single recipe page #15
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "TIST-17"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -4,0 +36,4 @@</div><div class="single-recipe-data__item"><span class="data-name">Time To Make: </span><span class="data"><?php echo $context['recipe']->field_estimated_time; ?> minutes</span>Can you create a new function in the RecipeModel that returns a string combining the estimated_time field and the word “minutes”? I think it will be used repeatedly in the future.
@ -4,0 +55,4 @@<option value="thursday">Thursday</option><option value="friday">Friday</option><option value="saturday">Saturday</option><option value="sunday">Sunday</option>Days of the week can be used in different places, so it would be better to save them as a constant variable to make them reusable.
You can create a new constant variable with all day of weeks in the format
['monday' => 'Monday'], and place it in theConst/directory as a file namedrecipes.php(create this directory inside/includes/if it doesn’t exist).After that, include it using
require_onceand use aforeach(DAY_OF_WEKS as $key => $label)to generate the select options.P.s. Only day of weeks. You don't need add to this array
remove. It's not day of week. You can leave that option as it is.Check TIST-27 Pull Request and approve it. After that, then I will merge it with develop, you can make
git pull origin develop.In TIST-27 I have already added this const
@ -4,0 +71,4 @@<div class="dropdown-item hover-anim" data-value="thursday">Thursday</div><div class="dropdown-item hover-anim" data-value="friday">Friday</div><div class="dropdown-item hover-anim" data-value="saturday">Saturday</div><div class="dropdown-item hover-anim" data-value="sunday">Sunday</div>Same comment as above
@ -4,0 +103,4 @@<h2 class="title">Instructions</h2><?php$formatted = preg_replace('/(\d+\.\s)/', "\n$1", $context['recipe']->field_instruction);You can create a new function like
get_html_instruction()in theRecipeModel, which returns the formatted instruction (as string).And it's really important
preg_replace('/(\d+\.\s)/', "\n$1", $context['recipe']->field_instruction)? I think you can use onlynl2br(trim($formatted));@ -21,3 +21,3 @@<script src="<?php echo ASSETS_PATH . '/js/main.js' ?>"></script><script src="<?php echo ASSETS_PATH . '/toastify/toastify-js.js' ?>"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>I think you need to save this file in the ASSETS_PATH like
toastify.js.@ -0,0 +37,4 @@const qrContainer = document.getElementById("qrcode");const downloadLink = document.getElementById("downloadLink");const qrBtn = document.getElementById("qr-btn");const qrPopup = document.querySelector(".qr-popup");This is not poppup, this is modal.
Of course, you can leave it, but I think you need to create your own solution for modal. It's small difficulty, but after you can use this modal everywhere.
So, every modal has same codebase:
So default behavior for every modal you can implement in the
main.js. After that, make some events for it. If you need more details, I can explain how to do itWe can talk about it on Discord
Delete this file
media/chana-masala-recipe_684f4743a2a80.jpg. It's don't need in the media folder.I know that you used it because we don't have image url early, but not this is file isn't neccesary
947616f0ffto841865b976841865b976to76d4011c41