nodebb-plugin-onekite-calendar 2.0.60 → 2.0.61

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-onekite-calendar",
3
- "version": "2.0.60",
3
+ "version": "2.0.61",
4
4
  "description": "FullCalendar-based equipment reservation workflow with admin approval & HelloAsso payment for NodeBB",
5
5
  "main": "library.js",
6
6
  "license": "MIT",
package/plugin.json CHANGED
@@ -39,5 +39,5 @@
39
39
  "acpScripts": [
40
40
  "public/admin.js"
41
41
  ],
42
- "version": "2.0.60"
42
+ "version": "2.0.61"
43
43
  }
package/public/client.js CHANGED
@@ -1676,11 +1676,14 @@ function toDatetimeLocalValue(date) {
1676
1676
  const notes = String(p.notes || '').trim();
1677
1677
  const participants = Array.isArray(p.participantsUsernames) ? p.participantsUsernames : [];
1678
1678
  const eidPlain = escapeHtml(String(p.eid || '').replace(/^special:/, ''));
1679
+ // Participants can self-join/leave if they belong to the allowed group.
1680
+ // Use page capabilities as a fallback (details may be minimal in some edge cases).
1681
+ const canJoinHere = !!(p.canJoin || canCreateSpecial);
1679
1682
  // Use real buttons with visible + / - text to avoid relying on icon fonts.
1680
- const joinBtn = (p.canJoin && !p.isParticipant)
1683
+ const joinBtn = (canJoinHere && !p.isParticipant)
1681
1684
  ? `<button type="button" class="btn btn-sm btn-success ms-2 onekite-join-special" data-eid="${eidPlain}" title="S'ajouter" aria-label="S'ajouter">+</button>`
1682
1685
  : '';
1683
- const leaveBtn = (p.canJoin && p.isParticipant)
1686
+ const leaveBtn = (canJoinHere && p.isParticipant)
1684
1687
  ? `<button type="button" class="btn btn-sm btn-danger ms-2 onekite-leave-special" data-eid="${eidPlain}" title="Se retirer" aria-label="Se retirer">−</button>`
1685
1688
  : '';
1686
1689
  const participantsHtml = `<div class="mb-2" id="onekite-participants-special"><strong>Participants</strong>${joinBtn}${leaveBtn}<br>` +
@@ -1819,10 +1822,11 @@ function toDatetimeLocalValue(date) {
1819
1822
  const participants = Array.isArray(p.participantsUsernames) ? p.participantsUsernames : [];
1820
1823
  const oidPlain = escapeHtml(String(p.oid || '').replace(/^outing:/, ''));
1821
1824
  // Use real buttons with visible + / - text to avoid relying on icon fonts.
1822
- const joinBtn = (p.canJoin && !p.isParticipant)
1825
+ const canJoinHere = !!(p.canJoin || canCreateOuting);
1826
+ const joinBtn = (canJoinHere && !p.isParticipant)
1823
1827
  ? `<button type="button" class="btn btn-sm btn-success ms-2 onekite-join-outing" data-oid="${oidPlain}" title="S'ajouter" aria-label="S'ajouter">+</button>`
1824
1828
  : '';
1825
- const leaveBtn = (p.canJoin && p.isParticipant)
1829
+ const leaveBtn = (canJoinHere && p.isParticipant)
1826
1830
  ? `<button type="button" class="btn btn-sm btn-danger ms-2 onekite-leave-outing" data-oid="${oidPlain}" title="Se retirer" aria-label="Se retirer">−</button>`
1827
1831
  : '';
1828
1832
  const participantsHtml = `<div class="mb-2" id="onekite-participants-outing"><strong>Participants</strong>${joinBtn}${leaveBtn}<br>` +