Skip to content

Commit

Permalink
feat: add slovenian translation
Browse files Browse the repository at this point in the history
fix: currency conversion failing on the statistics page
  • Loading branch information
ellite authored May 27, 2024
1 parent cd9c75d commit 03ceb8a
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 24 deletions.
Binary file removed images/siteicons/draggable.png
Binary file not shown.
Binary file removed images/siteicons/editavatar.png
Binary file not shown.
Binary file removed images/siteicons/filter.png
Binary file not shown.
Binary file removed images/siteicons/plusicon.png
Binary file not shown.
Binary file removed images/siteicons/sort.png
Binary file not shown.
2 changes: 1 addition & 1 deletion includes/version.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
$version = "v2.0.0";
$version = "v2.1.0";
?>
10 changes: 5 additions & 5 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<section class="contain">
<header class="<?= $headerClass ?>" id="main-actions">
<button class="button" onClick="addSubscription()">
<img class="button-icon" src="images/siteicons/plusicon.png">
<i class="fa-solid fa-circle-plus"></i>
<?= translate('new_subscription', $i18n) ?>
</button>
<div class="top-actions">
Expand All @@ -49,7 +49,7 @@
</div>

<div class="filtermenu on-dashboard">
<button class="button" id="filtermenu-button" title="<?= translate("filter", $i18n) ?>">
<button class="button secondary-button" id="filtermenu-button" title="<?= translate("filter", $i18n) ?>">
<i class="fa-solid fa-filter"></i>
</button>
<div class="filtermenu-content">
Expand Down Expand Up @@ -128,8 +128,8 @@
</div>

