Add warning when viewing own wishlist
This commit is contained in:
parent
28e8e1d08d
commit
be1b46cc22
2 changed files with 42 additions and 1 deletions
22
includes/assets/js/wishlist.js
Normal file
22
includes/assets/js/wishlist.js
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
$(function() {
|
||||||
|
if ($('.wishlist-own').length) {
|
||||||
|
$('body')
|
||||||
|
.modal({
|
||||||
|
title: $('.wishlist-own .header').text(),
|
||||||
|
content: $('.wishlist-own .text').html(),
|
||||||
|
class: '',
|
||||||
|
blurring: true,
|
||||||
|
closable: false,
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
text: 'Show wishlist anyway',
|
||||||
|
class: 'approve primary'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
onApprove: function() {
|
||||||
|
$('.wishlist-own').slideUp();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.modal('show');
|
||||||
|
}
|
||||||
|
});
|
|
@ -33,12 +33,31 @@ if ($wishlist) {
|
||||||
<div class="ui container">
|
<div class="ui container">
|
||||||
<h1 class="ui header"><?= $page->title ?></h1>
|
<h1 class="ui header"><?= $page->title ?></h1>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Warn the wishlist creator
|
||||||
|
*/
|
||||||
|
if (isset($user->id) && $user->id === intval($wishlist['user'])) { ?>
|
||||||
|
<div class="ui icon warning message wishlist-own">
|
||||||
|
<i class="exclamation triangle icon"></i>
|
||||||
|
<div class="content">
|
||||||
|
<div class="header">
|
||||||
|
Careful
|
||||||
|
</div>
|
||||||
|
<div class="text">
|
||||||
|
<p>You are viewing your own wishlist! You will be able to see which products have already been bought for you. Don't you want to be surprised?</p>
|
||||||
|
<p>It's probably best to just close this tab.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<div class="ui segment">
|
<div class="ui segment">
|
||||||
<h2 class="ui header"><?= $wishlist['name'] ?></h2>
|
<h2 class="ui header"><?= $wishlist['name'] ?></h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if (!empty($products)) { ?>
|
<?php if (!empty($products)) { ?>
|
||||||
<div class="ui three column grid">
|
<div class="ui three column grid wishlist-cards">
|
||||||
|
|
||||||
<?php foreach ($products as $product) { ?>
|
<?php foreach ($products as $product) { ?>
|
||||||
<?php
|
<?php
|
||||||
|
|
Loading…
Reference in a new issue