addr_contacts_comment.patch
calebasse/dossiers/forms.py | ||
---|---|---|
173 | 173 |
model = PatientRecord |
174 | 174 |
fields = ('paper_id', ) |
175 |
class AddrCommentForm(ModelForm): |
|
176 |
class Meta: |
|
177 |
model = PatientRecord |
|
178 |
fields = ('addresses_contacts_comment', ) |
|
179 |
widgets = { |
|
180 |
'addresses_contacts_comment': forms.Textarea(attrs={'cols': 50, 'rows': 2}), |
|
181 |
} |
|
182 | ||
175 | 183 |
class PolicyHolderForm(ModelForm): |
176 | 184 |
class Meta: |
177 | 185 |
model = PatientRecord |
178 |
fields = ('policyholder', 'contact_comment')
|
|
179 |
widgets = { |
|
186 |
fields = ('policyholder',) |
|
187 |
widgets = { |
|
180 | 188 |
'policyholder': forms.RadioSelect(), |
181 |
'contact_comment': forms.Textarea(attrs={'cols': 50, 'rows': 2}), |
|
182 | 189 |
} |
183 | 190 |
class PatientContactForm(ModelForm): |
calebasse/dossiers/templates/dossiers/generate_rtf_form.html | ||
---|---|---|
24 | 24 |
</ul> |
25 | 25 |
<h3>Adresse</h3> |
26 |
<p><strong>Commentaire :</strong> <br /> |
|
27 |
{{ object.policyholder.contact_comment }} |
|
28 |
</p> |
|
26 | ||
27 |
{% if object.addresses_contacts_comment %}<p>Commentaire : <strong>{{ object.addresses_contacts_comment }}</strong></p>{% endif %} |
|
29 | 28 |
<ul class="addresses"> |
30 | 29 |
{% for address in object.addresses.all %} |
31 | 30 |
<li> |
32 | 31 |
<span>{{ address.display_name }} {% if address.phone %}(Tél : {{ address.phone }}){% endif %}</span> |
33 |
<pre>{{ address.comment }}</pre>
|
|
32 |
{% if address.comment %}<p><em>Commentaire : {{ address.comment }}</em></p>{% endif %}
|
|
34 | 33 |
<ul> |
35 | 34 |
{% if address.recipient %} |
36 | 35 |
<li><input type="radio" name="contact" id="contact_{{ address.id }}_{{ contact.id }}" |
calebasse/dossiers/templates/dossiers/patientrecord_print.html | ||
---|---|---|
56 | 56 |
{% else %} |
57 | 57 |
<label class="highlight">Aucun lieu de vie d'indiqué</label> |
58 | 58 |
{% endif %} |
59 |
{% if object.contact_comment %} |
|
60 |
<p>{{ object.contact_comment }}</p> |
|
61 |
{% endif %} |
|
59 |
{% if object.addresses_contacts_comment %}<p>Commentaire : <strong>{{ object.addresses_contacts_comment }}</strong></p>{% endif %} |
|
62 | 60 |
{% if object.addresses.all %} |
63 | 61 |
<ul> |
64 | 62 |
{% for address in object.addresses.all %} |
calebasse/dossiers/templates/dossiers/patientrecord_tab1_general.html | ||
---|---|---|
20 | 20 |
{% else %} |
21 | 21 |
<label class="highlight">Aucun lieu de vie n'est indiqué.</label> |
22 | 22 |
{% endif %} |
23 |
{% if object.contact_comment %}<p>{{ object.contact_comment|linebreaks }}</p>{% endif %}
|
|
23 |
{% if object.addresses_contacts_comment %}<p><strong>{{ object.addresses_contacts_comment }}</strong></p>{% endif %}
|
|
24 | 24 |
{% if object.addresses.all %} |
25 | 25 |
<ul> |
26 | 26 |
{% for address in object.addresses.all %} |
calebasse/dossiers/templates/dossiers/patientrecord_tab3_adresses.html | ||
---|---|---|
5 | 5 |
{% load dossiers %} |
6 | 6 |
{% block content %} |
7 | 7 |
<div id="tabs-3"> |
8 |
<form method="post" action="tab3" id="policyholder-form" class="patientrecordform">{% csrf_token %} |
|
9 | 8 |
<p> |
10 | 9 |
{% if nb_place_of_lifes == 1 %} |
11 | 10 |
<span>Un lieu de vie unique est indiqué</span> |
... | ... | |
15 | 14 |
<span class="highlight">Aucun lieu de vie n'est indiqué.</span> |
16 | 15 |
{% endif %} |
17 | 16 |
</p> |
17 |
<form method="post" action="tab3" class="autosubmit-form patientrecordform">{% csrf_token %} |
|
18 | 18 |
<p> |
19 | 19 |
<label>Commentaire <button class="save enable-on-change btn-maj">✔</button></label> |
20 |
{{ forms.policyholder.contact_comment }}
|
|
20 |
{{ forms.comment.addresses_contacts_comment }}
|
|
21 | 21 |
</p> |
22 |
</form> |
|
22 | 23 |
<p> |
23 | 24 |
<button type="button" id="new-address-btn" class="icon-home-space">Nouvelle adresse</button> |
24 | 25 |
<button type="button" id="new-contact-btn" class="icon-user-space">Nouveau contact</button> |
25 | 26 |
</p> |
27 |
<form method="post" action="tab3" class="autosubmit-form patientrecordform">{% csrf_token %} |
|
28 | ||
26 | 29 |
<div class="contact patient"> |
27 | 30 |
<h4 class="icon-user-space">Patient</h4> |
28 | 31 |
<div class="right">Assuré |
calebasse/dossiers/views.py | ||
---|---|---|
334 | 334 |
model = PatientRecord |
335 | 335 |
forms_classes = { |
336 | 336 |
'contact': forms.PatientContactForm, |
337 |
'policyholder': forms.PolicyHolderForm |
|
337 |
'policyholder': forms.PolicyHolderForm, |
|
338 |
'comment' : forms.AddrCommentForm, |
|
338 | 339 |
} |
339 | 340 |
template_name = 'dossiers/patientrecord_tab3_adresses.html' |
340 | 341 |
success_url = './view#tab=2' |
calebasse/static/css/dossiers.css | ||
---|---|---|
99 | 99 |
width: 85%; |
100 | 100 |
} |
101 |
#id_policyholder-contact_comment {
|
|
101 |
#id_comment-addresses_contacts_comment {
|
|
102 | 102 |
margin: 0; |
103 | 103 |
} |
calebasse/static/js/calebasse.dossiers.js | ||
---|---|---|
201 | 201 |
}); |
202 | 202 |
} |
203 | 203 |
$('.autosubmit').on('click', function() { |
204 |
$('#policyholder-form').submit();
|
|
204 |
$('.autosubmit-form').submit();
|
|
205 | 205 |
}); |
206 | 206 |
$('#new-contact-btn').click(function() { |
207 | 207 |
generic_ajaxform_dialog('contact/new', 'Ajouter un contact', |
... | ... | |
475 | 475 |
}); |
476 | 476 |
})(window.jQuery) |
477 |