Projet

Général

Profil

0001-saint-denis-add-a-madis-associations-JSON-cell-49717.patch

Nicolas Roche, 23 décembre 2020 14:30

Télécharger (4,48 ko)

Voir les différences:

Subject: [PATCH] saint-denis: add a madis-associations JSON cell (#49717)

 static/saint-denis/config.json                | 25 +++++++
 .../combo/json/mgdis-associations.html        | 71 +++++++++++++++++++
 2 files changed, 96 insertions(+)
 create mode 100644 templates/variants/saint-denis/combo/json/mgdis-associations.html
static/saint-denis/config.json
2 2
  "label": "Saint-Denis",
3 3
  "variables": {
4 4
    "theme_color": "#eb612d"
5 5
  },
6 6
  "settings": {
7 7
    "combo": {
8 8
      "COMBO_ASSET_SLOTS.update": {
9 9
        "header:logo": { "label": "Têtière : logo" }
10
      },
11
      "JSON_CELL_TYPES.update": {
12
        "mgdis-associations": {
13
          "name": "mgdis : associations",
14
          "url": "https://{{ login }}:{{ password }}@{{ host }}/aides/api/tenants/saintdenis/tiers?userid={{ user_nameid }}",
15
          "form": [
16
            {"label": "Adresse du serveur", "varname": "host", "required": true},
17
            {"label": "Login", "varname": "login", "required": true},
18
            {"label": "Mot de passe", "varname": "password", "required": true}
19
          ],
20
          "varnames": [],
21
          "log_errors": false,
22
          "cache_duration": 0,
23
          "force_async": true,
24
          "timeout": 5,
25
          "additional-data": [
26
            {
27
              "key": "json_demandes",
28
              "url": "https://{{ login }}:{{ password }}@{{ host }}/aides/api/tenants/saintdenis/demandes?userid={{ user_nameid }}",
29
              "cache_duration": 0,
30
              "log_errors": false,
31
              "timeout": 5
32
            }
33
          ]
34
        }
10 35
      }
11 36
    }
12 37
  }
13 38
}
templates/variants/saint-denis/combo/json/mgdis-associations.html
1
<div>
2
  {% if json_status != 200 or json_demandes_status != 200 %}
3
  ERREUR : logiciel de gestion des associations indisponible. Réponses transmises :
4
  <ul>
5
    <li>tiers : <i>{{ json_status }}</i></li>
6
    <li>demandes : <i>{{ json_demandes_status }}</i>
7
  </ul>
8
  {% else %}
9

  
10
  {# Tiers #}
11
  {% if not json or json.total == 0 %}
12
  <p>
13
    Afin de pouvoir réaliser des démarches pour le compte de votre association, il faut préalablement déclarer celle-ci auprès de la Ville de Saint-Denis, une fois cette déclaration effectuée de votre part et la fiche validée par la Ville de Saint-Denis, vous aurez accès aux démarches en ligne.
14
  </p>
15
  <h3>
16
    <a href="https://{{ host }}/aides/#/saintdenis/connecte/F_TDECLARASSO/depot/simple">
17
      Déclarer votre association
18
    </a>
19
  </h3>
20
  {% else %}
21
  <h2>Votre compte est lié à l'association : <b>{{ json.data.0.raisonSociale }}</b></h2>
22
  {% endif %}
23

  
24

  
25
  {# Demandes #}
26
  {% if json_demandes and json_demandes.total > 0 %}
27
  <h3>Demandes en cours pour votre association</h3>
28

  
29
  {% for demande in json_demandes.data %}
30
  <ul>
31
    <li>
32
      <a href="{{demande.url}}">{{demande.name}}</a> ({{demande.status}})
33
    </li>
34
  </ul>
35
  {% endfor %}
36
  <i>
37
    <a href="https://{{ host }}/aides/#/saintdenis/connecte/dashboard/aides/suivreDemandesAides">
38
      Accéder au détail de ces demandes
39
    </a>
40
  </i>
41
  {% endif %}
42

  
43
  {# liens vers les démarches #}
44
  {% if json and json.total > 0 and json.data.0.status == 'SUPPORTED' and json_demandes and json_demandes.total > 0 %}
45
  {% with first_demande=json_demandes.data|dictsort:"datetime"|first %}
46
  {% if first_demande.status == 'Clôturée' %}
47

  
48
  <h3>Déposer une nouvelle demande pour le compte de mon association</h3>
49
  <ul>
50
    <li>
51
      <a href="{{ eservices_url }}/organisation-evenement/">
52
        Organiser un évènement
53
      </a>
54
    </li>
55
    <li>
56
      <a href="https://{{ host }}/aides/#/saintdenis/connecte/dashboard/deposerDemandeAide">
57
        Déposer une demande de subvention
58
      </a>
59
    </li>
60
    <li>
61
      <a href="https://{{ host }}/aides/#/saintdenis/connecte/dashboard/accueil">
62
        Modifier la fiche de mon association
63
      </a>
64
    </li>
65
  </ul>
66
  {% endif %}
67
  {% endwith %}
68
  {% endif %}
69

  
70
{% endif %}
71
</div>
0
-