Improve wishlist product view

This commit is contained in:
grandeljay 2022-02-23 18:35:31 +01:00
parent 95c87ba7f9
commit de7d2975a9
2 changed files with 16 additions and 33 deletions

View file

@ -179,23 +179,6 @@ $(function() {
} }
} }
/**
* Details
*/
if (info.publishedTime) {
if (!elementDetails.length) {
elementButtons.before().append(
'<div class="extra content details"></div>'
);
if (info.publishedTime) {
elementContent.children('.extra.content.details').append(
'<span class="right floated">' + info.publishedTime + '</span>'
);
}
}
}
/** /**
* Finish * Finish
*/ */

View file

@ -129,25 +129,25 @@ class Wishlist
<?php } ?> <?php } ?>
</div> </div>
<?php if ($info->publishedTime || $info->providerName) { ?>
<div class="extra content details">
<?php if ($info->publishedTime) { ?>
<span class="right floated">
<?= $info->publishedTime ?>
</span>
<?php } ?>
</div>
<?php } ?>
<div class="extra content buttons"> <div class="extra content buttons">
<?php if ($info->url) { ?> <?php $userIsCurrent = isset($_SESSION['user']) && $this->data['user'] === $_SESSION['user']['id']; ?>
<a class="ui tiny button" href="<?= $info->url ?>" target="_blank">View</a>
<?php if (!$userIsCurrent) { ?>
<a class="ui primary right labeled icon button commit">
<i class="shopping cart icon"></i>
Commit
</a>
<?php } ?> <?php } ?>
<?php if (isset($_SESSION['user']) && $this->data['user'] === $_SESSION['user']['id']) { ?> <?php if ($info->url) { ?>
<a class="ui tiny red button delete">Delete</a> <a class="ui right labeled icon button" href="<?= $info->url ?>" target="_blank">
<?php } else { ?> <i class="external icon"></i>
<a class="ui tiny button commit">Commit</a> View
</a>
<?php } ?>
<?php if ($userIsCurrent) { ?>
<a class="ui red button delete">Delete</a>
<?php } ?> <?php } ?>
</div> </div>