nodebb-plugin-onekite-calendar 2.0.47 → 2.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api.js +5 -1
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/public/client.js +10 -6
package/lib/api.js
CHANGED
|
@@ -1050,7 +1050,11 @@ api.createOuting = async function (req, res) {
|
|
|
1050
1050
|
if (!req.uid) return res.status(401).json({ error: 'not-logged-in' });
|
|
1051
1051
|
|
|
1052
1052
|
const startTs = toTs(req.body && req.body.start);
|
|
1053
|
-
|
|
1053
|
+
// Permissions for outings must match reservations/locations rights.
|
|
1054
|
+
// We intentionally base the "auto" yearly group on the *current* year,
|
|
1055
|
+
// not on the outing date, so members can plan future outings without
|
|
1056
|
+
// requiring next-year group membership.
|
|
1057
|
+
const ok = await canRequest(req.uid, settings, Date.now());
|
|
1054
1058
|
if (!ok) return res.status(403).json({ error: 'not-allowed' });
|
|
1055
1059
|
|
|
1056
1060
|
const title = String((req.body && req.body.title) || '').trim() || 'Sortie';
|
package/package.json
CHANGED
package/plugin.json
CHANGED
package/public/client.js
CHANGED
|
@@ -1494,12 +1494,13 @@ function toDatetimeLocalValue(date) {
|
|
|
1494
1494
|
}
|
|
1495
1495
|
} catch (e) {}
|
|
1496
1496
|
|
|
1497
|
-
// IMPORTANT: align "special"
|
|
1497
|
+
// IMPORTANT: align "special" events and "outings" display exactly like
|
|
1498
|
+
// reservation icons.
|
|
1498
1499
|
// We inject the clock + time range directly into the event title so FC
|
|
1499
1500
|
// doesn't reserve a separate time column (which creates a leading gap).
|
|
1500
1501
|
const mapped = (Array.isArray(data) ? data : []).map((ev) => {
|
|
1501
1502
|
try {
|
|
1502
|
-
if (ev && ev.extendedProps && ev.extendedProps.type === 'special' && ev.start && ev.end) {
|
|
1503
|
+
if (ev && ev.extendedProps && (ev.extendedProps.type === 'special' || ev.extendedProps.type === 'outing') && ev.start && ev.end) {
|
|
1503
1504
|
// Force the same visual layout as reservations in month view
|
|
1504
1505
|
// (avoid the "dot" layout which introduces a leading gap).
|
|
1505
1506
|
ev.display = 'block';
|
|
@@ -1525,15 +1526,18 @@ function toDatetimeLocalValue(date) {
|
|
|
1525
1526
|
}
|
|
1526
1527
|
},
|
|
1527
1528
|
eventDidMount: function (arg) {
|
|
1528
|
-
// Keep special event colors consistent
|
|
1529
|
+
// Keep special event + outing colors consistent even if a theme overrides
|
|
1530
|
+
// FullCalendar defaults.
|
|
1529
1531
|
try {
|
|
1530
1532
|
const ev = arg && arg.event;
|
|
1531
1533
|
if (!ev) return;
|
|
1532
|
-
|
|
1534
|
+
const t = ev.extendedProps && ev.extendedProps.type;
|
|
1535
|
+
if (t === 'special' || t === 'outing') {
|
|
1533
1536
|
const el2 = arg.el;
|
|
1534
1537
|
if (el2 && el2.style) {
|
|
1535
|
-
|
|
1536
|
-
el2.style.
|
|
1538
|
+
const bg = (t === 'outing') ? '#2980b9' : '#8e44ad';
|
|
1539
|
+
el2.style.backgroundColor = bg;
|
|
1540
|
+
el2.style.borderColor = bg;
|
|
1537
1541
|
el2.style.color = '#ffffff';
|
|
1538
1542
|
}
|
|
1539
1543
|
}
|