Projet

Général

Profil

0001-braine-l-alleud-get-deliberations-communales-from-pl.patch

Nicolas Roche, 08 novembre 2021 14:46

Télécharger (3,77 ko)

Voir les différences:

Subject: [PATCH] braine-l-alleud: get deliberations-communales from plone
 (#58182)

 static/braine-l-alleud/config.json               | 16 ++++++++++++++--
 .../combo/json/deliberations-communales.html     |  6 +++---
 2 files changed, 17 insertions(+), 5 deletions(-)
static/braine-l-alleud/config.json
51 51
                     "type" : "string",
52 52
                     "varname" : "query"
53 53
                  }
54 54
               ],
55 55
               "name" : "Actualités",
56 56
               "url" : "{{ passerelle_url }}plone-restapi/{{ connector }}/q/{{ query }}/"
57 57
            },
58 58
            "deliberations-communales": {
59
               "cache_duration" : 360,
59
               "cache_duration" : 120,
60 60
               "force_async" : false,
61
               "form" : [
62
                  {
63
                     "label" : "Identifiant du connecteur Plone REST API",
64
                     "type" : "string",
65
                     "varname" : "connector"
66
                  },
67
                  {
68
                     "label" : "Identifiant de la requête",
69
                     "type" : "string",
70
                     "varname" : "query"
71
                  }
72
               ],
61 73
               "name" : "Délibérations communales",
62
               "url" : "{{ braine_deliberations_communales_json_url|safe }}"
74
               "url" : "{{ passerelle_url }}plone-restapi/{{ connector }}/q/{{ query }}/"
63 75
            },
64 76
            "evenements" : {
65 77
               "cache_duration" : 120,
66 78
               "force_async" : false,
67 79
               "form" : [
68 80
                  {
69 81
                     "label" : "Identifiant du connecteur Plone REST API",
70 82
                     "type" : "string",
templates/variants/braine-l-alleud/combo/json/deliberations-communales.html
1 1
{% load dashboard static thumbnail %}
2 2
{% if not in_dashboard %}
3 3
<div class="dashboard-settings">
4 4
<div class="dashboard-meta">
5 5
<h2>Délibérations communales</h2>
6
<div>Soyez informés dès que les décisions publiques du Conseil communal auront été approuvées par ses membres.</div>
6
<div>{{json.meta.description}}</div>
7 7
</div>
8 8
<div class="dashboard-switch">
9 9
  {% with tile=cell|as_dashboard_cell:request.user %}
10 10
  <input type="checkbox" id="deliberations-communales-id"
11 11
      data-add-tile-url="{% url 'combo-dashboard-add-tile' cell_reference=cell.get_reference %}"
12 12
      {% if tile %}
13 13
      checked
14 14
      data-remove-tile-url="{% url 'combo-dashboard-remove-tile' cell_reference=tile.cell.get_reference %}"
......
35 35
  });
36 36
  </script>
37 37
</div>
38 38
</div>
39 39

  
40 40
{% else %}
41 41
<h2>Délibérations communales</h2>
42 42

  
43
{% for entry in json.items|slice:":5" %}
43
{% for entry in json.data %}
44 44
<div class="delib">
45 45
<img src="{{site_base}}{% static "" %}{{css_variant}}/placeholder-logo-bla.jpeg" alt="" height="160" width="160">
46 46
<div>
47
        <h3><a href="{{ entry|get:'@id' }}">Séance du {{ entry.title }}</a></h3>
47
        <h3><a href="{{ entry.PLONE_id }}">Séance du {{ entry.title }}</a></h3>
48 48
        <br>
49 49
        <p>
50 50
        {% if entry.review_state == 'decision' %}Décision
51 51
        {% elif entry.review_state == 'in_project' %}Projet de décision
52 52
        {% endif %}</p>
53 53
</div>
54 54
</div>
55 55
{% empty %}
56
-