docs: verify and refactor documentation to match current codebase

This commit is contained in:
Pontoporeia
2026-08-24 11:31:38 +02:00
parent b2cdbd0174
commit e9747edce0
17 changed files with 1006 additions and 1442 deletions
+82 -86
View File
@@ -1,111 +1,107 @@
# Bookmarklet
# Bookmarklet — auto-fill test form
## Auto-fill TFE form (testing)
A drag-to-bookmarks helper that pre-fills an XAMXAM thesis form with dummy data
so a submit can be tested quickly.
Drag the link below to your bookmarks bar, open `/admin/add.php?mode=student`, then click it. Every field gets filled with dummy data so you can hit submit immediately.
> The old `?mode=student` flag and the standalone student form no longer exist.
> Student submissions now use **share links** at `/partage/<slug>` (see the
> `share_links` table). The same form template (`app/templates/partials/form/`)
> drives admin add/edit and the partage form, so the field names below mostly
> match. The bookmarklet below targets the **admin** add form
> (`/admin/add.php`).
### Bookmarklet
## Bookmarklet
**[Remplir TFE](javascript:(function()%7Bvar%20f%3Ddocument.querySelector('form.admin-form')%3Bif(!f)return%3Bvar%20set%3Dfunction(n%2Cv)%7Bvar%20e%3Df.querySelector('[name%3D%22'%2Bn%2B'%22]')%3Bif(e)%7Be.value%3Dv%3Be.dispatchEvent(new%20Event('change'%2C%7Bbubbles%3Atrue%7D))%3B%7D%7D%3Bvar%20check%3Dfunction(n)%7Bvar%20e%3Df.querySelector('[name%3D%22'%2Bn%2B'%22]')%3Bif(e)%7Be.checked%3Dtrue%3Be.dispatchEvent(new%20Event('change'%2C%7Bbubbles%3Atrue%7D))%3B%7D%7D%3Bvar%20checkCB%3Dfunction(n%2Cv)%7Bvar%20e%3Df.querySelector('[name%3D%22'%2Bn%2B'[]%22][value%3D%22'%2Bv%2B'%22]')%3Bif(e)%7Be.checked%3Dtrue%3Be.dispatchEvent(new%20Event('change'%2C%7Bbubbles%3Atrue%7D))%3B%7D%7D%3Bset('titre'%2C'TFE%20Test%20%E2%80%94%20Impact%20des%20r%C3%A9seaux%20sociaux%20sur%20la%20pratique%20artistique%20contemporaine')%3Bset('subtitle'%2C'%C3%89tude%20de%20cas%20aupr%C3%A8s%20des%20%C3%A9tudiant%C2%B7es%20de%20l%27ERG')%3Bset('auteurice'%2C'Marie-France%20Dupont')%3Bset('mail'%2C'mfd%40testmail.be')%3Bset('synopsis'%2C'Ce%20travail%20explore%20la%20mani%C3%A8re%20dont%20les%20plateformes%20num%C3%A9riques%20ont%20transform%C3%A9%20les%20processus%20de%20cr%C3%A9ation%20artistique.')%3Bcheck('contact_public')%3Bset('jury_president'%2C'Prof.%20Jean-Luc%20Moreau')%3Bset('jury_promoteur'%2C'Dr.%20Aline%20Vandenberghe')%3Bcheck('jury_promoteur_ext')%3Bset('ann%C3%A9e'%2C'2025')%3Bset('orientation'%2C'4')%3Bset('ap'%2C'3')%3Bset('finality'%2C'1')%3BcheckCB('languages'%2C'1')%3BcheckCB('languages'%2C'2')%3BcheckCB('formats'%2C'1')%3BcheckCB('formats'%2C'3')%3Bset('tag'%2C'r%C3%A9seaux%20sociaux%2Cart%20num%C3%A9rique%2Csociologie%2Cpratique%20artistique')%3Bset('license_id'%2C'7')%3Bset('duration_info'%2C'96%20pages')%3Bset('lien'%2C'https%3A%2F%2Fexample.com%2Ftfe-test')%3Bset('access_type_id'%2C'2')%3Bcheck('cc4r')%3B%7D)())**
Open `/admin/add.php` (logged in), then click the bookmarklet:
### Readable source
```
javascript:(function(){var set=function(n,v){var e=document.querySelector('[name="'+n+'"]');if(e){e.value=v;e.dispatchEvent(new Event('change',{bubbles:true}));}};var setFirst=function(n,v){var e=document.querySelector('[name="'+n+'"][type="text"]');if(e){e.value=v;e.dispatchEvent(new Event('change',{bubbles:true}));}};var checkCB=function(n,v){var e=document.querySelector('[name="'+n+'[]"][value="'+v+'"]');if(e){e.checked=true;e.dispatchEvent(new Event('change',{bubbles:true}));}};var check=function(n){var e=document.querySelector('[name="'+n+'"]');if(e){e.checked=true;e.dispatchEvent(new Event('change',{bubbles:true}));}};set('titre','TFE Test — Impact des réseaux sociaux');set('subtitle','Étude de cas auprès des étudiant·es de l\'ERG');set('auteurice','Marie-France Dupont');set('contact_visible','public');setFirst('jury_promoteur[]','Dr. Aline Vandenberghe');setFirst('jury_lecteur_interne[]','Prof. Jean-Luc Moreau');setFirst('jury_lecteur_externe[]','Prof. Kim Sølv');setFirst('jury_promoteur_ulb_name[]','Prof. Université');set('synopsis','Ce travail explore l\'impact des plateformes numériques sur la pratique artistique contemporaine.');set('orientation','4');set('ap','3');set('finality','1');checkCB('formats','1');checkCB('formats','3');set('license_id','8');set('duration_pages','96');check('cc2r');set('website_url','https://example.com/tfe-test');set('access_type_id','2');set('contact_interne','mfd@testmail.be');set('jury_points','16.5');})()
```
## Readable source
```js
(function () {
var f = document.querySelector('form.admin-form');
if (!f) return;
var set = function (name, val) {
var e = f.querySelector('[name="' + name + '"]');
if (e) { e.value = val; e.dispatchEvent(new Event('change', { bubbles: true })); }
var set = function (n, v) {
var e = document.querySelector('[name="' + n + '"]');
if (e) { e.value = v; e.dispatchEvent(new Event('change', { bubbles: true })); }
};
var check = function (name) {
var e = f.querySelector('[name="' + name + '"]');
var setFirst = function (n, v) { // first hidden/text field of a jury array
var e = document.querySelector('[name="' + n + '"][type="text"]');
if (e) { e.value = v; e.dispatchEvent(new Event('change', { bubbles: true })); }
};
var checkCB = function (n, v) { // checkbox-list (formats[]) value
var e = document.querySelector('[name="' + n + '[]"][value="' + v + '"]');
if (e) { e.checked = true; e.dispatchEvent(new Event('change', { bubbles: true })); }
};
var checkCB = function (name, val) {
var e = f.querySelector('[name="' + name + '[]"][value="' + val + '"]');
var check = function (n) {
var e = document.querySelector('[name="' + n + '"]');
if (e) { e.checked = true; e.dispatchEvent(new Event('change', { bubbles: true })); }
};
// ── Informations du TFE ──
set('titre', 'TFE Test — Impact des réseaux sociaux sur la pratique artistique contemporaine');
set('titre', 'TFE Test — Impact des réseaux sociaux');
set('subtitle', 'Étude de cas auprès des étudiant·es de l\'ERG');
set('auteurice', 'Marie-France Dupont');
set('mail', 'mfd@testmail.be');
set('synopsis', 'Ce travail explore la manière dont les plateformes numériques ont transformé les processus de création artistique.');
check('contact_public');
set('auteurice', 'Marie-France Dupont'); // comma-separated
set('contact_visible', 'public'); // admin mode; partage uses 'mail'
// ── Jury ──
set('jury_president', 'Prof. Jean-Luc Moreau');
set('jury_promoteur', 'Dr. Aline Vandenberghe');
check('jury_promoteur_ext');
// ── Jury (array fields, one row each) ──
setFirst('jury_promoteur[]', 'Dr. Aline Vandenberghe');
setFirst('jury_lecteur_interne[]', 'Prof. Jean-Luc Moreau');
setFirst('jury_lecteur_externe[]', 'Prof. Kim Sølv');
setFirst('jury_promoteur_ulb_name[]', 'Prof. Université');
// ── Cadre académique ──
set('année', '2025');
set('orientation', '4'); // Installation-Performance
set('ap', '3'); // Atelier Pratiques Situées
set('finality', '1'); // Approfondi
checkCB('languages', '1'); // Français
checkCB('languages', '2'); // Anglais
checkCB('formats', '1'); // Site web
checkCB('formats', '3'); // Vidéo
set('tag', 'réseaux sociaux, art numérique, sociologie, pratique artistique');
set('synopsis', 'Ce travail explore l\'impact des plateformes numériques sur la pratique artistique contemporaine.');
set('orientation', '4'); // Installation-Performance
set('ap', '3'); // Atelier Pratiques Situées
set('finality', '1'); // Approfondie
checkCB('formats', '1'); // Site web
checkCB('formats', '3'); // Vidéo
// ── Métadonnées complémentaires ──
set('license_id', '7'); // Tous droits réservés
set('duration_info', '96 pages');
set('lien', 'https://example.com/tfe-test');
// ── Métadonnées ──
set('license_id', '8'); // Tous droits réservés
set('duration_pages', '96');
check('cc2r'); // CC2r licence
set('website_url', 'https://example.com/tfe-test');
set('access_type_id', '2'); // Interne
// ── Licences (student mode only) ──
check('cc4r');
set('contact_interne', 'mfd@testmail.be');
set('jury_points', '16.5');
})();
```
### Lookup table reference (schema.sql seed IDs)
## Notes & current field names (verified against the form partials)
| Table | ID | Value |
|---|---|---|
| **orientations** | 1 | Arts Numériques |
| | 2 | Dessin |
| | 3 | Cinéma d'animation |
| | 4 | Installation-Performance |
| | 5 | Peinture |
| | 6 | Photographie |
| | 7 | Sculpture |
| | 8 | Vidéographie |
| | 9 | Graphisme |
| | 10 | Typographie |
| | 11 | Design Numérique |
| | 12 | Illustration |
| | 13 | Bande-Dessinée |
| | 14 | Sérigraphie |
| | 15 | Gravure |
| **ap_programs** | 1 | Narration Spéculative |
| | 2 | Design et Politique du Multiple |
| | 3 | Atelier Pratiques Situées |
| | 4 | LIENS |
| **finality_types** | 1 | Approfondi |
| | 2 | Enseignement |
| | 3 | Spécialisé |
| **languages** | 1 | Français |
| | 2 | Anglais |
| **format_types** | 1 | Site web |
| | 2 | Audio |
| | 3 | Vidéo |
| | 4 | Performance |
| | 5 | Objet éditorial |
| | 6 | Installation |
| | 7 | Autre |
| **license_types** | 1 | CC BY 4.0 |
| | 2 | CC BY-SA 4.0 |
| | 3 | CC BY-ND 4.0 |
| | 4 | CC BY-NC 4.0 |
| | 5 | CC BY-NC-SA 4.0 |
| | 6 | CC BY-NC-ND 4.0 |
| | 7 | Tous droits réservés |
| | 8 | Domaine public |
| **access_types** | 1 | Libre |
| | 2 | Interne |
| | 3 | Interdit |
| Field | Notes |
|-------|-------|
| `titre`, `subtitle`, `auteurice` | `auteurice` is comma-separated |
| `contact_visible` | admin add/edit; the partage form uses `mail` |
| `jury_promoteur[]`, `jury_lecteur_interne[]`, `jury_lecteur_externe[]`, `jury_promoteur_ulb_name[]` | one `input[type=text]` per row (`setFirst` targets the first) |
| `orientation`, `ap`, `finality` | `<select>`; values are DB ids |
| `formats[]` | checkbox-list |
| `languages[]`, `tags[]` | **pill-search** (type-ahead with hidden `name=…[]` pills) — not pre-filled by this simple helper; add pills through the search UI or dispatch the pill-create event |
| `license_id` | `<select>` of `license_types` |
| `cc2r` | checkbox (renamed from `cc4r`) |
| `want_license` | hidden `0`; set to `1` to show the licence explanation block |
| `duration_pages` | combined duration: pages int; time uses `duration_h` + `duration_m` (values in minutes) |
| `website_url`, `website_label` | the "lien" (site web) fields |
| `access_type_id` | radio: `""`, `1`=Libre, `2`=Interne, `3`=Interdit |
| `contact_interne`, `exemplaire_baiu`, `exemplaire_erg`, `is_published`, `context_note`, `jury_points`, `remarks` | other form fields |
### Removed / renamed
- `cc4r` → `cc2r`
- `duration_info` → split into `duration_pages` + `duration_h`/`duration_m`
- `jury_president`, single `jury_promoteur` → jury arrays above (`jury_promoteur[]` etc.)
- `lien` → `website_url`; `mail` in admin mode → `contact_visible`
- `contact_public` checkbox → handled via `authors.show_contact` / `contact_visible`
- `?mode=student` → student flows go through `/partage/<slug>`
### Lookup ids
`orientations` 4=`Installation-Performance`; `ap_programs` 3=`Atelier Pratiques
Situées`; `finality_types` 1=`Approfondie`; `format_types` 1=`Site web`,
3=`Vidéo`; `license_types` 8=`Tous droits réservés`; `access_types` 2=`Interne`.
> IDs may shift after DB migrations that re-number reference rows — verify
> against the current `app/storage/schema.sql` seed data if a lookup fails.