Projet

Général

Profil

0001-braine-l-alleud-remove-deliberations-communales-json.patch

Nicolas Roche (absent jusqu'au 3 avril), 24 septembre 2021 16:01

Télécharger (3,48 ko)

Voir les différences:

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

 static/braine-l-alleud/config.json            |  7 +--
 .../combo/json/deliberations-communales.html  | 52 -------------------
 2 files changed, 1 insertion(+), 58 deletions(-)
 delete mode 100644 templates/variants/braine-l-alleud/combo/json/deliberations-communales.html
static/braine-l-alleud/config.json
51 51
                  {
52 52
                     "label" : "Identifiant du type d’actualités",
53 53
                     "type" : "string",
54 54
                     "varname" : "slug"
55 55
                  }
56 56
               ],
57 57
               "name" : "Actualités",
58 58
               "url" : "{{ braine_actualites_json_url }}"
59
            },
60
            "deliberations-communales": {
61
               "cache_duration" : 360,
62
               "force_async" : false,
63
               "name" : "Délibérations communales",
64
               "url" : "{{ braine_deliberations_communales_json_url }}"
59
               "url" : "{{ passerelle_url }}plone/{{ connector }}/q/{{ query }}/"
65 60
            }
66 61
         }
67 62
      }
68 63
   },
69 64
   "variables" : {
70 65
      "cell_picture_size" : "400x220",
71 66
      "include_top_links" : false,
72 67
      "pwa_display": "standalone",
templates/variants/braine-l-alleud/combo/json/deliberations-communales.html
1
{% load dashboard thumbnail %}
2
{% if not in_dashboard %}
3
<div class="dashboard-settings">
4
<div class="dashboard-meta">
5
<h2>Délibérations communales</h2>
6
<div>Lorem ipsum...</div>
7
</div>
8
<div class="dashboard-switch">
9
  {% with tile=cell|as_dashboard_cell:request.user %}
10
  <input type="checkbox" id="deliberations-communales-id"
11
      data-add-tile-url="{% url 'combo-dashboard-add-tile' cell_reference=cell.get_reference %}"
12
      {% if tile %}
13
      checked
14
      data-remove-tile-url="{% url 'combo-dashboard-remove-tile' cell_reference=tile.cell.get_reference %}"
15
      {% endif %}
16
    >
17
  {% endwith %}
18
  <script>
19
  $('#deliberations-communales-id').on('change', function() {
20
    if ($(this).is(':checked')) {
21
      var $checkbox = $(this);
22
      $.ajax({
23
        url: $(this).data('add-tile-url'),
24
        success: function(data) {
25
          $checkbox.data('remove-tile-url', data.cell_data.remove_url);
26
          $('h1#logo').addClass('dashboard-change').on('animationend', function() { $('h1#logo').removeClass('dashboard-change')});
27
        }
28
      });
29
    } else {
30
      $.ajax({
31
        url: $(this).data('remove-tile-url'),
32
        success: function(data) {}
33
      });
34
    }
35
  });
36
  </script>
37
</div>
38
</div>
39

  
40
{% else %}
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 }}
45
        {% if entry.review_state == 'decision' %}- décision
46
        {% elif entry.review_state == 'in_project' %}- projet de décision
47
        {% endif %}
48
</a></p>
49
{% empty %}
50
<p>Aucune.</p>
51
{% endfor %}
52
{% endif %}
53
-