Projet

Général

Profil

0001-braine-l-alleud-get-actualities-from-plone-56545.patch

Nicolas Roche, 01 septembre 2021 10:56

Télécharger (2,8 ko)

Voir les différences:

Subject: [PATCH] braine-l-alleud: get actualities from plone (#56545)

 static/braine-l-alleud/config.json                     |  2 +-
 .../braine-l-alleud/combo/json/actualites.html         | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)
static/braine-l-alleud/config.json
37 37
            }
38 38
         },
39 39
         "JSON_CELL_TYPES.update" : {
40 40
            "actualites" : {
41 41
               "additional-data" : [
42 42
                  {
43 43
                     "cache_duration" : 60,
44 44
                     "key" : "actus",
45
                     "url" : "{{ json.data|get:slug|get:'href' }}"
45
                     "url" : "{{ json.data|get:slug|get:'href' }}@search?portal_type={{ json.data|get:slug|get:'type' }}&sort_on=created&sort_order=descending&b_size=5&fullobjects"
46 46
                  }
47 47
               ],
48 48
               "cache_duration" : 60,
49 49
               "force_async" : false,
50 50
               "form" : [
51 51
                  {
52 52
                     "label" : "Identifiant du type d’actualités",
53 53
                     "type" : "string",
templates/variants/braine-l-alleud/combo/json/actualites.html
38 38
</div>
39 39
</div>
40 40
{% endwith %}
41 41
{% else %}
42 42
{% with actualites=json.data|get:slug %}
43 43
{% if actus.data %}
44 44
<button hidden class="newsitem-category" data-slug="{{ slug }}">{{actualites.label}}</button>
45 45
{% endif %}
46
{% for actu in actus.data %}
47
<div class="newsitem" data-slug="{{ slug }}" data-date="{{ actu.date }}">
46
{% for actu in actus.items %}
47
<div class="newsitem" data-slug="{{ slug }}" data-date="{{ actu.created }}">
48 48
{% thumbnail actu.image "160x160" crop="50% 25%" as im %}
49 49
<img src="{{ im.url }}" alt="" />
50 50
{% endthumbnail %}
51 51
<div>
52
<h3><a href="{{actu.href}}">{{actu.title}}</a></h3>
53
<h4>{{actualites.label}} - {{ actu.date|parse_date|date:"d/m/Y" }}</h4>
54
<p>{{actu.description}}</p>
52
<h3><a href="{{actu|get:'@id'}}">{{actu.title}}</a></h3>
53
<h4>{{actualites.label}} - {{ actu.created|slice:19|parse_date|date:"d/m/Y" }}</h4>
54
<p>{{actu.text.data|safe|escape}}</p>
55 55
</div>
56 56
</div>
57 57
{% endfor %}
58 58
{% if actus.data %}
59 59
<script>
60 60
jQuery.fn.order = function(asc, fn) { // via https://jsfiddle.net/mindplay/H2mrp/
61 61
    fn = fn || function (el) {
62 62
        return $(el).text().replace(/^\s+|\s+$/g, '');
63
-