feat: implement user favorites and fix toggle functionality
This commit is contained in:
@@ -58,32 +58,36 @@
|
||||
اکنون ثبت کن
|
||||
</button>
|
||||
|
||||
<?php if(auth()->guard()->check()): ?>
|
||||
<form action="<?php echo e(route('accounts.favorites.tour.toggle', ['tour' => $tour->id])); ?>"
|
||||
method="POST"
|
||||
class="d-inline">
|
||||
<?php echo csrf_field(); ?>
|
||||
|
||||
<button type="submit" class="border-btn border-0">
|
||||
<?php if($isFavorite): ?>
|
||||
<i class="fas fa-heart"></i>
|
||||
حذف از علاقهمندیها
|
||||
<?php else: ?>
|
||||
<i class="far fa-heart"></i>
|
||||
افزودن به علاقهمندیها
|
||||
<?php endif; ?>
|
||||
</button>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<a href="<?php echo e(route('auth.login.index')); ?>" class="border-btn">
|
||||
<i class="far fa-heart"></i>
|
||||
افزودن به علاقهمندیها
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="listing-side-btn mt-2">
|
||||
<?php if(auth()->guard()->check()): ?>
|
||||
<form action="<?php echo e(route('accounts.favorites.tour.toggle', ['tour' => $tour->id])); ?>"
|
||||
method="POST"
|
||||
class="favorite-form">
|
||||
<?php echo csrf_field(); ?>
|
||||
|
||||
<button type="submit" class="border-btn border-0">
|
||||
<?php if($isFavorite): ?>
|
||||
<i class="fas fa-heart"></i>
|
||||
حذف از علاقهمندیها
|
||||
<?php else: ?>
|
||||
<i class="far fa-heart"></i>
|
||||
افزودن به علاقهمندیها
|
||||
<?php endif; ?>
|
||||
</button>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<a href="<?php echo e(route('auth.login.index')); ?>"
|
||||
class="border-btn"
|
||||
title="برای افزودن به علاقهمندیها وارد شوید">
|
||||
<i class="far fa-heart"></i>
|
||||
افزودن به علاقهمندیها
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="listing-side-share">
|
||||
<span><i class="far fa-eye"></i> <?php echo e($tour->views_count); ?> مشاهده</span>
|
||||
|
||||
@@ -45,11 +45,36 @@
|
||||
</div>
|
||||
<div class="listing-side-btn">
|
||||
<button type="submit" class="theme-btn"><span class="far fa-shopping-bag"></span>اکنون ثبت کن</button>
|
||||
<a href="#" class="border-btn"><i class="far fa-heart"></i> افزودن به علاقه مندی ها</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="listing-side-btn mt-2">
|
||||
<?php if(auth()->guard()->check()): ?>
|
||||
<form action="<?php echo e(route('accounts.favorites.flight.toggle', ['flight' => $flight->id])); ?>"
|
||||
method="POST"
|
||||
class="favorite-form">
|
||||
<?php echo csrf_field(); ?>
|
||||
|
||||
<button type="submit" class="border-btn border-0">
|
||||
<?php if($isFavorite): ?>
|
||||
<i class="fas fa-heart"></i>
|
||||
حذف از علاقهمندیها
|
||||
<?php else: ?>
|
||||
<i class="far fa-heart"></i>
|
||||
افزودن به علاقهمندیها
|
||||
<?php endif; ?>
|
||||
</button>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<a href="<?php echo e(route('auth.login.index')); ?>"
|
||||
class="border-btn"
|
||||
title="برای افزودن به علاقهمندیها وارد شوید">
|
||||
<i class="far fa-heart"></i>
|
||||
افزودن به علاقهمندیها
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="listing-side-share">
|
||||
<span><i class="far fa-eye"></i> <?php echo e($flight->views_count); ?> مشاهده</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user