Skip to content

Commit

Permalink
Merge remote-tracking branch 'default-theme/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrocha committed Sep 19, 2024
2 parents d0f23f0 + 58fc8a5 commit 3bde6f1
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 49 deletions.
19 changes: 19 additions & 0 deletions static/js/incidents.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,23 @@ $(document).ready(function () {
let deleteUrl = deleteUrlBase.replace('0', incidentId);
modalDeleteButton.attr('href', deleteUrl);
});

$('.contacts_incident').on("click", function () {
let $this = $(this);
const contacts = $this.data('contacts');
if (contacts.contact_name == contacts.technical_name) {
$('#technical-card').remove();
let both_subtitle = $('#translated-both-contact-text').text();
$('#card-subtitle-contact').text(both_subtitle);
}

$('#contact-name').text(contacts.contact_name);
$('#contact-jobtitle').text(contacts.contact_jobtitle);
$('#contact-email').text(contacts.contact_email);
$('#contact-telephone').text(contacts.contact_telephone);
$('#technical-name').text(contacts.technical_name);
$('#technical-jobtitle').text(contacts.technical_jobtitle);
$('#technical-email').text(contacts.technical_email);
$('#technical-telephone').text(contacts.technical_telephone);
});
});
18 changes: 0 additions & 18 deletions static/js/incidents_observer.js

This file was deleted.

19 changes: 0 additions & 19 deletions static/js/incidents_regulator.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
$(document).ready(function () {
$('.contacts_incident').on("click", function () {
let $this = $(this);
const contacts = $this.data('contacts');
if (contacts.contact_name == contacts.technical_name) {
$('#technical-card').remove();
let both_subtitle = $('#translated-both-contact-text').text();
$('#card-subtitle-contact').text(both_subtitle);
}

$('#contact-name').text(contacts.contact_name);
$('#contact-email').text(contacts.contact_email);
$('#contact-telephone').text(contacts.contact_telephone);
$('#technical-name').text(contacts.technical_name);
$('#technical-email').text(contacts.technical_email);
$('#technical-telephone').text(contacts.technical_telephone);
});
});

function getCookie(name) {
let cookieValue = null;
if (document.cookie && document.cookie !== '') {
Expand Down
6 changes: 4 additions & 2 deletions templates/modals/contacts_incident.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ <h4 class="modal-title" id="contacts_incident_label">
<div class="card" id="contact-card">
<div class="card-body text-center">
<h5 class="card-title" id="contact-name"></h5>
<h6 class="card-subtitle text-muted" id="card-subtitle-contact">{% translate "Person in charge" %}</h6>
<h6 class="card-subtitle text-muted" id="contact-jobtitle"></h6>
<h6 class="small card-subtitle text-muted fst-italic" id="card-subtitle-contact">{% translate "Person in charge" %}</h6>
<span id="translated-both-contact-text" class="d-none">
{% translate "Person in charge and technical contact" %}
</span>
Expand All @@ -34,7 +35,8 @@ <h6 class="card-subtitle text-muted" id="card-subtitle-contact">{% translate "Pe
<div class="card" >
<div class="card-body text-center">
<h5 class="card-title" id="technical-name"></h5>
<h6 class="card-subtitle mb-2 text-muted">{% translate "Technical contact" %}</h6>
<h6 class="card-subtitle text-muted" id="technical-jobtitle"></h6>
<h6 class="small card-subtitle text-muted fst-italic">{% translate "Technical contact" %}</h6>
</div>
<ul class="list-group list-group-flush bg-white">
<li class="list-group-item">
Expand Down
12 changes: 4 additions & 8 deletions templates/observer/incidents.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
{% extends 'incidents_base.html' %}
{% load static %}

{% block bootstrap5_extra_script %}
{{ block.super }}
<script src='{% static "js/incidents_observer.js" %}'></script>
{% endblock %}

{% load i18n %}
{% load custom_filters %}
Expand Down Expand Up @@ -78,10 +72,12 @@
{{ block.super }}
<button class="btn text-secondary p-0 border-0 contacts_incident"
data-contacts='{
"contact_name": "{{ incident.contact_title }} {{ incident.contact_firstname }} {{ incident.contact_lastname }}",
"contact_name": "{{ incident.contact_firstname }} {{ incident.contact_lastname }}",
"contact_jobtitle": "{{ incident.contact_title }}",
"contact_email": "{{ incident.contact_email }}",
"contact_telephone": "{{ incident.contact_telephone }}",
"technical_name": "{{ incident.technical_title }} {{ incident.technical_firstname }} {{ incident.technical_lastname }}",
"technical_name": "{{ incident.technical_firstname }} {{ incident.technical_lastname }}",
"technical_jobtitle": "{{ incident.technical_title }}",
"technical_email": "{{ incident.technical_email }}",
"technical_telephone": "{{ incident.technical_telephone }}"
}'
Expand Down
6 changes: 4 additions & 2 deletions templates/regulator/incidents.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
{{ block.super }}
<button class="btn text-secondary p-0 border-0 contacts_incident"
data-contacts='{
"contact_name": "{{ incident.contact_title }} {{ incident.contact_firstname }} {{ incident.contact_lastname }}",
"contact_name": "{{ incident.contact_firstname }} {{ incident.contact_lastname }}",
"contact_jobtitle": "{{ incident.contact_title }}",
"contact_email": "{{ incident.contact_email }}",
"contact_telephone": "{{ incident.contact_telephone }}",
"technical_name": "{{ incident.technical_title }} {{ incident.technical_firstname }} {{ incident.technical_lastname }}",
"technical_name": "{{ incident.technical_firstname }} {{ incident.technical_lastname }}",
"technical_jobtitle": "{{ incident.technical_title }}",
"technical_email": "{{ incident.technical_email }}",
"technical_telephone": "{{ incident.technical_telephone }}"
}'
Expand Down

0 comments on commit 3bde6f1

Please sign in to comment.