<div class="sort-container">
<button class="button" value="Sort" onClick="toggleSortOptions()" id="sort-button" title="<?= translate('sort', $i18n) ?>">
<img src="images/siteicons/sort.png" class="button-icon" />
<button class="button secondary-button" value="Sort" onClick="toggleSortOptions()" id="sort-button" title="<?= translate('sort', $i18n) ?>">
<i class="fa-solid fa-arrow-down-wide-short"></i>
</button>
<div class="sort-options" id="sort-options">
<ul>
Expand Down Expand Up @@ -195,7 +195,7 @@
<?= translate('no_subscriptions_yet', $i18n) ?>
</p>
<button class="button" onClick="addSubscription()">
<img class="button-icon" src="images/siteicons/plusicon.png">
<i class="fa-solid fa-circle-plus"></i>
<?= translate('add_first_subscription', $i18n) ?>
</button>
</div>
Expand Down
3 changes: 3 additions & 0 deletions service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ self.addEventListener('install', function(event) {
'scripts/i18n/pt.js',
'scripts/i18n/pt_br.js',
'scripts/i18n/ru.js',
'scripts/i18n/sl.js',
'scripts/i18n/sr_lat.js',
'scripts/i18n/sr.js',
'scripts/i18n/tr.js',
'scripts/i18n/zh_cn.js',
'scripts/i18n/zh_tw.js',
Expand Down
10 changes: 6 additions & 4 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<div>
<div class="user-avatar">
<img src="<?= $userData['avatar'] ?>" alt="avatar" class="avatar" id="avatarImg" onClick="toggleAvatarSelect()"/>
<span class="edit-avatar" onClick="toggleAvatarSelect()">
<img src="images/siteicons/editavatar.png" title="Change avatar" />
<span class="edit-avatar" onClick="toggleAvatarSelect()" title="Change Avatar">
<i class="fa-solid fa-pencil"></i>
</span>
</div>

Expand Down Expand Up @@ -623,7 +623,7 @@
}
?>
<div class="form-group-inline" data-categoryid="<?= $category['id'] ?>">
<div class="drag-icon"></div>
<div class=" drag-icon"><i class="fa-solid fa-grip-vertical"></i></div>
<input type="text" name="category" value="<?= $category['name'] ?>" placeholder="Category">
<button class="image-button medium" onClick="editCategory(<?= $category['id'] ?>)" name="save">
<img src="images/siteicons/<?= $colorTheme ?>/save.png" title="<?= translate('save_category', $i18n) ?>">
Expand Down Expand Up @@ -861,7 +861,9 @@
data-in-use="<?= $inUse ? 'yes' : 'no' ?>"
data-paymentid="<?= $payment['id'] ?>"
title="<?= $inUse ? translate('cant_delete_payment_method_in_use', $i18n) : ($payment['enabled'] ? translate('disable', $i18n) : translate('enable', $i18n)) ?>">
<div class="drag-icon" title=""></div>
<div class="drag-icon" title="">
<i class="fa-solid fa-grip-vertical"></i>
</div>
<img src="<?= $paymentIconFolder.$payment['icon'] ?>" alt="Logo" />
<span class="payment-name" contenteditable="true" title="<?= translate("rename_payment_method", $i18n) ?>"><?= $payment['name'] ?></span>
<?php
Expand Down
6 changes: 3 additions & 3 deletions stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function getPricePerMonth($cycle, $frequency, $price) {
}


function getPriceConverted($price, $currency, $database) {
function getPriceConverted($price, $currency, $database, $userId) {
$query = "SELECT rate FROM currencies WHERE id = :currency AND user_id = :userId";
$stmt = $database->prepare($query);
$stmt->bindParam(':currency', $currency, SQLITE3_INTEGER);
Expand Down Expand Up @@ -153,7 +153,7 @@ function getPriceConverted($price, $currency, $database) {
$categoryId = $subscription['category_id'];
$paymentMethodId = $subscription['payment_method_id'];
$inactive = $subscription['inactive'];
$originalSubscriptionPrice = getPriceConverted($price, $currency, $db);
$originalSubscriptionPrice = getPriceConverted($price, $currency, $db, $userId);
$price = getPricePerMonth($cycle, $frequency, $originalSubscriptionPrice);

if ($inactive == 0) {
Expand Down Expand Up @@ -229,7 +229,7 @@ function getPriceConverted($price, $currency, $database) {
<?= translate('general_statistics', $i18n) ?> <span class="header-subtitle"><?= $statsSubtitle ?></span>
</h2>
<div class="filtermenu">
<button class="button" id="filtermenu-button">
<button class="button secondary-button" id="filtermenu-button">
<i class="fa-solid fa-filter"></i>
<?= translate("filter", $i18n) ?>
</button>
Expand Down
28 changes: 17 additions & 11 deletions styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,8 @@ header #avatar {
background-color: rgba(0,0,0,0.6);
border-radius: 39px;
cursor: pointer;
color: #FFFFFF;
font-size: 30px;
}

.user-form .user-avatar:hover > .edit-avatar {
Expand All @@ -553,10 +555,6 @@ header #avatar {
}
}

.user-form .user-avatar .edit-avatar > img {
width: 30px;
}

.avatar-select {
display: none;
background-color: white;
Expand Down Expand Up @@ -784,8 +782,8 @@ header #avatar {

.payments-list .payments-payment .drag-icon {
height: 20px;
width: 12px;
background-size: contain;
width: 14px;
font-size: 14px;
}

.payments-list .payments-payment > img {
Expand Down Expand Up @@ -1616,16 +1614,17 @@ textarea.thin {
width: 28px;
height: 50px;
cursor: grab;
background-image: url(../images/siteicons/draggable.png);
background-repeat: no-repeat;
background-position: center;
background-size: 14px auto;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
}

.sortable-list .sortable-ghost {
border-radius: 16px;
border-radius: 8px;
background-color: rgba(var(--accent-color-rgb), 0.6);
border: 1px solid var(--accent-color);
padding: 5px;
}

/* Fitler dropdown */
Expand Down Expand Up @@ -1865,6 +1864,7 @@ textarea.thin {
display: flex;
flex-direction: row;
flex-grow: 1;
flex-wrap: wrap;
}

.user-list .user-list-row {
Expand All @@ -1873,6 +1873,12 @@ textarea.thin {
flex-grow: 1;
}

@media (max-width: 768px) {
.user-list .user-list-row {
flex-direction: column;
}
}

.user-list .user-list-row:last-of-type {
flex-grow: 0;
}
Expand Down

0 comments on commit 03ceb8a

Please sign in to comment.