nodebb-plugin-calendar-onekite 11.1.95 → 11.1.96

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/admin.js CHANGED
@@ -194,7 +194,7 @@ admin.approveReservation = async function (req, res) {
194
194
  pickupLon: r.pickupLon || '',
195
195
  mapUrl,
196
196
  validatedBy: r.approvedByUsername || '',
197
- validatedByUrl: (r.approvedByUsername ? `https://www.onekite.com/user/${encodeURIComponent(String(r.approvedByUsername))}` : ''),
197
+ validatedByUrl: (r.approvedByUsername ? `https://www.onekite.com/users/${encodeURIComponent(String(r.approvedByUsername))}` : ''),
198
198
  });
199
199
  }
200
200
  } catch (e) {}
package/lib/api.js CHANGED
@@ -624,7 +624,7 @@ api.approveReservation = async function (req, res) {
624
624
  mapUrl,
625
625
  paymentUrl: r.paymentUrl || '',
626
626
  validatedBy: r.approvedByUsername || '',
627
- validatedByUrl: (r.approvedByUsername ? `https://www.onekite.com/user/${encodeURIComponent(String(r.approvedByUsername))}` : ''),
627
+ validatedByUrl: (r.approvedByUsername ? `https://www.onekite.com/users/${encodeURIComponent(String(r.approvedByUsername))}` : ''),
628
628
  });
629
629
  }
