Subscription cards are now expandable
This commit is contained in:
parent
190c052963
commit
0cd6f64978
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
error_reporting(E_ERROR | E_PARSE);
|
||||||
require_once '../../includes/connect_endpoint.php';
|
require_once '../../includes/connect_endpoint.php';
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
|
|||||||
@ -61,9 +61,6 @@
|
|||||||
$print[$id]['price'] = getPricePerMonth($cycle, $frequency, $print[$id]['price']);
|
$print[$id]['price'] = getPricePerMonth($cycle, $frequency, $print[$id]['price']);
|
||||||
}
|
}
|
||||||
$print[$id]['price'] = number_format($print[$id]['price'], 2, ".", "");
|
$print[$id]['price'] = number_format($print[$id]['price'], 2, ".", "");
|
||||||
$print[$id]['hidelogo'] = isset($_COOKIE['hideNameOnMobile']) && $_COOKIE['hideNameOnMobile'] === 'true' && $print[$id]['logo'] === "wallos.png" ? "hideonmobile" : "";
|
|
||||||
$print[$id]['hidename'] = isset($_COOKIE['hideNameOnMobile']) && $_COOKIE['hideNameOnMobile'] === 'true' && $print[$id]['logo'] != "wallos.png" ? "hideonmobile" : "";
|
|
||||||
$print[$id]['resizename'] = isset($_COOKIE['hideNameOnMobile']) && $_COOKIE['hideNameOnMobile'] === 'true' && $print[$id]['logo'] === "wallos.png" ? "resize" : "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($print)) {
|
if (isset($print)) {
|
||||||
|
|||||||
Binary file not shown.
BIN
images/siteicons/category.png
Normal file
BIN
images/siteicons/category.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
BIN
images/siteicons/payment.png
Normal file
BIN
images/siteicons/payment.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
BIN
images/siteicons/subscription.png
Normal file
BIN
images/siteicons/subscription.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@ -81,9 +81,10 @@
|
|||||||
$currentPayerUserId = $subscription['payer_user_id'];
|
$currentPayerUserId = $subscription['payer_user_id'];
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="subscription">
|
<div class="subscription" onClick="toggleOpenSubscription(<?= $subscription['id'] ?>)" data-id="<?= $subscription['id'] ?>">
|
||||||
<span class="logo <?= $subscription['hidelogo'] ?>"><img src="<?= $subscription['logo'] ?>"></span>
|
<div class="subscription-main">
|
||||||
<span class="name <?= $subscription['hidename'] ?> <?= $subscription['resizename'] ?>"><?= $subscription['name'] ?></span>
|
<span class="logo"><img src="<?= $subscription['logo'] ?>"></span>
|
||||||
|
<span class="name"><?= $subscription['name'] ?></span>
|
||||||
<span class="cycle"><?= $subscription['billing_cycle'] ?></span>
|
<span class="cycle"><?= $subscription['billing_cycle'] ?></span>
|
||||||
<span class="next"><?= $subscription['next_payment'] ?></span>
|
<span class="next"><?= $subscription['next_payment'] ?></span>
|
||||||
<span class="price">
|
<span class="price">
|
||||||
@ -91,11 +92,17 @@
|
|||||||
<?= $subscription['price'] ?><?= $subscription['currency'] ?>
|
<?= $subscription['price'] ?><?= $subscription['currency'] ?>
|
||||||
</span>
|
</span>
|
||||||
<span class="actions">
|
<span class="actions">
|
||||||
<button class="image-button medium" onClick="openEditSubscription(<?= $subscription['id'] ?>)" name="edit">
|
<button class="image-button medium" onClick="openEditSubscription(event, <?= $subscription['id'] ?>)" name="edit">
|
||||||
<img src="images/siteicons/edit.png" title="Edit subscription">
|
<img src="images/siteicons/edit.png" title="Edit subscription">
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="subscription-secondary">
|
||||||
|
<span class="name"><img src="images/siteicons/subscription.png" alt="Subscription" /><?= $subscription['name'] ?></span>
|
||||||
|
<span class="payer_user" title="Paid By"><img src="images/siteicons/payment.png" alt="Paid By" /><?= $members[$subscription['payer_user_id']]['name'] ?></span>
|
||||||
|
<span class="category" title="Category" ><img src="images/siteicons/category.png" alt="Category" /><?= $categories[$subscription['category_id']]['name'] ?></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -89,9 +89,6 @@
|
|||||||
$print[$id]['price'] = getPricePerMonth($cycle, $frequency, $print[$id]['price']);
|
$print[$id]['price'] = getPricePerMonth($cycle, $frequency, $print[$id]['price']);
|
||||||
}
|
}
|
||||||
$print[$id]['price'] = number_format($print[$id]['price'], 2, ".", "");
|
$print[$id]['price'] = number_format($print[$id]['price'], 2, ".", "");
|
||||||
$print[$id]['hidelogo'] = isset($_COOKIE['hideNameOnMobile']) && $_COOKIE['hideNameOnMobile'] === 'true' && $print[$id]['logo'] === "wallos.png" ? "hideonmobile" : "";
|
|
||||||
$print[$id]['hidename'] = isset($_COOKIE['hideNameOnMobile']) && $_COOKIE['hideNameOnMobile'] === 'true' && $print[$id]['logo'] != "wallos.png" ? "hideonmobile" : "";
|
|
||||||
$print[$id]['resizename'] = isset($_COOKIE['hideNameOnMobile']) && $_COOKIE['hideNameOnMobile'] === 'true' && $print[$id]['logo'] === "wallos.png" ? "resize" : "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($print)) {
|
if (isset($print)) {
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
let isSortOptionsOpen = false;
|
let isSortOptionsOpen = false;
|
||||||
|
|
||||||
|
function toggleOpenSubscription(subId) {
|
||||||
|
const subscriptionElement = document.querySelector('.subscription[data-id="' + subId + '"]');
|
||||||
|
subscriptionElement.classList.toggle('is-open');
|
||||||
|
}
|
||||||
|
|
||||||
function toggleSortOptions() {
|
function toggleSortOptions() {
|
||||||
const sortOptions = document.querySelector("#sort-options");
|
const sortOptions = document.querySelector("#sort-options");
|
||||||
sortOptions.classList.toggle("is-open");
|
sortOptions.classList.toggle("is-open");
|
||||||
@ -74,7 +79,8 @@ function fillEditFormFields(subscription) {
|
|||||||
modal.classList.add("is-open");
|
modal.classList.add("is-open");
|
||||||
}
|
}
|
||||||
|
|
||||||
function openEditSubscription(id) {
|
function openEditSubscription(event, id) {
|
||||||
|
event.stopPropagation();
|
||||||
const url = `endpoints/subscription/get.php?id=${id}`;
|
const url = `endpoints/subscription/get.php?id=${id}`;
|
||||||
fetch(url)
|
fetch(url)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
|
|||||||
@ -556,12 +556,6 @@ function switchTheme() {
|
|||||||
document.cookie = `theme=${themeChoice}; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/`;
|
document.cookie = `theme=${themeChoice}; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setHideNameOnMobileCookie() {
|
|
||||||
const hideNameCheckbox = document.querySelector("#hidename");
|
|
||||||
const value = hideNameCheckbox.checked;
|
|
||||||
document.cookie = `hideNameOnMobile=${value}; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/`;
|
|
||||||
}
|
|
||||||
|
|
||||||
function setShowMonthlyPriceCookie() {
|
function setShowMonthlyPriceCookie() {
|
||||||
const showMonthlyPriceCheckbox = document.querySelector("#monthlyprice");
|
const showMonthlyPriceCheckbox = document.querySelector("#monthlyprice");
|
||||||
const value = showMonthlyPriceCheckbox.checked;
|
const value = showMonthlyPriceCheckbox.checked;
|
||||||
|
|||||||
@ -434,17 +434,10 @@
|
|||||||
<input type="button" value="Switch Light / Dark Theme" onClick="switchTheme()">
|
<input type="button" value="Switch Light / Dark Theme" onClick="switchTheme()">
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
$hidename = isset($_COOKIE['hideNameOnMobile']) && $_COOKIE['hideNameOnMobile'] === 'true';
|
|
||||||
$monthlyprice = isset($_COOKIE['showMonthlyPrice']) && $_COOKIE['showMonthlyPrice'] === 'true';
|
$monthlyprice = isset($_COOKIE['showMonthlyPrice']) && $_COOKIE['showMonthlyPrice'] === 'true';
|
||||||
$convertcurrency = isset($_COOKIE['convertCurrency']) && $_COOKIE['convertCurrency'] === 'true';
|
$convertcurrency = isset($_COOKIE['convertCurrency']) && $_COOKIE['convertCurrency'] === 'true';
|
||||||
$removebackground = isset($_COOKIE['removeBackground']) && $_COOKIE['removeBackground'] === 'true';
|
$removebackground = isset($_COOKIE['removeBackground']) && $_COOKIE['removeBackground'] === 'true';
|
||||||
?>
|
?>
|
||||||
<div>
|
|
||||||
<div class="form-group-inline">
|
|
||||||
<input type="checkbox" id="hidename" name="hidename" onChange="setHideNameOnMobileCookie()" <?= $hidename ? "checked" : "" ?>>
|
|
||||||
<label for="hidename">Hide subscripton name on mobile</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
<div class="form-group-inline">
|
<div class="form-group-inline">
|
||||||
<input type="checkbox" id="monthlyprice" name="monthlyprice" onChange="setShowMonthlyPriceCookie()" <?php if ($monthlyprice) echo 'checked'; ?>>
|
<input type="checkbox" id="monthlyprice" name="monthlyprice" onChange="setShowMonthlyPriceCookie()" <?php if ($monthlyprice) echo 'checked'; ?>>
|
||||||
|
|||||||
@ -178,22 +178,42 @@ main > .contain {
|
|||||||
.subscriptions {
|
.subscriptions {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 12px;
|
gap: 15px;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 17px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.subscription {
|
.subscription {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: column;
|
||||||
height: 45px;
|
height: auto;
|
||||||
align-items: center;
|
justify-content: flex-start;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
||||||
padding: 12px 15px;
|
padding: 12px 15px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.subscription > span {
|
.subscription-main {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.subscription-secondary {
|
||||||
|
display: none;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 6px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subscription-main > span,
|
||||||
|
.subscription-secondary > span {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@ -219,28 +239,9 @@ main > .contain {
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
.subscription .name.hideonmobile {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.subscription .name.resize {
|
|
||||||
flex-basis: 17%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.subscription .logo.hideonmobile {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.subscription .cycle {
|
.subscription .cycle {
|
||||||
flex-basis: 16%;
|
flex-basis: 16%;
|
||||||
}
|
flex-grow: 1;
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
.subscription .cycle {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.subscription .next {
|
.subscription .next {
|
||||||
@ -264,6 +265,42 @@ main > .contain {
|
|||||||
flex-basis: auto;
|
flex-basis: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.subscription .actions img {
|
||||||
|
width: 25px;
|
||||||
|
height: 25px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subscription-secondary > .name {
|
||||||
|
display: none;
|
||||||
|
justify-content: flex-start;
|
||||||
|
flex-basis: 33%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subscription-secondary > span {
|
||||||
|
justify-content: flex-start;
|
||||||
|
flex-basis: 33%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.subscription-main > .name {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subscription-secondary > .name {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.subscription.is-open .subscription-secondary {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subscription-secondary img {
|
||||||
|
height: 20px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.empty-page {
|
.empty-page {
|
||||||
display: block;
|
display: block;
|
||||||
max-width: 90%;
|
max-width: 90%;
|
||||||
@ -284,12 +321,6 @@ main > .contain {
|
|||||||
margin: 0px auto;
|
margin: 0px auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.subscription .actions img {
|
|
||||||
width: 25px;
|
|
||||||
height: 25px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.account-section {
|
.account-section {
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
border: 1px solid #eee;
|
border: 1px solid #eee;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user