Skip to content

Commit 6c0a67f

Browse files
committed
Merge branch 'release/0.8.77'
2 parents 0407ab5 + 434225a commit 6c0a67f

6 files changed

Lines changed: 58 additions & 7 deletions

File tree

.version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"strategy": "semver",
33
"major": 0,
44
"minor": 8,
5-
"patch": 76,
5+
"patch": 77,
66
"build": 0
77
}

resources/views/admin/dashboard/index.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,34 @@
5656
</div>
5757
</div>
5858

59+
<h6 class="text-muted mt-4 mb-2">Commerce</h6>
60+
<div class="row g-3 mb-4">
61+
<div class="col-12 col-sm-6 col-lg-3">
62+
<a href="<?= route_path('admin_products') ?>" class="btn btn-outline-success w-100 py-3">
63+
<i class="bi bi-box-seam d-block mb-2" style="font-size: 1.5rem;"></i>
64+
Products
65+
</a>
66+
</div>
67+
<div class="col-12 col-sm-6 col-lg-3">
68+
<a href="<?= route_path('admin_orders') ?>" class="btn btn-outline-success w-100 py-3">
69+
<i class="bi bi-bag-check d-block mb-2" style="font-size: 1.5rem;"></i>
70+
Orders
71+
</a>
72+
</div>
73+
<div class="col-12 col-sm-6 col-lg-3">
74+
<a href="<?= route_path('admin_payments') ?>" class="btn btn-outline-success w-100 py-3">
75+
<i class="bi bi-cash-coin d-block mb-2" style="font-size: 1.5rem;"></i>
76+
Payments
77+
</a>
78+
</div>
79+
<div class="col-12 col-sm-6 col-lg-3">
80+
<a href="<?= route_path('admin_subscriptions') ?>" class="btn btn-outline-success w-100 py-3">
81+
<i class="bi bi-arrow-repeat d-block mb-2" style="font-size: 1.5rem;"></i>
82+
Subscriptions
83+
</a>
84+
</div>
85+
</div>
86+
5987
<h6 class="text-muted mt-4 mb-2">Users & Settings</h6>
6088
<div class="row g-3 mb-4">
6189
<div class="col-12 col-sm-6 col-lg-3">

resources/views/admin/products/_form.php

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
*
55
* Expects $product ( array|null ).
66
*/
7-
$product = $product ?? null;
8-
$price = $product !== null ? number_format( ( (int) ( $product['price_cents'] ?? 0 ) ) / 100, 2, '.', '' ) : '';
9-
$active = $product === null ? true : ( (int) ( $product['active'] ?? 0 ) === 1 );
7+
$product = $product ?? null;
8+
$price = $product !== null ? number_format( ( (int) ( $product['price_cents'] ?? 0 ) ) / 100, 2, '.', '' ) : '';
9+
$active = $product === null ? true : ( (int) ( $product['active'] ?? 0 ) === 1 );
10+
$imageUrl = (string) ( $product['image_url'] ?? '' );
1011
?>
1112
<div class="mb-3">
1213
<label for="name" class="form-label">Name <span class="text-danger">*</span></label>
@@ -34,10 +35,26 @@
3435
</div>
3536

3637
<div class="mb-3">
37-
<label for="image_url" class="form-label">Image URL</label>
38-
<input type="text" class="form-control" id="image_url" name="image_url" value="<?= htmlspecialchars( (string) ( $product['image_url'] ?? '' ) ) ?>" placeholder="https://...">
39-
<div class="form-text">Paste a media URL or external image link.</div>
38+
<label for="image_url" class="form-label">Image</label>
39+
<div class="input-group">
40+
<input type="text" class="form-control" id="image_url" name="image_url" value="<?= htmlspecialchars( $imageUrl ) ?>" placeholder="Enter URL or browse from media library">
41+
<button type="button" class="btn btn-outline-secondary" onclick="openMediaPicker('image_url')">
42+
<i class="bi bi-images"></i> Browse
43+
</button>
44+
</div>
45+
<div class="mt-2">
46+
<img id="image_url_preview" class="img-thumbnail <?= $imageUrl === '' ? 'd-none' : '' ?>" style="max-width: 300px;" src="<?= htmlspecialchars( $imageUrl ) ?>" alt="Product image preview">
47+
</div>
48+
<div class="form-text">Pick from the media library, upload a new image, or paste a URL.</div>
4049
</div>
50+
<script>
51+
document.getElementById('image_url').addEventListener('change', function() {
52+
const preview = document.getElementById('image_url_preview');
53+
const url = this.value.trim();
54+
if( url ) { preview.src = url; preview.classList.remove('d-none'); }
55+
else { preview.classList.add('d-none'); }
56+
});
57+
</script>
4158

4259
<div class="mb-3">
4360
<label for="description" class="form-label">Description</label>

resources/views/admin/products/create.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@
2626
</div>
2727
</div>
2828
</div>
29+
30+
<?php include __DIR__ . '/../../partials/media-picker-modal.php'; ?>

resources/views/admin/products/edit.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@
2727
</div>
2828
</div>
2929
</div>
30+
31+
<?php include __DIR__ . '/../../partials/media-picker-modal.php'; ?>

versionlog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 0.8.77 2026-06-23
2+
13
## 0.8.76 2026-06-23
24

35
* Added payments ui components.

0 commit comments

Comments
 (0)