nodebb-plugin-equipment-calendar 2.0.5 → 2.2.2

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/library.js CHANGED
@@ -16,6 +16,17 @@ const helpers = require.main.require('./src/controllers/helpers');
16
16
  const nconf = require.main.require('nconf');
17
17
 
18
18
  const winston = require.main.require('winston');
19
+
20
+ function generateId() {
21
+ try {
22
+ // Node 14+ / modern: crypto.randomUUID
23
+ const crypto = require('crypto');
24
+ if (crypto.randomUUID) return crypto.randomUUID();
25
+ return crypto.randomBytes(16).toString('hex');
26
+ } catch (e) {
27
+ return String(Date.now()) + '-' + Math.random().toString(16).slice(2);
28
+ }
29
+ }
19
30
  const axios = require('axios');
20
31
  const { DateTime } = require('luxon');
21
32
  const { v4: uuidv4 } = require('uuid');
@@ -287,7 +298,7 @@ async function getActiveItems() {
287
298
  const items = (Array.isArray(rawItems) ? rawItems : []).map((it) => ({
288
299
  id: String(it.id || '').trim(),
289
300
  name: String(it.name || '').trim(),
290
- price: String(it.price || '0').trim(),
301
+ price: Number(it.price || 0) || 0,
291
302
  active: true,
292
303
  })).filter(it => it.id && it.name);
293
304
  return items;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-equipment-calendar",
3
- "version": "2.0.5",
3
+ "version": "2.2.2",
4
4
  "description": "Equipment reservation calendar for NodeBB (FullCalendar, approvals, HelloAsso payments)",
5
5
  "main": "library.js",
6
6
  "scripts": {
package/plugin.json CHANGED
@@ -25,6 +25,6 @@
25
25
  "scripts": [
26
26
  "public/js/client.js"
27
27
  ],
28
- "version": "0.7.2",
28
+ "version": "0.7.4",
29
29
  "minver": "4.7.1"
30
30
  }
@@ -42,10 +42,10 @@
42
42
  <div class="mb-3">
43
43
  <label class="form-label">Matériel</label>
44
44
  <select class="form-select" id="ec-item-ids" name="itemIds" multiple required>
45
- {{{ each items }}}
46
- <option value="{@value.id}" data-price="{@value.price}">{@value.name} — {@value.price} €</option>
47
- {{{ end }}}
48
- </select>
45
+ <!-- BEGIN items -->
46
+ <option value="{items.id}" data-price="{items.price}">{items.name} — {items.price} €</option>
47
+ <!-- END items -->
48
+ </select>
49
49
  <div class="form-text">Tu peux sélectionner plusieurs matériels.</div>
50
50
  </div>
51
51