Add quick links to home
This commit is contained in:
parent
75839634f3
commit
b2c45d437e
8 changed files with 65 additions and 7 deletions
|
@ -9,6 +9,7 @@
|
|||
|
||||
# Wishlists (My lists)
|
||||
RewriteRule ^(wishlists)/([0-9]+)$ /?page=$1&id=$2 [QSA,L]
|
||||
RewriteRule ^(wishlists)/([0-9]+)/add$ /?page=$1&id=$2&wish_add=true [QSA,L]
|
||||
|
||||
# Wishlist
|
||||
RewriteRule ^(wishlist)/([0-9a-f]{40})$ /?page=$1&hash=$2 [QSA,L]
|
||||
|
|
|
@ -44,3 +44,20 @@
|
|||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.column.buttons {
|
||||
display: flex !important;
|
||||
}
|
||||
|
||||
.column.buttons .left.attached.button {
|
||||
flex: 1 1 100%;
|
||||
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.column.buttons .right.attached.button {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
|
|
@ -28,6 +28,11 @@ $(function () {
|
|||
element.dropdown('set selected', wishlists[0].value);
|
||||
}
|
||||
}
|
||||
|
||||
/** Open add wish modal */
|
||||
if ($_GET.wish_add) {
|
||||
$('.button.wishlist-wish-add').trigger('click');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -406,6 +406,7 @@ class Page
|
|||
button_wishlist_saved : '<?= __('Saved') ?>',
|
||||
};
|
||||
</script>
|
||||
|
||||
<?php
|
||||
/** jQuery */
|
||||
$scriptjQuery = 'node_modules/jquery/dist/jquery.min.js';
|
||||
|
|
|
@ -41,6 +41,8 @@ $page->navigation();
|
|||
<li><?= __('Blog') ?></li>
|
||||
<li><?= __('Dark theme') ?></li>
|
||||
<li><?= __('Wish products') ?></li>
|
||||
<li><?= __('Jump to last edited wishlist from home') ?></li>
|
||||
<li><?= __('Quick add wish from home') ?></li>
|
||||
</ul>
|
||||
|
||||
<h3 class="ui header"><?= __('Improved') ?></h3>
|
||||
|
|
|
@ -29,25 +29,54 @@ $page->navigation();
|
|||
<?php if ($user->isLoggedIn()) { ?>
|
||||
<div class="column">
|
||||
<a class="ui fluid primary button"
|
||||
href="<?= Page::PAGE_WISHLISTS ?>"
|
||||
title="<?= __('My lists') ?>"
|
||||
href="<?= Page::PAGE_WISHLISTS ?>"
|
||||
title="<?= __('My lists') ?>"
|
||||
>
|
||||
<?= __('My lists') ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$lastWishlist = null;
|
||||
$lastWishlistQuery = $database->query(
|
||||
' SELECT `wishlists`.*
|
||||
FROM `wishes`
|
||||
JOIN `wishlists` ON `wishes`.`wishlist` = `wishlists`.`id`
|
||||
JOIN `users` ON `wishlists`.`user` = `users`.`id`
|
||||
WHERE `users`.`id` = ' . $user->id . '
|
||||
ORDER BY `wishes`.`edited` DESC
|
||||
LIMIT 1;'
|
||||
);
|
||||
|
||||
if (false !== $lastWishlistQuery && 1 === $lastWishlistQuery->rowCount()) {
|
||||
$lastWishlist = $lastWishlistQuery->fetch();
|
||||
$href = Page::PAGE_WISHLISTS . '&id=' . $lastWishlist['id'];
|
||||
$hrefAdd = $href . '&wish_add=true';
|
||||
?>
|
||||
<div class="column buttons">
|
||||
<a class="ui left attached button" href="<?= $href ?>">
|
||||
<?= $lastWishlist['name'] ?>
|
||||
</a>
|
||||
<a class="ui right attached icon button" href="<?= $hrefAdd ?>">
|
||||
<i class="plus icon"></i>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } else { ?>
|
||||
<div class="column">
|
||||
<a class="ui fluid primary button"
|
||||
href="<?= Page::PAGE_REGISTER ?>"
|
||||
title="<?= __('Register now') ?>"
|
||||
href="<?= Page::PAGE_REGISTER ?>"
|
||||
title="<?= __('Register now') ?>"
|
||||
>
|
||||
<?= __('Register now') ?>
|
||||
</a>
|
||||
</div>
|
||||
<div class="column">
|
||||
<a class="ui fluid button"
|
||||
href="<?= Page::PAGE_LOGIN ?>"
|
||||
title="<?= __('Login') ?>"
|
||||
href="<?= Page::PAGE_LOGIN ?>"
|
||||
title="<?= __('Login') ?>"
|
||||
>
|
||||
<?= __('Login') ?>
|
||||
</a>
|
||||
|
|
|
@ -12,7 +12,9 @@ $page = new Page(__FILE__, __('My lists'));
|
|||
$page->header();
|
||||
$page->bodyStart();
|
||||
$page->navigation();
|
||||
|
||||
?>
|
||||
|
||||
<main>
|
||||
<div class="ui container">
|
||||
<h1 class="ui header"><?= $page->title ?></h1>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/**
|
||||
* Wishes
|
||||
*/
|
||||
ALTER TABLE `wishes` MODIFY `image` TEXT NULL DEFAULT NULL;
|
||||
ALTER TABLE `wishes` MODIFY `image` TEXT NULL DEFAULT NULL,
|
||||
ADD COLUMN `edited` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
|
||||
|
||||
/**
|
||||
* Products
|
||||
|
|
Loading…
Reference in a new issue