fixed all issues other than modal
This commit is contained in:
parent
c58a94d23c
commit
76d4011c41
@ -17,8 +17,8 @@ class RecipeModel extends BaseModel
|
|||||||
|
|
||||||
public $category_name;
|
public $category_name;
|
||||||
|
|
||||||
const STATUS = [[ 'publish', 'Publish' ], [ 'pending', 'Pending' ]];
|
const STATUS = [['publish', 'Publish'], ['pending', 'Pending']];
|
||||||
|
|
||||||
static protected $search_fields = ['obj.title'];
|
static protected $search_fields = ['obj.title'];
|
||||||
static protected $table_name = 'recipes';
|
static protected $table_name = 'recipes';
|
||||||
|
|
||||||
@ -31,22 +31,22 @@ class RecipeModel extends BaseModel
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
'field' => [
|
'field' => [
|
||||||
|
|
||||||
],
|
],
|
||||||
'join_table' => 'recipe_ingredients tb2 ON tb2.recipe_id = obj.id'
|
'join_table' => 'recipe_ingredients tb2 ON tb2.recipe_id = obj.id'
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
static protected $table_fields = [
|
static protected $table_fields = [
|
||||||
'id' => 'int',
|
'id' => 'int',
|
||||||
'title' => 'string',
|
'title' => 'string',
|
||||||
'instruction' => 'string',
|
'instruction' => 'string',
|
||||||
'image_url' => 'string',
|
'image_url' => 'string',
|
||||||
'estimated_time' => 'int',
|
'estimated_time' => 'int',
|
||||||
'estimated_price' => 'float',
|
'estimated_price' => 'float',
|
||||||
'category_id' => 'int',
|
'category_id' => 'int',
|
||||||
'author_id' => 'int',
|
'author_id' => 'int',
|
||||||
'status' => 'string',
|
'status' => 'string',
|
||||||
'created_at' => 'DateTime'
|
'created_at' => 'DateTime'
|
||||||
];
|
];
|
||||||
public static function init_table()
|
public static function init_table()
|
||||||
{
|
{
|
||||||
@ -68,7 +68,7 @@ class RecipeModel extends BaseModel
|
|||||||
);');
|
);');
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
public function get_price()
|
public function get_price()
|
||||||
{
|
{
|
||||||
return $this->field_estimated_price . '$';
|
return $this->field_estimated_price . '$';
|
||||||
}
|
}
|
||||||
@ -76,10 +76,20 @@ class RecipeModel extends BaseModel
|
|||||||
{
|
{
|
||||||
return ucfirst($this->field_status);
|
return ucfirst($this->field_status);
|
||||||
}
|
}
|
||||||
public function get_image_url() {
|
public function get_image_url()
|
||||||
if($this->field_image_url)
|
{
|
||||||
|
if ($this->field_image_url)
|
||||||
return MEDIA_URL . $this->field_image_url;
|
return MEDIA_URL . $this->field_image_url;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function get_html_instruction(): string
|
||||||
|
{
|
||||||
|
return nl2br(trim($this->field_instruction));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get_time(){
|
||||||
|
return $this->field_estimated_time . " minutes";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
require_once(INCLUDES_PATH . '/Const/recipes.php');
|
||||||
the_header(
|
the_header(
|
||||||
$context['recipe']->field_title,
|
$context['recipe']->field_title,
|
||||||
'This is a single recipe page where you can view the details of the recipe, including ingredients, instructions, and more.',
|
'This is a single recipe page where you can view the details of the recipe, including ingredients, instructions, and more.',
|
||||||
@ -36,7 +37,7 @@ the_header(
|
|||||||
</div>
|
</div>
|
||||||
<div class="single-recipe-data__item">
|
<div class="single-recipe-data__item">
|
||||||
<span class="data-name">Time To Make: </span>
|
<span class="data-name">Time To Make: </span>
|
||||||
<span class="data"><?php echo $context['recipe']->field_estimated_time; ?> minutes</span>
|
<span class="data"><?php echo $context['recipe']->get_time(); ?></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="single-recipe-data__item">
|
<div class="single-recipe-data__item">
|
||||||
<span class="data-name">Ingredients: </span>
|
<span class="data-name">Ingredients: </span>
|
||||||
@ -49,13 +50,9 @@ the_header(
|
|||||||
</div>
|
</div>
|
||||||
<div class="button-ctrl">
|
<div class="button-ctrl">
|
||||||
<select class="hidden" name="daily-meal-select" id="daily-meal-day">
|
<select class="hidden" name="daily-meal-select" id="daily-meal-day">
|
||||||
<option value="monday">Monday</option>
|
<?php foreach (DAYS_OF_WEEK as $day): ?>
|
||||||
<option value="tuesday">Tuesday</option>
|
<option value="<?= $day ?>"><?= ucfirst($day) ?></option>
|
||||||
<option value="wednesday">Wednesday</option>
|
<?php endforeach; ?>
|
||||||
<option value="thursday">Thursday</option>
|
|
||||||
<option value="friday">Friday</option>
|
|
||||||
<option value="saturday">Saturday</option>
|
|
||||||
<option value="sunday">Sunday</option>
|
|
||||||
<option value="remove">Remove From List</option>
|
<option value="remove">Remove From List</option>
|
||||||
</select>
|
</select>
|
||||||
<div class="day-select-wrapper">
|
<div class="day-select-wrapper">
|
||||||
@ -65,28 +62,27 @@ the_header(
|
|||||||
<i class="fa-solid fa-list select-icon"></i>
|
<i class="fa-solid fa-list select-icon"></i>
|
||||||
</div>
|
</div>
|
||||||
<div id="custom-select-dropdown" class="custom-select-dropdown hidden">
|
<div id="custom-select-dropdown" class="custom-select-dropdown hidden">
|
||||||
<div class="dropdown-item hover-anim" data-value="monday">Monday</div>
|
<?php foreach (DAYS_OF_WEEK as $day): ?>
|
||||||
<div class="dropdown-item hover-anim" data-value="tuesday">Tuesday</div>
|
<div class="dropdown-item hover-anim" data-value="<?= $day?>">
|
||||||
<div class="dropdown-item hover-anim" data-value="wednesday">Wednesday</div>
|
<?= ucfirst($day) ?>
|
||||||
<div class="dropdown-item hover-anim" data-value="thursday">Thursday</div>
|
</div>
|
||||||
<div class="dropdown-item hover-anim" data-value="friday">Friday</div>
|
<?php endforeach; ?>
|
||||||
<div class="dropdown-item hover-anim" data-value="saturday">Saturday</div>
|
|
||||||
<div class="dropdown-item hover-anim" data-value="sunday">Sunday</div>
|
|
||||||
<div class="dropdown-item hover-anim" data-value="remove">Remove From List</div>
|
<div class="dropdown-item hover-anim" data-value="remove">Remove From List</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-btns">
|
<div class="small-btns">
|
||||||
<button class="btn btn-secondary btn-small hover-anim" title="Add To Favorites">
|
<button class="btn btn-secondary btn-small hover-anim" title="Add To Favorites">
|
||||||
<i class="fa-regular fa-heart"></i>
|
<i class="fa-regular fa-heart"></i>
|
||||||
</button>
|
</button>
|
||||||
<a class="btn btn-secondary btn-small hover-anim"
|
<a class="btn btn-secondary btn-small hover-anim"
|
||||||
href="<?php the_permalink('recipes:export-pdf', [$context['recipe']->get_id()]); ?>"
|
href="<?php the_permalink('recipes:export-pdf', [$context['recipe']->get_id()]); ?>"
|
||||||
target="_blank" title="Export As PDF">
|
target="_blank" title="Export As PDF">
|
||||||
<i class="fa-solid fa-download"></i>
|
<i class="fa-solid fa-download"></i>
|
||||||
</a>
|
</a>
|
||||||
<button class="btn btn-secondary btn-small hover-anim" id="qr-btn" title="Get QR Code">
|
<button class="btn btn-secondary btn-small hover-anim" id="qr-btn" title="Get QR Code">
|
||||||
<i class="fa-solid fa-qrcode"></i>
|
<i class="fa-solid fa-qrcode"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="overlay" class="hidden"></div>
|
<div id="overlay" class="hidden"></div>
|
||||||
<div class="qr-popup hidden">
|
<div class="qr-popup hidden">
|
||||||
@ -102,11 +98,7 @@ the_header(
|
|||||||
<div class="single-instructions">
|
<div class="single-instructions">
|
||||||
<h2 class="title">Instructions</h2>
|
<h2 class="title">Instructions</h2>
|
||||||
|
|
||||||
<?php
|
<?= $context['recipe']->get_html_instruction(); ?>
|
||||||
$formatted = preg_replace('/(\d+\.\s)/', "\n$1", $context['recipe']->field_instruction);
|
|
||||||
|
|
||||||
echo nl2br(trim($formatted));
|
|
||||||
?>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="single-ingredients">
|
<div class="single-ingredients">
|
||||||
<h2 class="title">Ingredients</h2>
|
<h2 class="title">Ingredients</h2>
|
||||||
@ -134,6 +126,8 @@ the_header(
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php the_footer(array(
|
<?php the_footer(array(
|
||||||
ASSETS_PATH . '/js/single.js',
|
ASSETS_PATH . '/js/single.js',
|
||||||
)); ?>
|
)); ?>
|
||||||
1
assets/qrcode/qrcode.min.js
vendored
Normal file
1
assets/qrcode/qrcode.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<script src="<?php echo ASSETS_PATH . '/js/main.js' ?>"></script>
|
<script src="<?php echo ASSETS_PATH . '/js/main.js' ?>"></script>
|
||||||
<script src="<?php echo ASSETS_PATH . '/toastify/toastify-js.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>
|
<script src="<?php echo ASSETS_PATH . '/qrcode/qrcode.min.js' ?>"></script>
|
||||||
<?php foreach($scripts as $script): ?>
|
<?php foreach($scripts as $script): ?>
|
||||||
<script src="<?php echo $script ?>"></script>
|
<script src="<?php echo $script ?>"></script>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 206 KiB |
Loading…
x
Reference in New Issue
Block a user