630
630
  return res.json({ ok: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-calendar-onekite",
3
- "version": "11.1.95",
3
+ "version": "11.1.96",
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/public/client.js CHANGED
@@ -634,30 +634,7 @@ function toDatetimeLocalValue(date) {
634
634
  const canCreateSpecial = !!caps.canCreateSpecial;
635
635
  const canDeleteSpecial = !!caps.canDeleteSpecial;
636
636
 
637
- let setMode('reservation');
638
- function refreshDesktopModeButton() {
639
- try {
640
- const btn = document.querySelector('#onekite-calendar .fc-newSpecial-button');
641
- if (!btn) return;
642
- const isSpecial = mode === 'special';
643
- btn.textContent = isSpecial ? 'Évènement ✓' : 'Évènement';
644
- btn.classList.toggle('onekite-active', isSpecial);
645
- } catch (e) {}
646
- }
647
-
648
- function setMode(next) {
649
- mode = next;
650
- refreshDesktopModeButton();
651
- try {
652
- const mb = document.querySelector('#onekite-mobile-controls .onekite-mode-btn');
653
- if (mb) {
654
- const isSpecial = mode === 'special';
655
- mb.textContent = isSpecial ? 'Mode évènement ✓' : 'Mode évènement';
656
- mb.classList.toggle('onekite-active', isSpecial);
657
- }
658
- } catch (e) {}
659
- }
660
- // or 'special'
637
+ let mode = 'reservation'; // or 'special'
661
638
 
662
639
  // Inject lightweight responsive CSS once.
663
640
  try {
@@ -683,21 +660,7 @@ function toDatetimeLocalValue(date) {
683
660
  #onekite-calendar .fc .fc-toolbar-title { font-size: 1rem; }
684
661
  #onekite-calendar .fc .fc-button { padding: .2rem .4rem; font-size: .8rem; }
685
662
  }
686
-
687
- /* Violet action button (events mode) */
688
- #onekite-calendar .fc .fc-newSpecial-button,
689
- .onekite-btn-violet {
690
- background: #6f42c1 !important;
691
- border-color: #6f42c1 !important;
692
- color: #fff !important;
693
- }
694
- /* Active state */
695
- #onekite-calendar .fc .fc-newSpecial-button.onekite-active,
696
- .onekite-btn-violet.onekite-active {
697
- filter: brightness(0.95);
698
- box-shadow: 0 0 0 0.15rem rgba(111,66,193,.25);
699
- }
700
- `;
663
+ `;
701
664
  document.head.appendChild(st);
702
665
  }
703
666
  } catch (e) {}
@@ -741,10 +704,8 @@ function toDatetimeLocalValue(date) {
741
704
  newSpecial: {
742
705
  text: 'Évènement',
743
706
  click: () => {
744
- setMode((mode === 'special') ? 'reservation' : 'special');
745
- if (mode === 'special') {
746
- showAlert('success', 'Mode évènement : sélectionne une plage (date/heure) sur le calendrier.');
747
- }
707
+ mode = 'special';
708
+ showAlert('success', 'Mode évènement : sélectionne une plage (date/heure) sur le calendrier.');
748
709
  },
749
710
  },
750
711
  } : {},
@@ -769,7 +730,7 @@ function toDatetimeLocalValue(date) {
769
730
  try {
770
731
  if (mode === 'special' && canCreateSpecial) {
771
732
  const payload = await openSpecialEventDialog(info);
772
- setMode('reservation');
733
+ mode = 'reservation';
773
734
  if (!payload) {
774
735
  calendar.unselect();
775
736
  isDialogOpen = false;
@@ -895,7 +856,7 @@ function toDatetimeLocalValue(date) {
895
856
  // Reserved-by line (user profile link)
896
857
  const username = String(p.username || p.user || p.reservedBy || p.ownerUsername || '').trim();
897
858
  const userLine = username
898
- ? `<div class="mb-2"><strong>Réservée par</strong><br><a href="${window.location.origin}/user/${encodeURIComponent(username)}">${escapeHtml(username)}</a></div>`
859
+ ? `<div class="mb-2"><strong>Réservé par</strong><br><a href="${window.location.origin}/user/${encodeURIComponent(username)}">${escapeHtml(username)}</a></div>`
899
860
  : '';
900
861
  const itemsHtml = (() => {
901
862
  const names = Array.isArray(p.itemNames) ? p.itemNames : (typeof p.itemNames === 'string' && p.itemNames.trim() ? p.itemNames.split(',').map(s=>s.trim()).filter(Boolean) : (p.itemName ? [p.itemName] : []));
@@ -908,7 +869,7 @@ function toDatetimeLocalValue(date) {
908
869
 
909
870
  const approvedBy = String(p.approvedByUsername || '').trim();
910
871
  const validatedByHtml = approvedBy
911
- ? `<div class=\"mb-2\"><strong>Validée par</strong><br><a href=\"https://www.onekite.com/user/${encodeURIComponent(approvedBy)}\">${escapeHtml(approvedBy)}</a></div>`
872
+ ? `<div class=\"mb-2\"><strong>Validée par</strong><br><a href=\"https://www.onekite.com/users/${encodeURIComponent(approvedBy)}\">${escapeHtml(approvedBy)}</a></div>`
912
873
  : '';
913
874
 
914
875
  // Pickup details (address / time / notes) shown once validated
@@ -1165,9 +1126,6 @@ function toDatetimeLocalValue(date) {
1165
1126
 
1166
1127
  calendar.render();
1167
1128
 
1168
- refreshDesktopModeButton();
1169
-
1170
-
1171
1129
  // Mobile controls: view (month/week) + mode (reservation/event) without bloating the header.
1172
1130
  try {
1173
1131
  const controlsId = 'onekite-mobile-controls';
@@ -1215,16 +1173,17 @@ function toDatetimeLocalValue(date) {
1215
1173
  if (canCreateSpecial) {
1216
1174
  const modeBtn = document.createElement('button');
1217
1175
  modeBtn.type = 'button';
1218
- modeBtn.className = 'btn btn-sm onekite-btn-violet onekite-mode-btn';
1176
+ modeBtn.className = 'btn btn-sm btn-outline-warning onekite-mode-btn';
1219
1177
  function refreshModeBtn() {
1220
1178
  const isSpecial = mode === 'special';
1221
1179
  modeBtn.textContent = isSpecial ? 'Mode évènement ✓' : 'Mode évènement';
1222
1180
  modeBtn.classList.toggle('active', isSpecial);
1223
- // Keep violet, only toggle active class
1224
- modeBtn.classList.toggle('onekite-active', isSpecial);
1181
+ // Make the button visually distinct from the view buttons
1182
+ modeBtn.classList.toggle('btn-warning', isSpecial);
1183
+ modeBtn.classList.toggle('btn-outline-warning', !isSpecial);
1225
1184
  }
1226
1185
  modeBtn.addEventListener('click', () => {
1227
- setMode((mode === 'special') ? 'reservation' : 'special');
1186
+ mode = (mode === 'special') ? 'reservation' : 'special';
1228
1187
  refreshModeBtn();
1229
1188
  if (mode === 'special') {
1230
1189
  showAlert('success', 'Mode évènement : sélectionne une plage (date/heure) sur le calendrier.');