nodebb-plugin-equipment-calendar 0.1.2 → 0.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/README.md +6 -0
- package/library.js +12 -1
- package/package.json +1 -1
- package/plugin.json +18 -10
package/README.md
CHANGED
|
@@ -35,3 +35,9 @@ Le plugin vérifie la signature si `webhookSecret` est renseigné (exemple basiq
|
|
|
35
35
|
- Ce plugin est un squelette complet mais générique : adapte la logique de paiement HelloAsso selon ton besoin exact
|
|
36
36
|
(type de checkout, itemization, montant, etc.).
|
|
37
37
|
- Pour un contrôle d'overlap strict : le plugin empêche les réservations qui chevauchent (même item) pour les statuts bloquants.
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## URLs
|
|
41
|
+
- Calendrier: `/equipment/calendar` (alias `/calendar`)
|
|
42
|
+
- Validations: `/equipment/approvals`
|
|
43
|
+
- ACP: `/admin/plugins/equipment-calendar`
|
package/library.js
CHANGED
|
@@ -306,7 +306,18 @@ function clampRange(startStr, endStr, tz) {
|
|
|
306
306
|
|
|
307
307
|
// --- Routes ---
|
|
308
308
|
plugin.init = async function (params) {
|
|
309
|
-
|
|
309
|
+
const { router } = params;
|
|
310
|
+
const mid = params.middleware;
|
|
311
|
+
|
|
312
|
+
// Admin (ACP) routes
|
|
313
|
+
if (mid && mid.admin) {
|
|
314
|
+
router.get('/admin/plugins/equipment-calendar', mid.admin.buildHeader, renderAdminPage);
|
|
315
|
+
router.get('/api/admin/plugins/equipment-calendar', renderAdminPage);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// Convenience alias (optional): /calendar -> /equipment/calendar
|
|
319
|
+
router.get('/calendar', (req, res) => res.redirect('/equipment/calendar'));
|
|
320
|
+
|
|
310
321
|
|
|
311
322
|
// To verify webhook signature we need raw body; add a rawBody collector for this route only
|
|
312
323
|
router.post('/equipment/webhook/helloasso',
|
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "nodebb-plugin-
|
|
3
|
-
"name": "
|
|
4
|
-
"description": "
|
|
5
|
-
"url": "
|
|
2
|
+
"id": "nodebb-plugin-calendar-onekite",
|
|
3
|
+
"name": "Calendar Onekite",
|
|
4
|
+
"description": "Calendrier + réservation matériel + validation admin + paiement HelloAsso pour NodeBB v4",
|
|
5
|
+
"url": "",
|
|
6
|
+
"version": "0.2.2",
|
|
6
7
|
"library": "./library.js",
|
|
8
|
+
"staticDirs": {
|
|
9
|
+
"static": "static"
|
|
10
|
+
},
|
|
11
|
+
"acpScripts": [
|
|
12
|
+
"static/js/admin.js"
|
|
13
|
+
],
|
|
7
14
|
"hooks": [
|
|
8
15
|
{
|
|
9
16
|
"hook": "static:app.load",
|
|
@@ -14,12 +21,13 @@
|
|
|
14
21
|
"method": "addAdminNavigation"
|
|
15
22
|
},
|
|
16
23
|
{
|
|
17
|
-
"hook": "filter:
|
|
18
|
-
"method": "
|
|
24
|
+
"hook": "filter:widgets.getWidgets",
|
|
25
|
+
"method": "defineWidgets"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"hook": "filter:widget.render:calendarUpcoming",
|
|
29
|
+
"method": "renderUpcomingWidget"
|
|
19
30
|
}
|
|
20
31
|
],
|
|
21
|
-
"
|
|
22
|
-
"public": "./public"
|
|
23
|
-
},
|
|
24
|
-
"templates": "./public/templates"
|
|
32
|
+
"templates": "templates"
|
|
25
33
|
}
|