Projet

Général

Profil

0002-braine-l-alleud-update-deliberations-communales-json.patch

Nicolas Roche, 28 septembre 2021 16:01

Télécharger (3,28 ko)

Voir les différences:

Subject: [PATCH 2/2] braine-l-alleud: update deliberations-communales json
 cell (#56545)

 static/braine-l-alleud/config.json                 | 14 +++++++++++++-
 .../combo/json/deliberations-communales.html       |  7 +++----
 2 files changed, 16 insertions(+), 5 deletions(-)
static/braine-l-alleud/config.json
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 59
               "cache_duration" : 360,
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 }}"
74
               "url" : "{{ passerelle_url }}plone-restapi/{{ connector }}/q/{{ query }}/"
63 75
            }
64 76
         }
65 77
      }
66 78
   },
67 79
   "variables" : {
68 80
      "cell_picture_size" : "400x220",
69 81
      "include_top_links" : false,
70 82
      "pwa_display": "standalone",
templates/variants/braine-l-alleud/combo/json/deliberations-communales.html
1 1
{% load dashboard 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>Lorem ipsum...</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 %}"
......
34 34
    }
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

  
43
{% for entry in json.items|slice:":5" %}
44
<p><a href="{{ entry|get:'@id' }}">Séance du {{ entry.title }}
42
{% for entry in json.data %}
43
<p><a href="{{ entry.portal_id }}">Séance du {{ entry.title }}
45 44
        {% if entry.review_state == 'decision' %}- décision
46 45
        {% elif entry.review_state == 'in_project' %}- projet de décision
47 46
        {% endif %}
48 47
</a></p>
49 48
{% empty %}
50 49
<p>Aucune.</p>
51 50
{% endfor %}
52 51
{% endif %}
53
-