summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikaël Ates <mates@entrouvert.com>2014-10-03 07:28:16 (GMT)
committerMikaël Ates <mates@entrouvert.com>2014-10-03 07:29:34 (GMT)
commita869df8f3d5ab8e773540b5099a4781a5958f992 (patch)
tree1acbbcce1fcbe5f34609a05cdbdd807c3ec85695
parentc69fae347b474eac436ff5d6a6d0c9e08acee77e (diff)
downloadcalebasse-a869df8f3d5ab8e773540b5099a4781a5958f992.zip
calebasse-a869df8f3d5ab8e773540b5099a4781a5958f992.tar.gz
calebasse-a869df8f3d5ab8e773540b5099a4781a5958f992.tar.bz2
dossiers: use the new comment field for addresses and contacts (fixes #4372).
-rw-r--r--calebasse/dossiers/forms.py13
-rw-r--r--calebasse/dossiers/templates/dossiers/generate_rtf_form.html7
-rw-r--r--calebasse/dossiers/templates/dossiers/patientrecord_print.html4
-rw-r--r--calebasse/dossiers/templates/dossiers/patientrecord_tab1_general.html2
-rw-r--r--calebasse/dossiers/templates/dossiers/patientrecord_tab3_adresses.html7
-rw-r--r--calebasse/dossiers/views.py3
-rw-r--r--calebasse/static/css/dossiers.css2
-rw-r--r--calebasse/static/js/calebasse.dossiers.js3
8 files changed, 24 insertions, 17 deletions
diff --git a/calebasse/dossiers/forms.py b/calebasse/dossiers/forms.py
index 5aa3adc..3e8fd3e 100644
--- a/calebasse/dossiers/forms.py
+++ b/calebasse/dossiers/forms.py
@@ -173,13 +173,20 @@ class PaperIDForm(ModelForm):
model = PatientRecord
fields = ('paper_id', )
+class AddrCommentForm(ModelForm):
+ class Meta:
+ model = PatientRecord
+ fields = ('addresses_contacts_comment', )
+ widgets = {
+ 'addresses_contacts_comment': forms.Textarea(attrs={'cols': 50, 'rows': 2}),
+ }
+
class PolicyHolderForm(ModelForm):
class Meta:
model = PatientRecord
- fields = ('policyholder', 'contact_comment')
- widgets = {
+ fields = ('policyholder',)
+ widgets = {
'policyholder': forms.RadioSelect(),
- 'contact_comment': forms.Textarea(attrs={'cols': 50, 'rows': 2}),
}
class PatientContactForm(ModelForm):
diff --git a/calebasse/dossiers/templates/dossiers/generate_rtf_form.html b/calebasse/dossiers/templates/dossiers/generate_rtf_form.html
index 9b1b232..fcffb18 100644
--- a/calebasse/dossiers/templates/dossiers/generate_rtf_form.html
+++ b/calebasse/dossiers/templates/dossiers/generate_rtf_form.html
@@ -24,15 +24,14 @@ errors:
</ul>
<h3>Adresse</h3>
-<p><strong>Commentaire :</strong> <br />
-{{ object.policyholder.contact_comment }}
-</p>
+
+{% if object.addresses_contacts_comment %}<p>Commentaire : <strong>{{ object.addresses_contacts_comment }}</strong></p>{% endif %}
<ul class="addresses">
{% for address in object.addresses.all %}
<li>
<span>{{ address.display_name }} {% if address.phone %}(Tél : {{ address.phone }}){% endif %}</span>
- <pre>{{ address.comment }}</pre>
+ {% if address.comment %}<p><em>Commentaire : {{ address.comment }}</em></p>{% endif %}
<ul>
{% if address.recipient %}
<li><input type="radio" name="contact" id="contact_{{ address.id }}_{{ contact.id }}"
diff --git a/calebasse/dossiers/templates/dossiers/patientrecord_print.html b/calebasse/dossiers/templates/dossiers/patientrecord_print.html
index 7b3957d..e5e4d54 100644
--- a/calebasse/dossiers/templates/dossiers/patientrecord_print.html
+++ b/calebasse/dossiers/templates/dossiers/patientrecord_print.html
@@ -56,9 +56,7 @@
{% else %}
<label class="highlight">Aucun lieu de vie d'indiqué</label>
{% endif %}
- {% if object.contact_comment %}
- <p>{{ object.contact_comment }}</p>
- {% endif %}
+ {% if object.addresses_contacts_comment %}<p>Commentaire : <strong>{{ object.addresses_contacts_comment }}</strong></p>{% endif %}
{% if object.addresses.all %}
<ul>
{% for address in object.addresses.all %}
diff --git a/calebasse/dossiers/templates/dossiers/patientrecord_tab1_general.html b/calebasse/dossiers/templates/dossiers/patientrecord_tab1_general.html
index d233729..bfa4c23 100644
--- a/calebasse/dossiers/templates/dossiers/patientrecord_tab1_general.html
+++ b/calebasse/dossiers/templates/dossiers/patientrecord_tab1_general.html
@@ -20,7 +20,7 @@
{% else %}
<label class="highlight">Aucun lieu de vie n'est indiqué.</label>
{% endif %}
- {% if object.contact_comment %}<p>{{ object.contact_comment|linebreaks }}</p>{% endif %}
+ {% if object.addresses_contacts_comment %}<p><strong>{{ object.addresses_contacts_comment }}</strong></p>{% endif %}
{% if object.addresses.all %}
<ul>
{% for address in object.addresses.all %}
diff --git a/calebasse/dossiers/templates/dossiers/patientrecord_tab3_adresses.html b/calebasse/dossiers/templates/dossiers/patientrecord_tab3_adresses.html
index 3e6a9dc..f94c248 100644
--- a/calebasse/dossiers/templates/dossiers/patientrecord_tab3_adresses.html
+++ b/calebasse/dossiers/templates/dossiers/patientrecord_tab3_adresses.html
@@ -5,7 +5,6 @@
{% load dossiers %}
{% block content %}
<div id="tabs-3">
- <form method="post" action="tab3" id="policyholder-form" class="patientrecordform">{% csrf_token %}
<p>
{% if nb_place_of_lifes == 1 %}
<span>Un lieu de vie unique est indiqué</span>
@@ -15,15 +14,19 @@
<span class="highlight">Aucun lieu de vie n'est indiqué.</span>
{% endif %}
</p>
+ <form method="post" action="tab3" class="autosubmit-form patientrecordform">{% csrf_token %}
<p>
<label>Commentaire <button class="save enable-on-change btn-maj">✔</button></label>
- {{ forms.policyholder.contact_comment }}
+ {{ forms.comment.addresses_contacts_comment }}
</p>
+ </form>
<p>
<button type="button" id="new-address-btn" class="icon-home-space">Nouvelle adresse</button>
<button type="button" id="new-contact-btn" class="icon-user-space">Nouveau contact</button>
</p>
+ <form method="post" action="tab3" class="autosubmit-form patientrecordform">{% csrf_token %}
+
<div class="contact patient">
<h4 class="icon-user-space">Patient</h4>
<div class="right">Assuré
diff --git a/calebasse/dossiers/views.py b/calebasse/dossiers/views.py
index 01cf043..8f792d2 100644
--- a/calebasse/dossiers/views.py
+++ b/calebasse/dossiers/views.py
@@ -334,7 +334,8 @@ class PatientRecordAddrView(cbv.ServiceViewMixin, cbv.NotificationDisplayView, c
model = PatientRecord
forms_classes = {
'contact': forms.PatientContactForm,
- 'policyholder': forms.PolicyHolderForm
+ 'policyholder': forms.PolicyHolderForm,
+ 'comment' : forms.AddrCommentForm,
}
template_name = 'dossiers/patientrecord_tab3_adresses.html'
success_url = './view#tab=2'
diff --git a/calebasse/static/css/dossiers.css b/calebasse/static/css/dossiers.css
index ad06838..ed9e06f 100644
--- a/calebasse/static/css/dossiers.css
+++ b/calebasse/static/css/dossiers.css
@@ -99,7 +99,7 @@ div#tabs-4 div div.buttons {
width: 85%;
}
-#id_policyholder-contact_comment {
+#id_comment-addresses_contacts_comment {
margin: 0;
}
diff --git a/calebasse/static/js/calebasse.dossiers.js b/calebasse/static/js/calebasse.dossiers.js
index c4523c2..ea54235 100644
--- a/calebasse/static/js/calebasse.dossiers.js
+++ b/calebasse/static/js/calebasse.dossiers.js
@@ -201,7 +201,7 @@ function load_tab3_addresses() {
});
}
$('.autosubmit').on('click', function() {
- $('#policyholder-form').submit();
+ $('.autosubmit-form').submit();
});
$('#new-contact-btn').click(function() {
generic_ajaxform_dialog('contact/new', 'Ajouter un contact',
@@ -475,4 +475,3 @@ function load_tab8_medical() {
});
})(window.jQuery)
-