Skip to content
This repository was archived by the owner on Mar 3, 2025. It is now read-only.

Commit 891ccb3

Browse files
committed
Ajout de liens dans le lecteur de messages du portail
1 parent b3dc379 commit 891ccb3

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

noethysweb/fiche_famille/templates/fiche_famille/famille_messagerie_portail.html

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,12 @@
7575
<div class="direct-chat-msg">
7676
<div class="direct-chat-infos clearfix">
7777
<span class="direct-chat-name float-left">{{ message.famille }}</span>
78-
<span class="direct-chat-timestamp float-right">{{ message.date_creation|date:"l j F Y H:i" }}</span>
78+
<span class="direct-chat-timestamp float-right">{{ message.date_creation|date:"l j F Y H:i" }}
79+
<span class="custom-switch custom-switch-off-danger custom-switch-on-success" title="Marquer comme lu">
80+
<input type="checkbox" class="custom-control-input case_switch" id="switch_{{ message.pk }}" data-idmessage="{{ message.pk }}" checked>
81+
<label class="custom-control-label" for="switch_{{ message.pk }}"></label>
82+
</span>
83+
</span>
7984
{% if not message.date_lecture %}<span class="badge bg-danger ml-md-2">Nouveau</span>{% endif %}
8085
</div>
8186
<img class="direct-chat-img" src="{% static "images/user.png" %}">
@@ -99,6 +104,27 @@
99104
<script>
100105
{# Scroll jusqu'en bas de la liste des messages #}
101106
$("#div_messages").scrollTop($("#div_messages").get(0).scrollHeight);
107+
108+
$(document).ready(function() {
109+
$(".case_switch").on("change", function(e) {
110+
$.ajax({
111+
type: "POST",
112+
url: "{% url 'ajax_message_marquer_lu' %}",
113+
data: {
114+
idmessage: $(this).data("idmessage"),
115+
etat: this.checked,
116+
csrfmiddlewaretoken: "{{ csrf_token }}",
117+
},
118+
datatype: "json",
119+
success: function(data){
120+
toastr.success("Modification du message effectuée");
121+
},
122+
error: function(data) {
123+
toastr.error(data.responseJSON.erreur);
124+
}
125+
})
126+
})
127+
})
102128
</script>
103129

104130
{% endif %}

noethysweb/outils/templates/outils/messagerie_portail.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ <h3 class="dropdown-item-title">
5050
{% embed 'core/box.html' with box_titre=True box_conclusion=True %}
5151
{% block box_theme %}card-outline card-lightblue direct-chat direct-chat-primary{% endblock %}
5252
{% block box_titre %}
53-
Discussion avec la famille {{ famille.nom }} pour la structure {{ structure.nom }}
53+
Discussion avec la famille <a href="{% url 'famille_resume' idfamille=famille.pk %}" title="Ouvrir la fiche famille (Conserver CTRL enfoncé pour ouvrir dans un nouvel onglet)">{{ famille.nom }}</a> pour la structure {{ structure.nom }}
5454
{% endblock %}
5555
{% block box_contenu %}
5656

0 commit comments

Comments
 (0)